Function TVMBackendAllocWorkspace

Function TVMBackendAllocWorkspace#

Function Documentation#

void *TVMBackendAllocWorkspace(int device_type, int device_id, uint64_t nbytes, int dtype_code_hint, int dtype_bits_hint)#

Backend function to allocate temporal workspace.

Note

The result allocated space is ensured to be aligned to kTempAllocaAlignment.

Parameters:
  • nbytes – The size of the space requested.

  • device_type – The device type which the space will be allocated.

  • device_id – The device id which the space will be allocated.

  • dtype_code_hint – The type code of the array elements. Only used in certain backends such as OpenGL.

  • dtype_bits_hint – The type bits of the array elements. Only used in certain backends such as OpenGL.

Returns:

A valid pointer on success, nullptr on failure. Failure records the raised TVM FFI error on the calling thread; no C++ exception crosses this C entry point.