pub struct Linker { /* private fields */ }
Expand description
A linker used to link together PTX files into a single module.
Implementations
sourceimpl Linker
impl Linker
sourcepub fn new() -> CudaResult<Self>
pub fn new() -> CudaResult<Self>
Creates a new linker.
sourcepub fn add_ptx(&mut self, ptx: impl AsRef<str>) -> CudaResult<()>
pub fn add_ptx(&mut self, ptx: impl AsRef<str>) -> CudaResult<()>
Add some PTX assembly string to be linked in. The PTX code will be compiled into cubin by CUDA then linked in.
Returns
Returns an error if the PTX is invalid, cuda is out of memory, or the PTX is of an unsupported version.
sourcepub fn add_cubin(&mut self, cubin: impl AsRef<[u8]>) -> CudaResult<()>
pub fn add_cubin(&mut self, cubin: impl AsRef<[u8]>) -> CudaResult<()>
Add some cubin (CUDA binary) to be linked in.
Returns
Returns an error if the cubin is invalid or CUDA is out of memory.
sourcepub fn add_fatbin(&mut self, fatbin: impl AsRef<[u8]>) -> CudaResult<()>
pub fn add_fatbin(&mut self, fatbin: impl AsRef<[u8]>) -> CudaResult<()>
Add a fatbin (Fat Binary) to be linked in.
Returns
Returns an error if the fatbin is invalid or CUDA is out of memory.
sourcepub fn complete(self) -> CudaResult<Vec<u8>>
pub fn complete(self) -> CudaResult<Vec<u8>>
Runs the linker to generate the final cubin bytes. Also returns a duration for how long it took to run the linker.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more