cuda.core.experimental.ObjectCode¶
- class cuda.core.experimental.ObjectCode¶
Represent a compiled program to be loaded onto the device.
This object provides a unified interface for different types of compiled programs that will be loaded onto the device.
Note
This class has no default constructor. If you already have a cubin that you would like to load, use the
from_cubin()
alternative constructor. For all other possible code types (ex: “ptx”), onlyProgram
accepts them and returns anObjectCode
instance with itscompile()
method.Note
Usage under CUDA 11.x will only load to the current device context.
Methods
- __init__()¶
- static from_cubin(module: bytes | str, *, symbol_mapping: dict | None = None) ObjectCode ¶
Create an
ObjectCode
instance from an existing cubin.- Parameters:
module (Union[bytes, str]) – Either a bytes object containing the in-memory cubin to load, or a file path string pointing to the on-disk cubin to load.
symbol_mapping (Optional[dict]) – A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings).