lite/common_enum_c.h

enum LiteLogLevel

The log level.

Values:

enumerator DEBUG

the lowest level and most verbose

enumerator INFO

print information, warning and errors

enumerator WARN

print only warning and errors

enumerator ERROR

print only errors

enum ErrorCode

The error code.

Values:

enumerator OK

no error

enumerator LITE_INTERNAL_ERROR

internal error

enumerator LITE_UNKNOWN_ERROR

unknown error

enum LiteBackend

The backend type.

Values:

enumerator LITE_DEFAULT

default backend is mge

enum LiteDeviceType

The device type.

Values:

enumerator LITE_CPU

the device used is cpu

enumerator LITE_CUDA

the device used is cuda

enumerator LITE_ATLAS

the device used is atlas

enumerator LITE_NPU

the device used is npu

enumerator LITE_CAMBRICON

the device used is cambricon when the device information is set in model, so set LITE_DEVICE_DEFAULT in lite, which equal to xpu in megengine

enumerator LITE_DEVICE_DEFAULT
enum LiteDataType

The data type.

Values:

enumerator LITE_FLOAT

data type is float32

enumerator LITE_HALF

data type is float16

enumerator LITE_INT

data type is int32

enumerator LITE_INT16

data type is int16

enumerator LITE_INT8

data type is int8

enumerator LITE_UINT8

data type is uint8

enumerator LITE_UINT

data type is uint32

enumerator LITE_UINT16

data type is uint16

enumerator LITE_INT64

data type is int64

enum LiteTensorPhase

The tensor phase.

Values:

enumerator LITE_IO

tensor maybe input or output

enumerator LITE_INPUT

tensor is input

enumerator LITE_OUTPUT

tensor is output

enum LiteIOType

the input and output type, include SHAPE and VALUE sometimes user only need the shape of the output tensor

Values:

enumerator LITE_IO_VALUE

the type of input or output is value

enumerator LITE_IO_SHAPE

the type of input or output is shape

enum LiteAlgoSelectStrategy

Operation algorithm seletion strategy type, some operations have multi algorithms, different algorithm has different attribute, according to the strategy, the best algorithm will be selected.

Note: These strategies can be combined

  1. LITE_ALGO_HEURISTIC | LITE_ALGO_PROFILE means: if profile cache not valid, use heuristic instead

  2. LITE_ALGO_HEURISTIC | LITE_ALGO_REPRODUCIBLE means: heuristic choice the reproducible algo

  3. LITE_ALGO_PROFILE | LITE_ALGO_REPRODUCIBLE means: profile the best algorithm from the reproducible algorithms set

  4. LITE_ALGO_PROFILE | LITE_ALGO_OPTIMIZED means: profile the best algorithm form the optimzed algorithms, thus profile will process fast

  5. LITE_ALGO_PROFILE | LITE_ALGO_OPTIMIZED | LITE_ALGO_REPRODUCIBLE means: profile the best algorithm form the optimzed and reproducible algorithms

Values:

enumerator LITE_ALGO_HEURISTIC
enumerator LITE_ALGO_PROFILE
enumerator LITE_ALGO_REPRODUCIBLE
enumerator LITE_ALGO_OPTIMIZED
enum LiteOpenCLCacheCompatLevel

Enum for cache compat level, for example: adreno 630 cache may be apply to adreno 640, if you do not want search cache for adreno 640, just config SERIES_COMPAT or VENDOR_COMPAT, adreno 506 cache may be apply to adreno 630, if you do not want search cache for adreno 630, just config VENDOR_COMPAT.

WARN: this config just let program_cache_io try use a old cache for device compile the cache do not means MegEngine will insure the compile will be ok! it’s a device CL driver behavior, if compile failed!, MegEngine will try build from source, What’s more, even though compile from binary success, this cross-use-cache may affect performance, VENDOR_COMPAT will contain SERIES_COMPAT

Values:

enumerator LITE_NOT_COMPAT

default not compat for series and vendor

enumerator LITE_SERIES_COMPAT

for scene adreno 640 use adreno 630 cache

enumerator LITE_VENDOR_COMPAT

for scene adreno 630 use adreno 506 cache

enumerator LITE_CACHE_COMPAT_LEVEL_CNT