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. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot