pub struct MlxCudaKernel(/* private fields */);Expand description
Owned MLX-C CUDA kernel handle.
Implementations§
Source§impl MlxCudaKernel
impl MlxCudaKernel
Sourcepub fn new(
kernel_name: &str,
input_names: &[&str],
output_names: &[&str],
kernel_header: &str,
kernel_source: &str,
ensure_row_contiguous: bool,
shared_memory_bytes: i32,
) -> Result<Self, MlxCError>
pub fn new( kernel_name: &str, input_names: &[&str], output_names: &[&str], kernel_header: &str, kernel_source: &str, ensure_row_contiguous: bool, shared_memory_bytes: i32, ) -> Result<Self, MlxCError>
Compiles a CUDA kernel from source with named inputs and outputs.
§Errors
Returns the captured MLX-C description when compilation fails.
Sourcepub fn apply(
&self,
context: &MlxBindingsContext,
inputs: &MlxArrayVector,
config: &MlxCudaKernelConfig,
) -> Result<MlxArrayVector, MlxCError>
pub fn apply( &self, context: &MlxBindingsContext, inputs: &MlxArrayVector, config: &MlxCudaKernelConfig, ) -> Result<MlxArrayVector, MlxCError>
Applies the kernel to the inputs on the given stream.
§Errors
Returns the captured MLX-C description when the launch fails.
Trait Implementations§
Source§impl Debug for MlxCudaKernel
impl Debug for MlxCudaKernel
Source§impl Drop for MlxCudaKernel
impl Drop for MlxCudaKernel
Auto Trait Implementations§
impl !Send for MlxCudaKernel
impl !Sync for MlxCudaKernel
impl Freeze for MlxCudaKernel
impl RefUnwindSafe for MlxCudaKernel
impl Unpin for MlxCudaKernel
impl UnsafeUnpin for MlxCudaKernel
impl UnwindSafe for MlxCudaKernel
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