ops_kernel_info_types.h 1.8 KB
Newer Older
L
lujiale 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
/**
 * Copyright 2019-2020 Huawei Technologies Co., Ltd
 *
 * 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.
 */

#ifndef INC_COMMON_OPSKERNEL_OPS_KERNEL_INFO_TYPES_H_
#define INC_COMMON_OPSKERNEL_OPS_KERNEL_INFO_TYPES_H_

#include <stdint.h>

#include <string>
#include <vector>

#include "graph/buffer.h"
#include "runtime/rt_model.h"

using std::string;

namespace ge {
struct RunContext {
  rtModel_t model;
  rtStream_t stream;
  uint64_t sessionId;
  uint64_t dataMemSize;
  uint8_t *dataMemBase;
  uint64_t weightMemSize;
  uint8_t *weightMemBase;
  ge::Buffer weightsBuffer;
  std::vector<rtStream_t> graphStreamList;  // all streams of graph which are sort by ge stream id(0,1,...)
  std::vector<rtEvent_t> graphEventList;    // all events of graph which are sort by ge event id(0,1,...)
};

struct Task {
  uint32_t id;
  uint16_t type;
  void *stream;
  void *event;
};

struct OpInfo {
  string engine;       // engine name
  string opKernelLib;  // opsKernelStore name
  int computeCost;     // compute cost
  bool flagPartial;    // whether to support related shape
  bool flagAsync;      // Whether to support asynchronous
  bool isAtomic;       // whether to support atomic addr clean
  string opFileName;   // op file name
  string opFuncName;   // op function name
};
}  // namespace ge

#endif  // INC_COMMON_OPSKERNEL_OPS_KERNEL_INFO_TYPES_H_