Updated on 2022-03-13 GMT+08:00

Macro: HIAI_REGISTER_DATA_TYPE

Provides automatic serialization and deserialization mechanisms for various user-defined data types. This macro is defined in data_type_reg.h.

  • This API must be registered on both the host side and the device side.
  • Due to the restrictions of Cereal, do not use the long double type in the struct body. To ensure running across platforms (for example, from Windows to Linux), the portable type is recommended for the struct members, for example, int32_t, in the struct body.
  • Due to the restrictions of Cereal, the struct body needs to use the shared pointer.

Syntax

HIAI_REGISTER_DATA_TYPE(name, type)

Parameter Description

Parameter

Description

Value Range

name

Name of the user-defined data type. (The name must be unique for each data type.)

-

type

User-defined data type

-

Return Value

For details about the returned error codes, see "Error Codes."

Error Codes

No.

Error Code

Description

1

HIAI_OK

The running is OK.

2

HIAI_ENGINE_FUNCTOR_NULL

The HiAI Engine function is null.

3

HIAI_ENGINE_FUNCTOR_EXIST

The HiAI Engine function exists.