rtx-cfd legacy GPU: buffers re-borrowed after nested device calls; writing and delegating methods take &mut self
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
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 / 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 6s
Performance Benchmarks / Run Benchmarks (push) Failing after 6s
CI / Clippy Check (push) Failing after 6s
CI / Build (ubuntu-latest) (push) Failing after 7s
Documentation / Build API Documentation (push) Failing after 4s
Documentation / Build User Guide (push) Successful in 5s
CI / Build CPU-Only (Explicit) (push) Failing after 1m35s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
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 / 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 6s
Performance Benchmarks / Run Benchmarks (push) Failing after 6s
CI / Clippy Check (push) Failing after 6s
CI / Build (ubuntu-latest) (push) Failing after 7s
Documentation / Build API Documentation (push) Failing after 4s
Documentation / Build User Guide (push) Successful in 5s
CI / Build CPU-Only (Explicit) (push) Failing after 1m35s
This commit is contained in:
@@ -191,7 +191,7 @@ impl PisoGpuSolver {
|
||||
async fn gpu_momentum_prediction(&mut self, dt: f32) -> CfdResult<()> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
let config = self.cpu_solver.config();
|
||||
@@ -271,7 +271,7 @@ impl PisoGpuSolver {
|
||||
let (nx, ny) = {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
(buffers.nx, buffers.ny)
|
||||
};
|
||||
@@ -416,7 +416,7 @@ impl PisoGpuSolver {
|
||||
{
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
let u_correction = buffers.u_correction.clone();
|
||||
let v_correction = buffers.v_correction.clone();
|
||||
|
||||
@@ -183,7 +183,7 @@ impl SimpleGpuSolver {
|
||||
async fn gpu_momentum_prediction(&mut self, dt: f32) -> CfdResult<()> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
let config = self.cpu_solver.config();
|
||||
@@ -250,7 +250,7 @@ impl SimpleGpuSolver {
|
||||
async fn gpu_pressure_correction(&mut self) -> CfdResult<f32> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
let config = self.cpu_solver.config();
|
||||
@@ -297,10 +297,10 @@ impl SimpleGpuSolver {
|
||||
}
|
||||
|
||||
/// GPU-accelerated pressure update step
|
||||
async fn gpu_pressure_update(&self, pressure_relaxation: f32) -> CfdResult<()> {
|
||||
async fn gpu_pressure_update(&mut self, pressure_relaxation: f32) -> CfdResult<()> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
// p = p + α_p * p' (pressure update with relaxation)
|
||||
|
||||
@@ -256,11 +256,15 @@ impl D2Q9GpuSolver {
|
||||
fn gpu_collision_step(&mut self) -> CfdResult<()> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_mut()
|
||||
.as_ref()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
// First compute equilibrium distributions
|
||||
self.gpu_compute_equilibrium()?;
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
// Then perform collision: f = f + omega * (f_eq - f)
|
||||
let module = self
|
||||
@@ -476,7 +480,7 @@ impl D2Q9GpuSolver {
|
||||
}
|
||||
|
||||
/// Complete GPU LBM time step
|
||||
pub fn gpu_step(&self) -> CfdResult<()> {
|
||||
pub fn gpu_step(&mut self) -> CfdResult<()> {
|
||||
self.gpu_collision_step()?;
|
||||
self.gpu_streaming_step()?;
|
||||
self.gpu_apply_bounce_back_boundaries()?;
|
||||
@@ -575,7 +579,7 @@ impl D2Q9GpuSolver {
|
||||
}
|
||||
|
||||
/// Apply boundary conditions
|
||||
fn gpu_apply_boundaries(&self, _boundary_conditions: &BoundaryConditions) -> CfdResult<()> {
|
||||
fn gpu_apply_boundaries(&mut self, _boundary_conditions: &BoundaryConditions) -> CfdResult<()> {
|
||||
// For now, just apply bounce-back
|
||||
self.gpu_apply_bounce_back_boundaries()?;
|
||||
Ok(())
|
||||
|
||||
@@ -365,7 +365,7 @@ __global__ void d3q19_bounce_back_boundaries(
|
||||
pub fn gpu_collision_step(&mut self) -> CfdResult<()> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_mut()
|
||||
.as_ref()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
let omega = 1.0 / self.params.tau;
|
||||
@@ -375,6 +375,10 @@ __global__ void d3q19_bounce_back_boundaries(
|
||||
|
||||
// Step 2: Compute equilibrium distributions
|
||||
self.gpu_compute_equilibrium()?;
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
// Step 3: Perform BGK collision
|
||||
let module = self
|
||||
@@ -606,7 +610,7 @@ __global__ void d3q19_bounce_back_boundaries(
|
||||
}
|
||||
|
||||
/// Complete GPU LBM time step
|
||||
pub fn gpu_step(&self) -> CfdResult<()> {
|
||||
pub fn gpu_step(&mut self) -> CfdResult<()> {
|
||||
self.gpu_collision_step()?;
|
||||
self.gpu_streaming_step()?;
|
||||
self.gpu_apply_bounce_back_boundaries()?;
|
||||
@@ -667,8 +671,7 @@ __global__ void d3q19_bounce_back_boundaries(
|
||||
}
|
||||
|
||||
/// Get macroscopic variables at a specific point (copy from GPU)
|
||||
pub fn gpu_macroscopic_variables_at(
|
||||
&self,
|
||||
pub fn gpu_macroscopic_variables_at(&mut self,
|
||||
x: usize,
|
||||
y: usize,
|
||||
z: usize,
|
||||
@@ -680,6 +683,10 @@ __global__ void d3q19_bounce_back_boundaries(
|
||||
|
||||
// Extract macroscopic variables first
|
||||
self.gpu_extract_macroscopic_variables()?;
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
// Copy arrays from GPU
|
||||
let density_host = self.kernel_manager.copy_from_device(&buffers.density)?;
|
||||
@@ -723,7 +730,7 @@ __global__ void d3q19_bounce_back_boundaries(
|
||||
}
|
||||
|
||||
/// Calculate total mass on GPU
|
||||
pub fn gpu_total_mass(&self) -> CfdResult<f64> {
|
||||
pub fn gpu_total_mass(&mut self) -> CfdResult<f64> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
@@ -736,7 +743,7 @@ __global__ void d3q19_bounce_back_boundaries(
|
||||
}
|
||||
|
||||
/// Calculate kinetic energy on GPU
|
||||
pub fn gpu_kinetic_energy(&self) -> CfdResult<f64> {
|
||||
pub fn gpu_kinetic_energy(&mut self) -> CfdResult<f64> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
|
||||
@@ -131,7 +131,7 @@ impl KEpsilonGpuModel {
|
||||
pub fn set_initial_conditions(&mut self, k_init: f32, epsilon_init: f32) -> CfdResult<()> {
|
||||
let buffers = self
|
||||
.gpu_buffers
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok_or_else(|| CfdError::gpu_error("GPU buffers not initialized"))?;
|
||||
|
||||
// Initialize k and epsilon with uniform values
|
||||
|
||||
Reference in New Issue
Block a user