pub struct CudaProgram<'a, K: Kernel> { /* private fields */ }Expand description
A loaded CUDA program: the cubin is loaded into a CUmodule and the
entry-point function is resolved to a CUfunction ready to launch.
Implementations§
Source§impl<'a, K: Kernel> CudaProgram<'a, K>
impl<'a, K: Kernel> CudaProgram<'a, K>
Sourcepub fn module_ptr(&self) -> usize
pub fn module_ptr(&self) -> usize
The loaded module’s raw CUmodule handle, as a usize.
Sourcepub fn function_ptr(&self) -> usize
pub fn function_ptr(&self) -> usize
The resolved kernel entry point’s raw CUfunction handle, as a usize.
Sourcepub fn threads_per_block(&self) -> u32
pub fn threads_per_block(&self) -> u32
Threads per block, from the kernel’s parsed metadata.
Sourcepub fn num_ctas(&self) -> u32
pub fn num_ctas(&self) -> u32
Number of CTAs (thread blocks), from the kernel’s parsed metadata.
Sourcepub fn try_new(cubin: &[u8], entry_point: &str) -> Result<Self>
pub fn try_new(cubin: &[u8], entry_point: &str) -> Result<Self>
Load a cubin image into the current CUDA context and resolve entry_point.
Metadata is not available from a cubin; default values are used.
Sourcepub fn try_from_ptx(ptx: &[u8]) -> Result<Self>
pub fn try_from_ptx(ptx: &[u8]) -> Result<Self>
JIT-compile PTX source via the CUDA driver.
The entry-point function name and all resource metadata are read from
the // meta:key=value block that the Triton CUDA backend appends to
every PTX output. ptx must be ASCII PTX text; a null terminator is
appended automatically.