types.h 1.1 KB
Newer Older
朔-望's avatar
朔-望 已提交
1 2 3
#pragma once;

namespace paddle_mobile {
朔-望's avatar
朔-望 已提交
4
enum class Precision : int { FP32 = 0 };
朔-望's avatar
朔-望 已提交
5

朔-望's avatar
朔-望 已提交
6 7
//! device type
enum DeviceTypeEnum { kINVALID = -1, kCPU = 0, kFPGA = 1, kGPU_MALI = 2 };
朔-望's avatar
朔-望 已提交
8

朔-望's avatar
朔-望 已提交
9 10
template <DeviceTypeEnum T>
struct DeviceType {};
朔-望's avatar
朔-望 已提交
11

朔-望's avatar
朔-望 已提交
12 13 14
typedef DeviceType<kCPU> CPU;
typedef DeviceType<kFPGA> FPGA;
typedef DeviceType<kGPU_MALI> GPU_MALI;
朔-望's avatar
朔-望 已提交
15

朔-望's avatar
朔-望 已提交
16 17
//! data type
enum DataType {
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  PM_INVALID = -1,
  PM_HALF = 0,
  PM_FLOAT = 1,
  PM_DOUBLE = 2,
  PM_INT8 = 3,
  PM_INT16 = 4,
  PM_INT32 = 5,
  PM_INT64 = 6,
  PM_UINT8 = 7,
  PM_UINT16 = 8,
  PM_UINT32 = 9,
  PM_STRING = 10,
  PM_BOOL = 11,
  PM_SHAPE = 12,
  PM_TENSOR = 13
朔-望's avatar
朔-望 已提交
33 34 35
};
//!
enum PMStatus {
36 37 38 39 40 41 42 43 44
  PMSuccess = 0xFF,        /*!< No errors */
  PMNotInitialized = 0x01, /*!< Data not initialized. */
  PMInvalidValue = 0x02,   /*!< Incorrect variable value. */
  PMMemAllocFailed = 0x03, /*!< Memory allocation error. */
  PMUnKownError = 0x04,    /*!< Unknown error. */
  PMOutOfAuthority = 0x05, /*!< Try to modified data not your own*/
  PMOutOfMem = 0x06,       /*!< OOM error*/
  PMUnImplError = 0x07,    /*!< Unimplement error. */
  PMWrongDevice = 0x08     /*!< un-correct device. */
朔-望's avatar
朔-望 已提交
45
};
朔-望's avatar
朔-望 已提交
46
}  // namespace paddle_mobile