Expand description
GPU Mock Testing Utilities
This module provides utilities for mocking GPU behavior in CPU tests. It simulates GPU intrinsics, thread organization, and memory patterns.
§Example
use ringkernel_cpu::mock::{MockGpu, MockThread, MockKernelConfig};
// Configure a mock kernel launch
let config = MockKernelConfig::new()
.with_grid_size(4, 4, 1)
.with_block_size(32, 8, 1);
// Create mock GPU context
let gpu = MockGpu::new(config);
// Execute kernel with mock threads
gpu.dispatch(|thread| {
let gid = thread.global_id();
// Kernel code here
});Structs§
- Mock
Atomics - Mock atomic operations.
- MockGpu
- Mock GPU for testing kernel execution.
- Mock
Kernel Config - Configuration for mock kernel execution.
- Mock
Shared Memory - Mock shared memory for a block.
- Mock
Thread - Mock thread context providing GPU intrinsics.
- Mock
Warp - Mock warp operations for testing warp-level primitives.