# **Table of Enums** # 1. [CalDevAccType_e](#caldevacctype_e) 2. [CalbinModelType_e](#calbinmodeltype_e) 3. [CalbinModelArch_e](#calbinmodelarch_e) 4. [ModelChipMode_e](#modelchipmode_e) 5. [CalbinSectionPlace_e](#calbinsectionplace_e) 6. [CalbinSectionType_e](#calbinsectiontype_e) 7. [PrimitiveType](#primitivetype) 8. [CalrtBufferDirection_e](#calrtbufferdirection_e) 9. [TaskType_e](#tasktype_e) 10. [CalJobAlloStatus_e](#caljoballostatus_e) 11. [CalrtError_e](#calrterror_e) 12. [CalrtDeviceType_e](#calrtdevicetype_e) 13. [CalrtOutputBufStatus_e](#calrtoutputbufstatus_e) [Back to Main](../RuntimeAPI.md) --- ## ***CalDevAccType_e*** ## Calculet device acceleration type ### *Value* ### > `CAL_DEV_ACC_NULL = 0` undefined acceleration type > `CAL_DEV_ACC_CPU = 1` CPU acceleration only > `CAL_DEV_ACC_CCU = 2` CCU acceleration only > `CAL_DEV_ACC_CPU_CCU = 3` co-op CPU and CCU acceleration [Back to Top](#table-of-enums) --- ## ***CalbinModelType_e*** ## Calbin model type ### *Value* ### > `CNN = 0` CNN model type > `LLM = 1` LLM model type > `KV_UPDATE = 2` KV update op(model) type > `UNKOWN_MODEL_TYPE = 4` Unknown or unsupport model type. error report purpose. [Back to Top](#table-of-enums) --- ## ***CalbinModelArch_e*** ## Calbin model architecture. Model specific details about model type ### *Value* ### > `RESNET18 = 0` resnet18 architecture > `LLAMA3 = 1` LLAMA3 architecture > `GPT2 = 2` GPT2 architecture > `UNSUPPORTED_ARCH = 3` unsupported architecture. error report purpose. [Back to Top](#table-of-enums) --- ## ***ModelChipMode_e*** ## A chip arangement or hardware utilization strategy for current model. ### *Value* ### > `SCHIP = 0` infer model in single chip mode > `MCHIP = 1` infer model in multi-chips mode > `UNDEFINED_CHIP_MODE unsupported chip mode. error report purpose. [Back to Top](#table-of-enums) --- ## ***CalbinSectionPlace_e*** ## Descript where this calbin section store in the device ### *Value* ### > `DRAM = 0` store in device DRAM. it is used as default setting. > `SRAM = 1` store in device SRAM [Back to Top](#table-of-enums) --- ## ***CalbinSectionType_e*** ## Calbin section type. define the property of the certain calbin section struct. For more details about calbin section. Please read [CalbinSection_s](./struct.md#calbinsection_s). ### *Value* ### > `CALBIN_SECTION_NULL = 0` undefined section. > `CALBIN_SECTION_CPU_CMD = 1` a section about CPU program and related commands. > `CALBIN_SECTION_CPU_SO = 2` a section about shared libs used by CPU. > `CALBIN_SECTION_CCU_ELF = 3` a section about CCU ELF. > `CALBIN_SECTION_RODATA = 4` a section about model parameter. > `CALBIN_SECTION_IBUF = 5` a section about input buffer. > `CALBIN_SECTION_OBUF = 6` a section about output buffer > `CALBIN_SECTION_MEMRSVD = 7` a section about reserved memory for your calbin applying to Calculet device. > `CALBIN_SECTION_KV = 8` a section about kv cache and related information. > `CALBIN_SECTION_NUM = 9` the number of `CalbinSectionType_e`. [Back to Top](#table-of-enums) --- ## ***PrimitiveType*** ## Descript data type. ### *Value* ### > `U1=0` 1bit > `PRED=1` bool, int8 > `U8=2` unsigned int > `S8=3` signed int > `FP8_143=4` exp_bias = 8; has subnormal, no inf/nan. when biased_exp=0 it is fixed explained as unbiased_exp=-7; > `FP8_152=5` exp_bias = 16; has subnormal, no inf/nan. when biased_exp=0, it is fixed explained as unbiased_exp=-15; > `U16=6` 16b unsigned int > `S16=7` 16b signed int >`BF16=8` 16b > `U32=9` 32b unsigned integer > `S32=10` 32b signed integer > `F32=11` 32b float > `U4=12` 4b unsigned char > `S4=13` 4b signed char > `F35=14` 35b float > `U64=15` not support > `S64=16` u64和s64需要保留,仅做类型转换,因为pytorch要求tensor做index时必须为 long或byte或bool。 > `TF32=17` 19b. not support > `F16=18` > `F64=19` > `C64` > `C128` reserved > `TUPLE` 0b > `TOKEN` 32b > `OPAQUE_TYPE` 32b > `INVALID` 0b > `TYPE_SIZE` the number of data types. [Back to Top](#table-of-enums) --- ## ***CalrtBufferDirection_e*** ## Describe the data flow direction of the buffer. ### *Value* ### > `HostToDevice = 0` transfer data from host to device only. > `DeviceToHost = 1` transfer data from device to host only. > `Both = 4` 2-ways transfer. [Back to Top](#table-of-enums) --- ## ***TaskType_e*** ## Describe the task type. Used for ping-pong arrangement. ### *Value* ### > `TASK_PING = 0` ping property task. > `TASK_PONG = 1` pong property task. > `UNDEFINED_TASK = 2` undefined property task. error report purpose. [Back to Top](#table-of-enums) --- ## ***CalJobAlloStatus_e*** ## [CalrtJobEngine](./class.md) component. Used for descripting job condtion. > `JOB_PING = 0` ping condition job. executed by ping thread. > `JOB_PONG` pong condition job. executed by pong thread. > `JOB_PENDING` pending condition job. [Back to Top](#table-of-enums) --- ## ***CalrtError_e*** ## Calculet runtime error code. ### *Value* ### > `CalrtSuccess = 0` no error. > `CalrtErrorMemoryAllocation = 1` failed to allocate device memory. > `CalrtErrorMemoryAlreadyRegistered = 2` failed to register(reserve) device memory due to target memory address is already taken. > `CalrtErrorAssert = 3` runtime assert error. > `CalrtErrorInvalidValue = 4` invalid parameters paased to runtime API. > `CalrtErrorInvalidConfiguration = 5` indicate that device is requesting more resources that are satisfied by the current model. > `CalrtErrorNoDevice = 6` indicate there is no valid calculet device detected. > `CalrtErrorAlreadyConfigured = 7` reserved. indicate the current calbin is already configured on device. > `CalrtErrorIncompatibleDriver = 8` update device driver. too old to be supported by runtime > `CalrtErrorRequireNewerRT = 9` update runtime library. too old to be compatible with current device > `CalrtErrorNotFoundCalbin = 10` indicate calbin file is not found. > `CalrtErrorBrokenFile = 11` failed to read or write the target file. > `CalrtErrorInvalidELF = 12` ELF version is invalid. > `CalrtErrorFileNotFound = 13` indicate the target file cannot be found. > `CalrtErrorTimeout = 14` indicate connection between host and device is timeout. > `CalrtErrorOutOfRange = 15` indicate the passed argument is out of range. > `CalrtErrorNotExpected = 16` indicate the feedback or result is not expected. > `CalrtErrorMissConfiguration = 17` indicate the current model is not configured on the current device. > `CalrtErrorDeviceBusy = 18` indicate the current device is still connected and connection is not timeout. But it is too busy to execute the new request. > `CalrtErrorDeviceUnavailable = 19` device disconnected, PCIe loose contact, power supply low > `CalrtErrorInvalidCalbin = 20` indicate that calbin file is invalid to parse any valid data for configure models on the current device. > `CalrtErrorUnknown = 21` indicate unknown error. [Back to Top](#table-of-enums) --- ## ***CalrtDeviceType_e*** ## Descript current device type. ### *Value* ### > `PCIE = 0` the current device is a PCIE device. > `ETH = 1` the current device is an ethenet device. > `EMU = 2` the current device is an emulator. [Back to Top](#table-of-enums) --- ## ***CalrtOutputBufStatus_e*** ## Descript the current output buffer working status. [CalrtOutputBuf](./class.md) inner used for event notification. ### *Value* ### > `CALRT_OBUF_STATUS_DEFAULT = 0` Nothing to do > `CALRT_OBUF_STATUS_PENDING = 1` in software start queue, not start yet. > `CALRT_OBUF_STATUS_RUNNING = 2` in calcore, active to obtain infered data. > `CALRT_OBUF_STATUS_DONE = 3` in software done queue, ready to read data back to host. [Back to Top](#table-of-enums) ---