Reserved APIs

The APIs described in this section are reserved and may be changed or deprecated in the future. They do not need your attention.

Table 1 API list

API

Description

InitTensor(const int64_t *viewDims, uint64_t viewDimsNum, aclDataType dataType, const int64_t *stride, int64_t offset, aclFormat format, const int64_t *storageDims, uint64_t storageDimsNum, void *tensorDataAddr)

Resets the attributes of an aclTensor.

ToString(op::DataType dataType)

Obtains the string corresponding to the data type.

TypeSize(DataType dataType)

Obtains the bit width of the data type.

ToContiguousStrides(const op::Shape &shape, op::Strides &strides)

Infers the strides of a contiguous tensor based on the shape.

aclStorage()

Indicates the constructor of aclStorage, which is used to describe an on-chip memory space.

aclStorage(void *addr)

aclStorage(bool fromWorkspace)

aclStorage(void *addr, bool fromWorkspace)

GetAddr()

Obtains the pointer to the on-chip memory address represented by the storage.

SetAddr(void *addr)

Sets the pointer to the on-chip memory address represented by the storage.

SetWorkspaceOffset(uint64_t offset)

Sets the offset of the valid data in the device memory when the storage represents a workspace.

GetWorkspaceOffset()

Obtains the offset of the valid data in the device memory when the storage represents a workspace.

SetFromWorkspace(bool fromWorkspace)

Sets whether the storage represents a workspace.

SetFromWorkspace(bool from_workspace)

Sets an aclTensor to represent a workspace.

IsFromWorkspace()

Checks whether the storage represents a workspace.

SetExtend(void *extend)

Sets the content of the extend member variable.

GetExtend()

Obtains the content of the extend member variable.

SetStorageOffset(int64_t offset)

Sets the offset of the valid storage data in the device memory.

GetStorageOffset()

Obtains the offset of the valid storage data in the device memory.

aclArray()

Indicates the constructor of aclArray, which is used to describe an array on the host.

Size()

Obtains the size of aclArray.

GetData()

Obtains the data area pointer of aclArray.

ToString()

Obtains the printed string of the aclArray content.

aclArray(const T *value, uint64_t size)

Indicates the constructor of aclArray, which is used to describe an array on the host.

aclTensor(aclTensor &&other)

Blocks the constructor of this class of aclTensor.

GetTensor()

Obtains the gert::Tensor stored in aclTensor.

GetStorageAddr()

Obtains the memory pointer to the aclStorage in aclTensor.

GetStorage()

Obtains the aclStorage in aclTensor.

GetViewOffset()

Obtains the ViewOffset of aclTensor.

SetStorageAddr(void *addr)

Sets the memory pointer to the aclStorage in aclTensor.

SetViewOffset(int64_t offset)

Sets the ViewOffset of aclTensor.

GetPlacement()

Obtains the type of aclTensor, either on the device or host.

aclTensor(const int64_t *viewDims, uint64_t viewDimsNum, aclDataType dataType, const int64_t *stride, int64_t offset, const aclFormat format, const int64_t *storageDims, uint64_t storageDimsNum, void *tensorDataAddr)

Indicates a tensor, either on the device or host. It describes the shape, dtype, and format of a tensor and records the data position.

aclTensor(op::DataType dataType, op::Format storageFormat, op::Format originFormat)

aclTensor(const op::Shape &shape, op::DataType dataType, op::Format format, void *tensorDataAddr)

aclTensor(const op::Shape &storageShape, const op::Shape &originShape, op::DataType dataType, op::Format storageFormat, op::Format originFormat, void *tensorDataAddr)

aclTensor(const op::Shape &shape, op::DataType dataType, op::Format format)

aclTensor(const op::Shape &storageShape, const op::Shape &originShape, op::DataType dataType, op::Format storageFormat, op::Format originFormat)

aclTensor(const aclTensor &other, const op::Shape &shape, int64_t offset)

aclTensor(const aclIntArray *value, op::DataType dataType)

aclTensor(const aclBoolArray *value, op::DataType dataType)

aclTensor(const aclFloatArray *value, op::DataType dataType)

aclTensor(const aclFp16Array *value, op::DataType dataType)

aclTensor(const aclBf16Array *value, op::DataType dataType)

aclTensor()

aclTensor(const T *value, uint64_t size, op::DataType dataType)

aclTensor(const aclScalar *value, op::DataType dataType)

IsView()

Checks whether aclTensor is a view tensor.

SetView(bool is_view)

Sets whether aclTensor is a view tensor.

aclTensorList(const aclTensor *const *tensors, uint64_t size)

Indicates an aclTensor array. This function is the constructor of aclTensorList.

aclTensorList()

aclScalar(const void *data, op::DataType dataType)

Indicates a scalar number. This function is the constructor of aclScalar.

aclScalar()

ToFloat()

Converts the scalar stored in aclScalar to a specified type.

ToDouble()

ToBool()

ToInt8()

ToInt16()

ToInt32()

ToInt64()

ToUint8()

ToUint16()

ToUint32()

ToUint64()

ToFp16()

ToBf16()

ToComplex64()

ToComplex128()

aclScalar(int32_t value)

Initializes the aclScalar object based on the scalar of a specified type.

aclScalar(int64_t value)

aclScalar(int16_t value)

aclScalar(int8_t value)

aclScalar(uint32_t value)

aclScalar(uint64_t value)

aclScalar(uint16_t value)

aclScalar(uint8_t value)

aclScalar(float value)

aclScalar(double value)

aclScalar(op::fp16_t value)

aclScalar(op::bfloat16 value)

aclScalar(bool value)

To()

Converts the scalar stored in aclScalar to the T type.

ToStr()

Generates a string describing aclScalar.

BFloat16()

Converts the scalar stored in aclScalar to bfloat16.

aclScalarList(const aclScalar *const *scalars, uint64_t size)

Indicates an aclScalar array. This function is the constructor of aclScalarList.

aclScalarList()

ToString(const aclTensor* t)

Indicates the print functions, which are used to generate strings that describe the content of different data types.

ToString(const aclTensorList* t)

ToString(const aclIntArray* t)

ToString(const aclBoolArray* t)

ToString(const aclFloatArray* t)

ToString(const aclFp16Array* t)

ToString(const aclBf16Array* t)

ToString(const aclScalar* t)

ToString(const aclScalarList* t)

ToString(const aclTensor& t)

ToString(const aclTensorList& t)

ToString(const aclIntArray& t)

ToString(const aclBoolArray& t)

ToString(const aclFloatArray& t)

ToString(const aclFp16Array& t)

ToString(const aclBf16Array& t)

ToString(const aclScalar& t)

ToString(const aclScalarList& t)

ToString(aclDataType dataType)