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
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:
@@ -377,23 +377,21 @@ impl PisoGpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.mass_source)
|
||||
.arg(u)
|
||||
.arg(v)
|
||||
.arg(&(density / dt))
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Divergence kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.mass_source)
|
||||
.arg(u)
|
||||
.arg(v)
|
||||
.arg(&(density / dt))
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Divergence kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -462,23 +460,21 @@ impl PisoGpuSolver {
|
||||
let correction_factor = -dt / density;
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.pressure_correction)
|
||||
.arg(&mut buffers.u_correction.clone())
|
||||
.arg(&mut buffers.v_correction.clone())
|
||||
.arg(&correction_factor)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Gradient kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.pressure_correction)
|
||||
.arg(&mut buffers.u_correction.clone())
|
||||
.arg(&mut buffers.v_correction.clone())
|
||||
.arg(&correction_factor)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Gradient kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
|
||||
@@ -215,25 +215,20 @@ impl D2Q9GpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut f.clone())
|
||||
.arg(density)
|
||||
.arg(velocity_x)
|
||||
.arg(velocity_y)
|
||||
.arg(&(self.cs2 as f32))
|
||||
.arg(&(nx as i32))
|
||||
.arg(&(ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!(
|
||||
"Equilibrium init kernel launch failed: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut f.clone())
|
||||
.arg(density)
|
||||
.arg(velocity_x)
|
||||
.arg(velocity_y)
|
||||
.arg(&(self.cs2 as f32))
|
||||
.arg(&(nx as i32))
|
||||
.arg(&(ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Equilibrium init kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -286,20 +281,18 @@ impl D2Q9GpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f.clone())
|
||||
.arg(&buffers.f_eq)
|
||||
.arg(&(self.omega as f32))
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Collision kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f.clone())
|
||||
.arg(&buffers.f_eq)
|
||||
.arg(&(self.omega as f32))
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Collision kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -331,19 +324,17 @@ impl D2Q9GpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f_temp.clone())
|
||||
.arg(&buffers.f)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Streaming kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f_temp.clone())
|
||||
.arg(&buffers.f)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Streaming kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
// Swap buffers: f = f_temp
|
||||
@@ -377,24 +368,22 @@ impl D2Q9GpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
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(&buffers.f)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!(
|
||||
"Macroscopic variables kernel launch failed: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
}
|
||||
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(&buffers.f)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!(
|
||||
"Macroscopic variables kernel launch failed: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -426,21 +415,19 @@ impl D2Q9GpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f_eq.clone())
|
||||
.arg(&buffers.density)
|
||||
.arg(&buffers.velocity_x)
|
||||
.arg(&buffers.velocity_y)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Equilibrium kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f_eq.clone())
|
||||
.arg(&buffers.density)
|
||||
.arg(&buffers.velocity_x)
|
||||
.arg(&buffers.velocity_y)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Equilibrium kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -472,18 +459,16 @@ impl D2Q9GpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f.clone())
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Boundary kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.f.clone())
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Boundary kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -528,24 +513,22 @@ impl D2Q9GpuSolver {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
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(&(density as f32))
|
||||
.arg(&(velocity.x as f32))
|
||||
.arg(&(velocity.y as f32))
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Initialization kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
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(&(density as f32))
|
||||
.arg(&(velocity.x as f32))
|
||||
.arg(&(velocity.y as f32))
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Initialization kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
|
||||
@@ -188,36 +188,31 @@ impl KEpsilonGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(u)
|
||||
.arg(v)
|
||||
.arg(w)
|
||||
.arg(&mut buffers.dudx)
|
||||
.arg(&mut buffers.dudy)
|
||||
.arg(&mut buffers.dudz)
|
||||
.arg(&mut buffers.dvdx)
|
||||
.arg(&mut buffers.dvdy)
|
||||
.arg(&mut buffers.dvdz)
|
||||
.arg(&mut buffers.dwdx)
|
||||
.arg(&mut buffers.dwdy)
|
||||
.arg(&mut buffers.dwdz)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&dz)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!(
|
||||
"Velocity gradients kernel launch failed: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(u)
|
||||
.arg(v)
|
||||
.arg(w)
|
||||
.arg(&mut buffers.dudx)
|
||||
.arg(&mut buffers.dudy)
|
||||
.arg(&mut buffers.dudz)
|
||||
.arg(&mut buffers.dvdx)
|
||||
.arg(&mut buffers.dvdy)
|
||||
.arg(&mut buffers.dvdz)
|
||||
.arg(&mut buffers.dwdx)
|
||||
.arg(&mut buffers.dwdy)
|
||||
.arg(&mut buffers.dwdz)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&dz)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Velocity gradients kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -252,22 +247,20 @@ impl KEpsilonGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.k)
|
||||
.arg(&buffers.epsilon)
|
||||
.arg(&mut buffers.eddy_viscosity)
|
||||
.arg(&self.constants.c_mu)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Eddy viscosity kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.k)
|
||||
.arg(&buffers.epsilon)
|
||||
.arg(&mut buffers.eddy_viscosity)
|
||||
.arg(&self.constants.c_mu)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Eddy viscosity kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -300,29 +293,27 @@ impl KEpsilonGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.eddy_viscosity)
|
||||
.arg(&buffers.dudx)
|
||||
.arg(&buffers.dudy)
|
||||
.arg(&buffers.dudz)
|
||||
.arg(&buffers.dvdx)
|
||||
.arg(&buffers.dvdy)
|
||||
.arg(&buffers.dvdz)
|
||||
.arg(&buffers.dwdx)
|
||||
.arg(&buffers.dwdy)
|
||||
.arg(&buffers.dwdz)
|
||||
.arg(&mut buffers.production)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Production kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.eddy_viscosity)
|
||||
.arg(&buffers.dudx)
|
||||
.arg(&buffers.dudy)
|
||||
.arg(&buffers.dudz)
|
||||
.arg(&buffers.dvdx)
|
||||
.arg(&buffers.dvdy)
|
||||
.arg(&buffers.dvdz)
|
||||
.arg(&buffers.dwdx)
|
||||
.arg(&buffers.dwdy)
|
||||
.arg(&buffers.dwdz)
|
||||
.arg(&mut buffers.production)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Production kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -357,24 +348,22 @@ impl KEpsilonGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.k)
|
||||
.arg(&buffers.epsilon)
|
||||
.arg(&buffers.production)
|
||||
.arg(&mut buffers.source_epsilon)
|
||||
.arg(&self.constants.c1_epsilon)
|
||||
.arg(&self.constants.c2_epsilon)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Epsilon source kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.k)
|
||||
.arg(&buffers.epsilon)
|
||||
.arg(&buffers.production)
|
||||
.arg(&mut buffers.source_epsilon)
|
||||
.arg(&self.constants.c1_epsilon)
|
||||
.arg(&self.constants.c2_epsilon)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Epsilon source kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -411,29 +400,25 @@ impl KEpsilonGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.k)
|
||||
.arg(&mut buffers.epsilon)
|
||||
.arg(&buffers.k_old)
|
||||
.arg(&buffers.epsilon_old)
|
||||
.arg(&buffers.production)
|
||||
.arg(&buffers.source_epsilon)
|
||||
.arg(&buffers.eddy_viscosity)
|
||||
.arg(&dt)
|
||||
.arg(&nu)
|
||||
.arg(&self.constants.sigma_k)
|
||||
.arg(&self.constants.sigma_epsilon)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Update kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.k)
|
||||
.arg(&mut buffers.epsilon)
|
||||
.arg(&buffers.k_old)
|
||||
.arg(&buffers.epsilon_old)
|
||||
.arg(&buffers.production)
|
||||
.arg(&buffers.source_epsilon)
|
||||
.arg(&buffers.eddy_viscosity)
|
||||
.arg(&dt)
|
||||
.arg(&nu)
|
||||
.arg(&self.constants.sigma_k)
|
||||
.arg(&self.constants.sigma_epsilon)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| CfdError::gpu_error(&format!("Update kernel launch failed: {}", e)))?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
|
||||
@@ -142,22 +142,20 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.delta)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&dz)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Filter width kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&mut buffers.delta)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&dz)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Filter width kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
@@ -222,36 +220,31 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(u)
|
||||
.arg(v)
|
||||
.arg(w)
|
||||
.arg(&mut buffers.dudx)
|
||||
.arg(&mut buffers.dudy)
|
||||
.arg(&mut buffers.dudz)
|
||||
.arg(&mut buffers.dvdx)
|
||||
.arg(&mut buffers.dvdy)
|
||||
.arg(&mut buffers.dvdz)
|
||||
.arg(&mut buffers.dwdx)
|
||||
.arg(&mut buffers.dwdy)
|
||||
.arg(&mut buffers.dwdz)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&dz)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!(
|
||||
"Velocity gradients kernel launch failed: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(u)
|
||||
.arg(v)
|
||||
.arg(w)
|
||||
.arg(&mut buffers.dudx)
|
||||
.arg(&mut buffers.dudy)
|
||||
.arg(&mut buffers.dudz)
|
||||
.arg(&mut buffers.dvdx)
|
||||
.arg(&mut buffers.dvdy)
|
||||
.arg(&mut buffers.dvdz)
|
||||
.arg(&mut buffers.dwdx)
|
||||
.arg(&mut buffers.dwdy)
|
||||
.arg(&mut buffers.dwdz)
|
||||
.arg(&dx)
|
||||
.arg(&dy)
|
||||
.arg(&dz)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Velocity gradients kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -285,28 +278,26 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.dudx)
|
||||
.arg(&buffers.dudy)
|
||||
.arg(&buffers.dudz)
|
||||
.arg(&buffers.dvdx)
|
||||
.arg(&buffers.dvdy)
|
||||
.arg(&buffers.dvdz)
|
||||
.arg(&buffers.dwdx)
|
||||
.arg(&buffers.dwdy)
|
||||
.arg(&buffers.dwdz)
|
||||
.arg(&mut buffers.strain_rate)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Strain rate kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.dudx)
|
||||
.arg(&buffers.dudy)
|
||||
.arg(&buffers.dudz)
|
||||
.arg(&buffers.dvdx)
|
||||
.arg(&buffers.dvdy)
|
||||
.arg(&buffers.dvdz)
|
||||
.arg(&buffers.dwdx)
|
||||
.arg(&buffers.dwdy)
|
||||
.arg(&buffers.dwdz)
|
||||
.arg(&mut buffers.strain_rate)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Strain rate kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -338,22 +329,20 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
unsafe {
|
||||
unsafe {
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.strain_rate)
|
||||
.arg(&buffers.delta)
|
||||
.arg(&mut buffers.sgs_viscosity)
|
||||
.arg(&self.constants.cs)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("SGS viscosity kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
self.kernel_manager
|
||||
.stream()
|
||||
.launch_builder(&func)
|
||||
.arg(&buffers.strain_rate)
|
||||
.arg(&buffers.delta)
|
||||
.arg(&mut buffers.sgs_viscosity)
|
||||
.arg(&self.constants.cs)
|
||||
.arg(&(buffers.nx as i32))
|
||||
.arg(&(buffers.ny as i32))
|
||||
.arg(&(buffers.nz as i32))
|
||||
.launch(config)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("SGS viscosity kernel launch failed: {}", e))
|
||||
})?;
|
||||
}
|
||||
|
||||
self.kernel_manager.synchronize()?;
|
||||
|
||||
Reference in New Issue
Block a user