RingKernelConfig

Struct RingKernelConfig 

Source
pub struct RingKernelConfig {
    pub id: String,
    pub block_size: u32,
    pub queue_capacity: u32,
    pub enable_k2k: bool,
    pub enable_hlc: bool,
    pub message_size: usize,
    pub response_size: usize,
    pub cooperative_groups: bool,
    pub idle_sleep_ns: u32,
    pub use_envelope_format: bool,
    pub kernel_id_num: u64,
    pub hlc_node_id: u64,
}
Expand description

Configuration for a ring kernel.

Fields§

§id: String

Kernel identifier (used in function name).

§block_size: u32

Block size (threads per block).

§queue_capacity: u32

Input queue capacity (must be power of 2).

§enable_k2k: bool

Enable kernel-to-kernel messaging.

§enable_hlc: bool

Enable HLC clock operations.

§message_size: usize

Message size in bytes (for buffer offset calculations).

§response_size: usize

Response size in bytes.

§cooperative_groups: bool

Use cooperative thread groups.

§idle_sleep_ns: u32

Nanosleep duration when idle (0 to spin).

§use_envelope_format: bool

Use MessageEnvelope format (256-byte header + payload). When enabled, messages in queues are full envelopes with headers.

§kernel_id_num: u64

Kernel numeric ID (for response routing).

§hlc_node_id: u64

HLC node ID for this kernel.

Implementations§

Source§

impl RingKernelConfig

Source

pub fn new(id: impl Into<String>) -> Self

Create a new ring kernel configuration with the given ID.

Source

pub fn with_block_size(self, size: u32) -> Self

Set the block size.

Source

pub fn with_queue_capacity(self, capacity: u32) -> Self

Set the queue capacity (must be power of 2).

Source

pub fn with_k2k(self, enabled: bool) -> Self

Enable kernel-to-kernel messaging.

Source

pub fn with_hlc(self, enabled: bool) -> Self

Enable HLC clock operations.

Source

pub fn with_message_sizes(self, message: usize, response: usize) -> Self

Set message and response sizes.

Source

pub fn with_idle_sleep(self, ns: u32) -> Self

Set idle sleep duration in nanoseconds.

Source

pub fn with_envelope_format(self, enabled: bool) -> Self

Enable or disable MessageEnvelope format. When enabled, messages use the 256-byte header + payload format.

Source

pub fn with_kernel_id(self, id: u64) -> Self

Set the kernel numeric ID (for K2K routing and response headers).

Source

pub fn with_hlc_node_id(self, node_id: u64) -> Self

Set the HLC node ID for this kernel.

Source

pub fn kernel_name(&self) -> String

Generate the kernel function name.

Source

pub fn generate_signature(&self) -> String

Generate CUDA kernel signature.

Source

pub fn generate_preamble(&self, indent: &str) -> String

Generate the kernel preamble (thread setup, variable declarations).

Source

pub fn generate_loop_header(&self, indent: &str) -> String

Generate the persistent message loop header.

Source

pub fn generate_message_complete(&self, indent: &str) -> String

Generate message processing completion code.

Generate the loop footer (end of while loop).

Source

pub fn generate_epilogue(&self, indent: &str) -> String

Generate kernel epilogue (termination marking).

Source

pub fn generate_kernel_wrapper(&self, handler_placeholder: &str) -> String

Generate complete kernel wrapper (without handler body).

Trait Implementations§

Source§

impl Clone for RingKernelConfig

Source§

fn clone(&self) -> RingKernelConfig

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RingKernelConfig

Source§

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

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

impl Default for RingKernelConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.