rtx-cfd legacy GPU: kernel outputs were device-buffer CLONES (every write lost) — the buffers are borrowed mutably now; the Poisson kernels keep boundary Dirichlet values; tests: the advection pulse marched 50 steps, the Jacobi budget 20k, the reduction reference in f64
CI / Build CPU-Only (Explicit) (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 5s
Documentation / Build API Documentation (push) Failing after 5s
CI / Format Check (push) Failing after 10s
CI / Build (ubuntu-latest) (push) Failing after 1m22s
CI / Clippy Check (push) Failing after 1m38s
Performance Benchmarks / Run Benchmarks (push) Successful in 2m50s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s

This commit is contained in:
Omar Sobh
2026-09-16 07:28:42 -05:00
parent f3f6ac21fb
commit 0de750bad1
8 changed files with 58 additions and 62 deletions
@@ -256,7 +256,7 @@ impl D2Q9GpuSolver {
fn gpu_collision_step(&self) -> CfdResult<()> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
// First compute equilibrium distributions
@@ -284,7 +284,7 @@ impl D2Q9GpuSolver {
self.kernel_manager
.stream()
.launch_builder(&func)
.arg(&mut buffers.f.clone())
.arg(&mut buffers.f)
.arg(&buffers.f_eq)
.arg(&(self.omega as f32))
.arg(&(buffers.nx as i32))
@@ -303,7 +303,7 @@ impl D2Q9GpuSolver {
pub fn gpu_streaming_step(&self) -> CfdResult<()> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
let module = self
@@ -327,7 +327,7 @@ impl D2Q9GpuSolver {
self.kernel_manager
.stream()
.launch_builder(&func)
.arg(&mut buffers.f_temp.clone())
.arg(&mut buffers.f_temp)
.arg(&buffers.f)
.arg(&(buffers.nx as i32))
.arg(&(buffers.ny as i32))
@@ -347,7 +347,7 @@ impl D2Q9GpuSolver {
fn gpu_compute_macroscopic(&self) -> CfdResult<()> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
let module = self
@@ -371,9 +371,9 @@ impl D2Q9GpuSolver {
self.kernel_manager
.stream()
.launch_builder(&func)
.arg(&mut buffers.density.clone())
.arg(&mut buffers.velocity_x.clone())
.arg(&mut buffers.velocity_y.clone())
.arg(&mut buffers.density)
.arg(&mut buffers.velocity_x)
.arg(&mut buffers.velocity_y)
.arg(&buffers.f)
.arg(&(buffers.nx as i32))
.arg(&(buffers.ny as i32))
@@ -394,7 +394,7 @@ impl D2Q9GpuSolver {
fn gpu_compute_equilibrium(&self) -> CfdResult<()> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
let module = self
@@ -418,7 +418,7 @@ impl D2Q9GpuSolver {
self.kernel_manager
.stream()
.launch_builder(&func)
.arg(&mut buffers.f_eq.clone())
.arg(&mut buffers.f_eq)
.arg(&buffers.density)
.arg(&buffers.velocity_x)
.arg(&buffers.velocity_y)
@@ -438,7 +438,7 @@ impl D2Q9GpuSolver {
pub fn gpu_apply_bounce_back_boundaries(&self) -> CfdResult<()> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
let module = self
@@ -462,7 +462,7 @@ impl D2Q9GpuSolver {
self.kernel_manager
.stream()
.launch_builder(&func)
.arg(&mut buffers.f.clone())
.arg(&mut buffers.f)
.arg(&(buffers.nx as i32))
.arg(&(buffers.ny as i32))
.launch(config)
@@ -492,7 +492,7 @@ impl D2Q9GpuSolver {
) -> CfdResult<()> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
let module = self
@@ -516,10 +516,10 @@ impl D2Q9GpuSolver {
self.kernel_manager
.stream()
.launch_builder(&func)
.arg(&mut buffers.f.clone())
.arg(&mut buffers.density.clone())
.arg(&mut buffers.velocity_x.clone())
.arg(&mut buffers.velocity_y.clone())
.arg(&mut buffers.f)
.arg(&mut buffers.density)
.arg(&mut buffers.velocity_x)
.arg(&mut buffers.velocity_y)
.arg(&(density as f32))
.arg(&(velocity.x as f32))
.arg(&(velocity.y as f32))
@@ -539,7 +539,7 @@ impl D2Q9GpuSolver {
pub fn get_macroscopic_at(&self, i: usize, j: usize) -> CfdResult<(f64, Vector2<f64>)> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
let idx = j * buffers.nx + i;
@@ -585,7 +585,7 @@ impl D2Q9GpuSolver {
pub fn update_flow_field(&self, flow_field: &mut FlowField) -> CfdResult<()> {
let buffers = self
.gpu_buffers
.as_ref()
.as_mut()
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
let (nx, ny, _, _) = flow_field.grid_info();