kicad2ems.mom25d.gpu

mom25d.gpu - GPU dense LU for the mixed-precision direct solver, through Vulkan
(gpu_vk.py: any Vulkan GPU, AMD, Intel or NVIDIA)

The matrix is still filled on the CPU (the C++ core takes ~2 s); the expensive
O(N^3) part, the complex64 LU factorisation, runs on the GPU. The refinement's
products are in double precision, so results match the CPU solver: on the GPU
where it holds the double matrix too (put_dense, mul_dense; policy.GPU_DENSE),
else on the CPU. A factor whose GPU triangular solves lose their accuracy is
downloaded and solved on the CPU.

Backends (force one with MOM25D_GPU=vulkan|emulate|off; 'auto' is Vulkan):
  vulkan   slangpy on any Vulkan GPU (gpu_vk.py): a hybrid LU, the panels on
           the CPU (LAPACK), the updates on the GPU. LU in place: VRAM ~ 8 N^2
           bytes (16 GB: ~41k unknowns). On an RX 7800 XT it factors faster
           than rocSOLVER from N = 4096. The complex-symmetric LDL^T
           (gpu_ldl.py, factor_ldl: the solver's default, policy.LDL) on the
           lower half alone: ~4 N^2 bytes, half the work.
  emulate  NumPy stand-in with the same interface (tests / development without
           a GPU).
class kicad2ems.mom25d.gpu.EmulatedBackend(mem=64000000000.0)[source]
NumPy/SciPy implementation of the backend interface (no GPU; for
tests).
kicad2ems.mom25d.gpu.describe()[source]
One-line status for logs / --gpu-info.
kicad2ems.mom25d.gpu.get_backend(pref='auto')[source]
Return a backend instance or None. pref: 'auto' | 'vulkan' | 'emulate' |
'off'. The environment variable MOM25D_GPU overrides pref.
Reasons for failures are kept in get_backend.why for logging.