Define TVM_FFI_EMBED_CUBIN_FROM_BYTES

Define TVM_FFI_EMBED_CUBIN_FROM_BYTES#

Define Documentation#

TVM_FFI_EMBED_CUBIN_FROM_BYTES(name, imageBytes)#

Macro to load a CUBIN module from a byte array.

This macro creates a singleton struct to manage the CubinModule instance initialized from a byte array (e.g. from #embed <file> or bin2c output).

Usage Example
constexpr unsigned char image[] = { ... };
TVM_FFI_EMBED_CUBIN_FROM_BYTES(my_kernels, image);

void MyFunc() {
  static auto kernel = TVM_FFI_EMBED_CUBIN_GET_KERNEL(my_kernels, "kernel_name");
}

Parameters:
  • name – The identifier for this embedded CUBIN module.

  • imageBytes – The byte array containing the CUBIN/FATBIN data.