Skip to main content

create_program

Function create_program 

Source
pub fn create_program(
    src: &CStr,
    name: Option<&CStr>,
) -> Result<nvrtcProgram, NvrtcError>
Expand description

Creates a program from source code src. This should be source code from a .cu file.

See nvrtcCreateProgram() docs

Example:

let prog = create_program(c"extern \"C\" __global__ void kernel() { }", None).unwrap();

Note that the returned nvrtcProgram may contain references to src and name. The memory containing the compiled code and name must not be dropped until the nvrtcProgram is destroyed.