Skip to main content

CudaProgram

Struct CudaProgram 

Source
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>

Source

pub fn module_ptr(&self) -> usize

The loaded module’s raw CUmodule handle, as a usize.

Source

pub fn function_ptr(&self) -> usize

The resolved kernel entry point’s raw CUfunction handle, as a usize.

Source

pub fn threads_per_block(&self) -> u32

Threads per block, from the kernel’s parsed metadata.

Source

pub fn num_ctas(&self) -> u32

Number of CTAs (thread blocks), from the kernel’s parsed metadata.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a, K: Kernel> Drop for CudaProgram<'a, K>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a, K: Kernel> Program<'a, K> for CudaProgram<'a, K>

Auto Trait Implementations§

§

impl<'a, K> Freeze for CudaProgram<'a, K>

§

impl<'a, K> RefUnwindSafe for CudaProgram<'a, K>
where K: RefUnwindSafe,

§

impl<'a, K> !Send for CudaProgram<'a, K>

§

impl<'a, K> !Sync for CudaProgram<'a, K>

§

impl<'a, K> Unpin for CudaProgram<'a, K>
where K: Unpin,

§

impl<'a, K> UnsafeUnpin for CudaProgram<'a, K>

§

impl<'a, K> UnwindSafe for CudaProgram<'a, K>
where K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more