Skip to main content

MlxCudaKernelConfig

Struct MlxCudaKernelConfig 

Source
pub struct MlxCudaKernelConfig(/* private fields */);
Expand description

Owned MLX-C CUDA kernel configuration handle.

Implementations§

Source§

impl MlxCudaKernelConfig

Source

pub fn new() -> Result<Self, MlxCError>

Creates an empty CUDA kernel configuration.

Source

pub fn add_output( &mut self, shape: &[i32], dtype: MlxDtype, ) -> Result<(), MlxCError>

Adds one typed output with a static shape.

Source

pub fn set_grid(&mut self, grid: [i32; 3]) -> Result<(), MlxCError>

Sets the launch grid dimensions.

Source

pub fn set_thread_group( &mut self, thread_group: [i32; 3], ) -> Result<(), MlxCError>

Sets the thread-group dimensions.

Source

pub fn set_init_value(&mut self, initial_value: f32) -> Result<(), MlxCError>

Sets the scalar initialization value for output buffers.

Source

pub fn set_verbose(&mut self, verbose: bool) -> Result<(), MlxCError>

Toggles MLX’s verbose logging for this kernel launch.

Source

pub fn add_dtype_template_argument( &mut self, name: &str, dtype: MlxDtype, ) -> Result<(), MlxCError>

Adds a dtype template argument.

Source

pub fn add_int_template_argument( &mut self, name: &str, argument: i32, ) -> Result<(), MlxCError>

Adds an integer template argument.

Source

pub fn add_bool_template_argument( &mut self, name: &str, argument: bool, ) -> Result<(), MlxCError>

Adds a boolean template argument.

Trait Implementations§

Source§

impl Debug for MlxCudaKernelConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for MlxCudaKernelConfig

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

Auto Trait Implementations§

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.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.