/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.*/
// Modification Copyright (C) 2018-2022 Intel Corporation

syntax = "proto3";

package tensorflow;

import "attr_value.proto";

option cc_enable_arenas = true;
option java_outer_classname = "KernelDefProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/kernel_def_go_proto";

message KernelDef {
  // Must match the name of an Op.
  string op = 1;

  // Type of device this kernel runs on.
  string device_type = 2;

  message AttrConstraint {
    // Name of an attr from the Op.
    string name = 1;

    // A list of values that this kernel supports for this attr.
    // Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
    AttrValue allowed_values = 2;
  }
  repeated AttrConstraint constraint = 3;

  // Names of the Op's input_/output_args that reside in host memory
  // instead of device memory.
  repeated string host_memory_arg = 4;

  // This allows experimental kernels to be registered for an op that
  // won't be used unless the user specifies a "_kernel" attr with
  // value matching this.
  string label = 5;

  // Prioritization of kernel amongst different devices. By default we assume
  // priority is 0. The higher the priority the better. By default (i.e. if
  // this is not set), we prefer GPU kernels over CPU.
  int32 priority = 6;
}

// A collection of KernelDefs
message KernelList {
  repeated KernelDef kernel = 1;
}
