pub struct PtxCompiler { /* private fields */ }Expand description
Wraps nvptxcompiler (NVIDIA’s standalone PTX-to-cubin compiler).
Implementations§
Source§impl PtxCompiler
impl PtxCompiler
Sourcepub fn try_new(ptx: &[u8]) -> Result<Self>
pub fn try_new(ptx: &[u8]) -> Result<Self>
Creates a compiler for the given PTX source.
ptx is the raw PTX source bytes (ASCII; the C API takes a byte pointer
and length, so no UTF-8 validation or null-termination is required).
Sourcepub fn compile(&mut self, options: &Options) -> Result<Vec<u8>>
pub fn compile(&mut self, options: &Options) -> Result<Vec<u8>>
Compiles the PTX to a cubin binary using options.
Sourcepub fn compile_program<K: Kernel>(
&mut self,
options: &Options,
) -> Result<CudaProgram<'static, K>>
pub fn compile_program<K: Kernel>( &mut self, options: &Options, ) -> Result<CudaProgram<'static, K>>
Compile the PTX to a cubin and load it into the current CUDA context,
returning a ready-to-launch CudaProgram. The entry-point symbol is
always "entry_point" (the name emitted by the #[kernel] proc macro).
Trait Implementations§
Source§impl Drop for PtxCompiler
impl Drop for PtxCompiler
Auto Trait Implementations§
impl Freeze for PtxCompiler
impl RefUnwindSafe for PtxCompiler
impl !Send for PtxCompiler
impl !Sync for PtxCompiler
impl Unpin for PtxCompiler
impl UnsafeUnpin for PtxCompiler
impl UnwindSafe for PtxCompiler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more