rmlCreateTensorFromMTLBuffer
Creates a tensor from an existing Metal buffer.
rml_status rmlSetMIOpenAutoTuningOn(  | 
rml_context context,  | 
void* buffer,  | 
|
const rml_tensor_info* info,  | 
|
rml_access_mode mode,  | 
|
rml_tensor* tensor);  | 
API
Metal Interoperation
Parameters
Parameter  | 
Input/Output  | 
Description  | 
|---|---|---|
context  | 
input  | 
A valid context handle.  | 
buffer  | 
input  | 
An MTLBuffer instance (id<MTLBuffer>).  | 
info  | 
input  | 
A tensor description with all dimensions specified.  | 
mode  | 
input  | 
A tensor 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:
RML_OKif the operation is successfulRML_ERROR_BAD_PARAMETERif the context is invalid, the buffer isNULL, the info isNULLor invalid, the mode is invalid or the tensor isNULLRML_ERROR_INTERNALin case of an internal error
To get more details in case of failure, call rmlGetLastError().
The tensor should be released with rmlReleaseTensor().