pub struct MetalKernelGenerator { /* private fields */ }Expand description
Metal kernel generator
Generates Metal Shading Language (MSL) code for Apple GPUs. Supports macOS 10.15+, iOS 13+, and Apple Silicon.
Implementations§
Source§impl MetalKernelGenerator
impl MetalKernelGenerator
Sourcepub fn new(device_family: String) -> Self
pub fn new(device_family: String) -> Self
Create a new Metal kernel generator
§Arguments
device_family- Metal GPU family (e.g., “apple7” for M1)
Sourcepub fn set_mps(&mut self, enable: bool)
pub fn set_mps(&mut self, enable: bool)
Enable or disable Metal Performance Shaders integration
Sourcepub fn generate_metal(&self, graph: &ComputationGraph) -> JitResult<String>
pub fn generate_metal(&self, graph: &ComputationGraph) -> JitResult<String>
Generate Metal Shading Language code for the computation graph
Future implementation will:
- Generate optimized MSL kernels for each operation
- Integrate with Metal Performance Shaders for standard ops
- Utilize tile memory for data reuse
- Emit SIMD-group operations for reduction
- Generate ANE-compatible operations when possible
Sourcepub fn estimate_threadgroup_size(
&self,
graph: &ComputationGraph,
) -> ThreadgroupSize
pub fn estimate_threadgroup_size( &self, graph: &ComputationGraph, ) -> ThreadgroupSize
Estimate threadgroup size for a graph
Auto Trait Implementations§
impl Freeze for MetalKernelGenerator
impl RefUnwindSafe for MetalKernelGenerator
impl Send for MetalKernelGenerator
impl Sync for MetalKernelGenerator
impl Unpin for MetalKernelGenerator
impl UnsafeUnpin for MetalKernelGenerator
impl UnwindSafe for MetalKernelGenerator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more