pub enum StencilIntrinsic {
Index,
North,
South,
East,
West,
At,
Up,
Down,
}Expand description
Stencil-specific intrinsics for neighbor access.
These are special intrinsics that the transpiler handles differently based on stencil configuration.
Variants§
Index
Get current cell index: pos.idx()
North
Access north neighbor: pos.north(buf)
South
Access south neighbor: pos.south(buf)
East
Access east neighbor: pos.east(buf)
West
Access west neighbor: pos.west(buf)
At
Access neighbor at offset: pos.at(buf, dx, dy)
Up
3D: Access neighbor above: pos.up(buf)
Down
3D: Access neighbor below: pos.down(buf)
Implementations§
Source§impl StencilIntrinsic
impl StencilIntrinsic
Sourcepub fn from_method_name(name: &str) -> Option<Self>
pub fn from_method_name(name: &str) -> Option<Self>
Parse a method name to stencil intrinsic.
Source§impl StencilIntrinsic
impl StencilIntrinsic
Sourcepub fn get_offset_2d(&self) -> Option<(i32, i32)>
pub fn get_offset_2d(&self) -> Option<(i32, i32)>
Get the index offset for 2D stencil (relative to buffer_width).
Returns (row_offset, col_offset) where final offset is:
row_offset * buffer_width + col_offset
Sourcepub fn get_offset_3d(&self) -> Option<(i32, i32, i32)>
pub fn get_offset_3d(&self) -> Option<(i32, i32, i32)>
Get the index offset for 3D stencil.
Returns (z_offset, row_offset, col_offset) where final offset is:
z_offset * buffer_slice + row_offset * buffer_width + col_offset
Sourcepub fn is_3d_only(&self) -> bool
pub fn is_3d_only(&self) -> bool
Check if this is a 3D-only intrinsic.
Sourcepub fn to_cuda_index_2d(
&self,
buffer_name: &str,
buffer_width: &str,
idx_var: &str,
) -> String
pub fn to_cuda_index_2d( &self, buffer_name: &str, buffer_width: &str, idx_var: &str, ) -> String
Generate CUDA index expression for 2D stencil.
§Arguments
buffer_name- Name of the buffer variablebuffer_width- Width expression (e.g., “18” for tile_size + 2*halo)idx_var- Name of the current index variable
Sourcepub fn to_cuda_index_3d(
&self,
buffer_name: &str,
buffer_width: &str,
buffer_slice: &str,
idx_var: &str,
) -> String
pub fn to_cuda_index_3d( &self, buffer_name: &str, buffer_width: &str, buffer_slice: &str, idx_var: &str, ) -> String
Generate CUDA index expression for 3D stencil.
§Arguments
buffer_name- Name of the buffer variablebuffer_width- Width expressionbuffer_slice- Slice size expression (width * height)idx_var- Name of the current index variable
Trait Implementations§
Source§impl Clone for StencilIntrinsic
impl Clone for StencilIntrinsic
Source§fn clone(&self) -> StencilIntrinsic
fn clone(&self) -> StencilIntrinsic
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StencilIntrinsic
impl Debug for StencilIntrinsic
Source§impl PartialEq for StencilIntrinsic
impl PartialEq for StencilIntrinsic
impl StructuralPartialEq for StencilIntrinsic
Auto Trait Implementations§
impl Freeze for StencilIntrinsic
impl RefUnwindSafe for StencilIntrinsic
impl Send for StencilIntrinsic
impl Sync for StencilIntrinsic
impl Unpin for StencilIntrinsic
impl UnwindSafe for StencilIntrinsic
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)