Function: kernel_args_init_by_user_mem

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

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

Different from the acl.rt.kernel_args_init API, this API indicates that the memory is managed by the user.

Prototype

  • C Prototype
    1
    aclError aclrtKernelArgsInitByUserMem(aclrtFuncHandle funcHandle, aclrtArgsHandle argsHandle, void *userHostMem, size_t actualArgsSize)
    
  • Python Function
    1
    ret = acl.rt.kernel_args_init_by_user_mem(func_handle, args_handle, user_host_mem, actual_args_size)
    

Parameter Description

Parameter

Description

func_handle

Int, kernel function handle.

Call acl.rt.binary_get_function to obtain the kernel function handle, and pass it as an input parameter.

args_handle

Int, handle of the parameter list.

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

user_host_mem

Int, host memory address.

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

actual_args_size

Int, memory size.

Call acl.rt.kernel_args_get_mem_size to obtain the memory size and pass the memory size to this API as an input parameter.

Return Value Description

Return Value

Description

ret

Int, 0 on success; else, failure.