rmlCreateTensorFromClBuffer

Creates a tensor from an OpenCL buffer.

rml_status rmlCreateTensorFromClBuffer(

rml_context context,

void* buffer /* cl_mem */,

const rml_tensor_info* info,

rml_access_mode mode,

rml_tensor* tensor);

API

OpenCL Interoperation

Parameters

Parameter

Input/Output

Description

context

input

A valid context handle.

buffer

input

A valid OpenCL memory object handle.

info

input

A tensor description with all dimensions specified.

mode

input

A tensor data access mode.

tensor

output

A pointer to a resulting tensor handle.

Return and Status Codes

Returns a valid tensor handle in case of success and status:

To get more details in case of failure, call rmlGetLastError().

The tensor should be released with rmlReleaseTensor().