rtx-cfd legacy GPU modules: cudarc 0.18 API — unsafe launches, the stream accessor, memcpy_htod argument order; the renamed k-ε constants and ::standard(); get_module clones; CfdConfig test literals take ..Default
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 / Build (ubuntu-latest) (push) Failing after 5s
CI / Clippy Check (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 6s
Documentation / Build API Documentation (push) Failing after 17s
CI / Build CPU-Only (Explicit) (push) Failing after 32s
CI / Format Check (push) Failing after 42s
Performance Benchmarks / Run Benchmarks (push) Successful in 1m59s
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 / Build (ubuntu-latest) (push) Failing after 5s
CI / Clippy Check (push) Failing after 5s
Documentation / Build User Guide (push) Successful in 6s
Documentation / Build API Documentation (push) Failing after 17s
CI / Build CPU-Only (Explicit) (push) Failing after 32s
CI / Format Check (push) Failing after 42s
Performance Benchmarks / Run Benchmarks (push) Successful in 1m59s
This commit is contained in:
@@ -60,7 +60,7 @@ impl SmagorinskyGpuModel {
|
||||
|
||||
Ok(Self {
|
||||
kernel_manager,
|
||||
constants: SmagorinskyConstants::default(),
|
||||
constants: SmagorinskyConstants::standard(),
|
||||
smagorinsky_module: None,
|
||||
gpu_buffers: None,
|
||||
})
|
||||
@@ -80,7 +80,7 @@ impl SmagorinskyGpuModel {
|
||||
/// Load and compile Smagorinsky CUDA kernels
|
||||
fn load_smagorinsky_kernels(&mut self) -> CfdResult<()> {
|
||||
// In real implementation, would compile or load PTX for Smagorinsky kernels
|
||||
self.smagorinsky_module = Some(self.kernel_manager.get_module("smagorinsky_kernels")?);
|
||||
self.smagorinsky_module = Some(self.kernel_manager.get_module("smagorinsky_kernels")?.clone());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -138,20 +138,22 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
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))
|
||||
})?;
|
||||
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.synchronize()?;
|
||||
@@ -216,31 +218,33 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
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))
|
||||
})?;
|
||||
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))
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -274,26 +278,28 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
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))
|
||||
})?;
|
||||
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))
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -325,20 +331,22 @@ impl SmagorinskyGpuModel {
|
||||
};
|
||||
|
||||
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))
|
||||
})?;
|
||||
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.synchronize()?;
|
||||
@@ -356,7 +364,7 @@ impl SmagorinskyGpuModel {
|
||||
let mut sgs_viscosity_host = vec![0.0f32; n];
|
||||
|
||||
self.kernel_manager
|
||||
.stream
|
||||
.stream()
|
||||
.memcpy_dtoh(&buffers.sgs_viscosity, &mut sgs_viscosity_host)
|
||||
.map_err(|e| {
|
||||
CfdError::gpu_error(&format!("Failed to copy SGS viscosity from GPU: {}", e))
|
||||
|
||||
Reference in New Issue
Block a user