rtx-cfd legacy GPU modules: the launches that already sat in unsafe blocks are not wrapped twice
CI / Build (macos-latest) (push) Waiting to run
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (macos-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
CI / WASM Build + Size Check (push) Blocked by required conditions
CI / Distributed Training Tests (push) Blocked by required conditions
CI / CI Success (push) Blocked by required conditions
CI / Format Check (push) Failing after 4s
Performance Benchmarks / Run Benchmarks (push) Failing after 6s
CI / Build (ubuntu-latest) (push) Failing after 6s
CI / Build CPU-Only (Explicit) (push) Failing after 4s
CI / Clippy Check (push) Failing after 10s
Documentation / Build API Documentation (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 5s

This commit is contained in:
Omar Sobh
2026-09-16 07:20:51 -05:00
parent 7f4d437199
commit f429bdd415
4 changed files with 290 additions and 337 deletions
@@ -376,7 +376,6 @@ impl PisoGpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -394,7 +393,6 @@ impl PisoGpuSolver {
CfdError::gpu_error(&format!("Divergence kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -461,7 +459,6 @@ impl PisoGpuSolver {
let correction_factor = -dt / density;
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -479,7 +476,6 @@ impl PisoGpuSolver {
CfdError::gpu_error(&format!("Gradient kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -214,7 +214,6 @@ impl D2Q9GpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -228,13 +227,9 @@ impl D2Q9GpuSolver {
.arg(&(ny as i32))
.launch(config)
.map_err(|e| {
CfdError::gpu_error(&format!(
"Equilibrium init kernel launch failed: {}",
e
))
CfdError::gpu_error(&format!("Equilibrium init kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -285,7 +280,6 @@ impl D2Q9GpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -300,7 +294,6 @@ impl D2Q9GpuSolver {
CfdError::gpu_error(&format!("Collision kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -330,7 +323,6 @@ impl D2Q9GpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -344,7 +336,6 @@ impl D2Q9GpuSolver {
CfdError::gpu_error(&format!("Streaming kernel launch failed: {}", e))
})?;
}
}
// Swap buffers: f = f_temp
// In real implementation, would swap buffer pointers
@@ -376,7 +367,6 @@ impl D2Q9GpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -395,7 +385,6 @@ impl D2Q9GpuSolver {
))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -425,7 +414,6 @@ impl D2Q9GpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -441,7 +429,6 @@ impl D2Q9GpuSolver {
CfdError::gpu_error(&format!("Equilibrium kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -471,7 +458,6 @@ impl D2Q9GpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -484,7 +470,6 @@ impl D2Q9GpuSolver {
CfdError::gpu_error(&format!("Boundary kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -527,7 +512,6 @@ impl D2Q9GpuSolver {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -546,7 +530,6 @@ impl D2Q9GpuSolver {
CfdError::gpu_error(&format!("Initialization kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -187,7 +187,6 @@ impl KEpsilonGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -212,13 +211,9 @@ impl KEpsilonGpuModel {
.arg(&(buffers.nz as i32))
.launch(config)
.map_err(|e| {
CfdError::gpu_error(&format!(
"Velocity gradients kernel launch failed: {}",
e
))
CfdError::gpu_error(&format!("Velocity gradients kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -251,7 +246,6 @@ impl KEpsilonGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -268,7 +262,6 @@ impl KEpsilonGpuModel {
CfdError::gpu_error(&format!("Eddy viscosity kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -299,7 +292,6 @@ impl KEpsilonGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -323,7 +315,6 @@ impl KEpsilonGpuModel {
CfdError::gpu_error(&format!("Production kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -356,7 +347,6 @@ impl KEpsilonGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -375,7 +365,6 @@ impl KEpsilonGpuModel {
CfdError::gpu_error(&format!("Epsilon source kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -410,7 +399,6 @@ impl KEpsilonGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -430,10 +418,7 @@ impl KEpsilonGpuModel {
.arg(&(buffers.ny as i32))
.arg(&(buffers.nz as i32))
.launch(config)
.map_err(|e| {
CfdError::gpu_error(&format!("Update kernel launch failed: {}", e))
})?;
}
.map_err(|e| CfdError::gpu_error(&format!("Update kernel launch failed: {}", e)))?;
}
self.kernel_manager.synchronize()?;
@@ -141,7 +141,6 @@ impl SmagorinskyGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -158,7 +157,6 @@ impl SmagorinskyGpuModel {
CfdError::gpu_error(&format!("Filter width kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())
@@ -221,7 +219,6 @@ impl SmagorinskyGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -246,13 +243,9 @@ impl SmagorinskyGpuModel {
.arg(&(buffers.nz as i32))
.launch(config)
.map_err(|e| {
CfdError::gpu_error(&format!(
"Velocity gradients kernel launch failed: {}",
e
))
CfdError::gpu_error(&format!("Velocity gradients kernel launch failed: {}", e))
})?;
}
}
Ok(())
}
@@ -284,7 +277,6 @@ impl SmagorinskyGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -307,7 +299,6 @@ impl SmagorinskyGpuModel {
CfdError::gpu_error(&format!("Strain rate kernel launch failed: {}", e))
})?;
}
}
Ok(())
}
@@ -337,7 +328,6 @@ impl SmagorinskyGpuModel {
shared_mem_bytes: 0,
};
unsafe {
unsafe {
self.kernel_manager
.stream()
@@ -354,7 +344,6 @@ impl SmagorinskyGpuModel {
CfdError::gpu_error(&format!("SGS viscosity kernel launch failed: {}", e))
})?;
}
}
self.kernel_manager.synchronize()?;
Ok(())