rtx-cfd CUDA Poisson kernels: solve ∇²φ = f as documented (the updates subtracted the source with the wrong sign); the Jacobi test's stop is absolute on a source of size 2π²
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
Documentation / Build API Documentation (push) Failing after 5s
CI / Build CPU-Only (Explicit) (push) Failing after 6s
CI / Build (ubuntu-latest) (push) Failing after 7s
Documentation / Build User Guide (push) Successful in 6s
CI / Format Check (push) Failing after 13s
CI / Clippy Check (push) Failing after 36s
Performance Benchmarks / Run Benchmarks (push) Successful in 1m42s
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
Documentation / Build API Documentation (push) Failing after 5s
CI / Build CPU-Only (Explicit) (push) Failing after 6s
CI / Build (ubuntu-latest) (push) Failing after 7s
Documentation / Build User Guide (push) Successful in 6s
CI / Format Check (push) Failing after 13s
CI / Clippy Check (push) Failing after 36s
Performance Benchmarks / Run Benchmarks (push) Successful in 1m42s
This commit is contained in:
@@ -38,7 +38,7 @@ extern "C" __global__ void poisson_jacobi_2d(
|
|||||||
|
|
||||||
// Jacobi iteration: φ^{k+1}_ij = factor * (source_ij + (1/dx²)(φ_{i+1,j} + φ_{i-1,j}) + (1/dy²)(φ_{i,j+1} + φ_{i,j-1}))
|
// Jacobi iteration: φ^{k+1}_ij = factor * (source_ij + (1/dx²)(φ_{i+1,j} + φ_{i-1,j}) + (1/dy²)(φ_{i,j+1} + φ_{i,j-1}))
|
||||||
phi_new[idx] = factor * (
|
phi_new[idx] = factor * (
|
||||||
source[idx] +
|
-source[idx] +
|
||||||
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
||||||
dy2_inv * (phi[idx_jp1] + phi[idx_jm1])
|
dy2_inv * (phi[idx_jp1] + phi[idx_jm1])
|
||||||
);
|
);
|
||||||
@@ -76,7 +76,7 @@ extern "C" __global__ void poisson_gauss_seidel_2d(
|
|||||||
|
|
||||||
// Gauss-Seidel update (in-place)
|
// Gauss-Seidel update (in-place)
|
||||||
phi[idx] = factor * (
|
phi[idx] = factor * (
|
||||||
source[idx] +
|
-source[idx] +
|
||||||
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
||||||
dy2_inv * (phi[idx_jp1] + phi[idx_jm1])
|
dy2_inv * (phi[idx_jp1] + phi[idx_jm1])
|
||||||
);
|
);
|
||||||
@@ -116,7 +116,7 @@ extern "C" __global__ void poisson_sor_2d(
|
|||||||
|
|
||||||
// Compute Gauss-Seidel update
|
// Compute Gauss-Seidel update
|
||||||
float phi_gs = factor * (
|
float phi_gs = factor * (
|
||||||
source[idx] +
|
-source[idx] +
|
||||||
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
||||||
dy2_inv * (phi[idx_jp1] + phi[idx_jm1])
|
dy2_inv * (phi[idx_jp1] + phi[idx_jm1])
|
||||||
);
|
);
|
||||||
@@ -195,7 +195,7 @@ extern "C" __global__ void poisson_jacobi_3d(
|
|||||||
|
|
||||||
// 3D Jacobi iteration
|
// 3D Jacobi iteration
|
||||||
phi_new[idx] = factor * (
|
phi_new[idx] = factor * (
|
||||||
source[idx] +
|
-source[idx] +
|
||||||
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
dx2_inv * (phi[idx_ip1] + phi[idx_im1]) +
|
||||||
dy2_inv * (phi[idx_jp1] + phi[idx_jm1]) +
|
dy2_inv * (phi[idx_jp1] + phi[idx_jm1]) +
|
||||||
dz2_inv * (phi[idx_kp1] + phi[idx_km1])
|
dz2_inv * (phi[idx_kp1] + phi[idx_km1])
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ mod cuda_tests {
|
|||||||
// Jacobi needs O(n²) sweeps on this grid and its residual floor in f32 sits
|
// Jacobi needs O(n²) sweeps on this grid and its residual floor in f32 sits
|
||||||
// above 1e-6; the accuracy check below is the pin, the stop is loose.
|
// above 1e-6; the accuracy check below is the pin, the stop is loose.
|
||||||
let max_iterations = 20_000;
|
let max_iterations = 20_000;
|
||||||
let tolerance = 1e-4;
|
let tolerance = 1e-2; // absolute, on a source of size 2π²
|
||||||
let iterations = poisson_kernel.solve_2d(
|
let iterations = poisson_kernel.solve_2d(
|
||||||
&mut d_phi,
|
&mut d_phi,
|
||||||
&d_source,
|
&d_source,
|
||||||
|
|||||||
Reference in New Issue
Block a user