Sets a constant input for an operator and specifies the input memory. This API is synchronous.
aclError aclSetTensorConst(aclTensorDesc *desc, void *dataBuffer, size_t length)
Parameter |
Input/Output |
Description |
|---|---|---|
desc |
Output |
Pointer to data of the aclTensorDesc type. Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance. |
dataBuffer |
Input |
Pointer to the buffer address of the input tensor data. Determine the memory allocation method based on the app run mode. If the app runs on the host, allocate host memory. If the app runs on the device, allocate device memory. For details about the memory allocation API, see Memory Management. |
length |
Input |
Memory size in bytes. |
0 on success; else, failure.