Function TVMFFIEnvSetDLPackManagedTensorAllocator

Function TVMFFIEnvSetDLPackManagedTensorAllocator#

Function Documentation#

int TVMFFIEnvSetDLPackManagedTensorAllocator(DLPackManagedTensorAllocator allocator, int write_to_global_context, DLPackManagedTensorAllocator *opt_out_original_allocator)#

Set the current DLPackManagedTensorAllocator in thread-local(TLS) context.

Parameters:
  • allocator – The allocator to set.

  • write_to_global_context – Whether to also set the allocator to the global context.

  • opt_out_original_allocator – Output original TLS allocator if the address is not nullptr.

Returns:

0 when success, nonzero when failure happens