aclrtKernelArgsInitByUserMem

Applicability

Product

Supported

Atlas 350 Accelerator Card

√

Atlas A3 training product/Atlas A3 inference product

√

Atlas A2 training product/Atlas A2 inference product

√

Atlas 200I/500 A2 inference product

√

Atlas inference product

√

Atlas training product

√

Description

Initializes the parameter list based on the kernel function handle and obtains the handle that identifies the parameter list.

The difference between this API and aclrtKernelArgsInit is that you manage the memory when this API is called.

Prototype

1
aclError aclrtKernelArgsInitByUserMem(aclrtFuncHandle funcHandle, aclrtArgsHandle argsHandle, void *userHostMem, size_t actualArgsSize)

Parameters

Parameter

Input/Output

Description

funcHandle

Input

Kernel function handle. For details about the type definition, see aclrtFuncHandle.

Call aclrtBinaryGetFunctionByEntry or aclrtBinaryGetFunction to obtain the kernel function handle and pass it to this API as an input parameter.

argsHandle

Output

Handle of the parameter list. For details about the type definition, see aclrtArgsHandle.

Call aclrtKernelArgsGetHandleMemSize in advance to obtain the memory size, allocate the host memory, and pass the host memory address to this API as an input parameter.

userHostMem

Input

Host memory address.

Call aclrtKernelArgsGetMemSize in advance to obtain the memory size, allocate the host memory, and pass the host memory address to this API as an input parameter.

actualArgsSize

Input

Memory size.

Call aclrtKernelArgsGetMemSize to obtain the memory size and pass the memory size to this API as an input parameter.

Returns

0 on success; otherwise, failure. For details, see aclError.