Skip to main content

Module module

Module module 

Source
Expand description

PTX module loading and kernel function management.

Modules are created from PTX source code and contain one or more kernel functions that can be launched on the GPU.

§Example

let ptx = r#"
.version 7.0
.target sm_70
.address_size 64
.visible .entry my_kernel() { ret; }
"#;

let module = Module::from_ptx(ptx)?;
let func = module.get_function("my_kernel")?;

// Or with JIT options and compilation logs:
let opts = JitOptions { optimization_level: 4, ..Default::default() };
let (module2, log) = Module::from_ptx_with_options(ptx, &opts)?;
if !log.info.is_empty() {
    println!("JIT info: {}", log.info);
}

Structs§

Function
A kernel function handle within a loaded module.
JitDiagnostic
A single structured diagnostic emitted by the JIT compiler.
JitLog
Log output from JIT compilation.
JitOptions
Options for JIT compilation of PTX to GPU binary.
Module
A loaded CUDA module containing one or more kernel functions.

Enums§

JitSeverity
Severity of a JIT compiler diagnostic message.