aclSetTensorPlaceMent

Description

Sets the placement attribute of TensorDesc to identify the type of memory for storing tensor data. This API is synchronous.

This API differs from the aclSetTensorConst API in the following aspects:
  • In fuzzy compilation mode, if the constant input value of the operator changes, the operator must be recompiled. However, if this API is called to set the placement attribute of TensorDesc to the host memory, the operator may be generalized as a model that does not need to be recompiled.
  • In precise compilation mode, this API has the same effect as the aclSetTensorConst API.

For details about the concepts and settings of fuzzy compilation and non-fuzzy compilation, see aclopSetCompileFlag.

Prototype

aclError aclSetTensorPlaceMent(aclTensorDesc *desc, aclMemType memType)

Parameters

Parameter

Input/Output

Description

desc

Output

Pointer to data of the aclTensorDesc type.

Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance.

memType

Input

Value of the placement attribute.

Returns

0 on success; else, failure.