tulpa 0.0.194
0.0.194
-
CUDA is used when a device is available, and there is now exactly one
definition of the batched-CUDA backend (#396).
cuda_batched_choleskyand its siblings were defined TWICE, differently:
gpu_backend.hcompiled stubs returningFALSEin the#elsebranch of
#ifdef TULPA_ENABLE_CUDA-- which neitherMakevarsever defined -- while
gpu_nngp_laplace.hincludedgpu_cuda.hdirectly and compiled the real
ones. Twoinlinedefinitions of the same entity across translation units is
an ODR violation: the linker keeps one COMDAT and discards the rest, so
whether CUDA ran at all was decided by link order rather than by any switch,
and nothing in the package could report which had been built.gpu_cuda.his now included from exactly one place, and the NNGP kernels
reach it throughgpu_backend.hlike everything else. Compiling it in needs
no CUDA SDK at build time and no GPU at run time: the driver, cuBLAS and
cuSOLVER entry points resolve dynamically and every entry returnsFALSE
when absent, which is what makes "use CUDA if available" expressible as a
default.TULPA_DISABLE_CUDAbuilds the stubs instead, and that is now a
whole-program choice.cpp_gpu_backend_kind()reports"cuda"or"stub", so which
implementation was compiled is observable rather than inferred -- a silent
either/or is what let this sit. It is deliberately separate from
cpp_gpu_available(), which asks whether a usable device is present at run
time.Two closed investigations should be re-read in this light: #283
fixed a column-major/row-major bug in this path, and #389 ruled
the GPU dispatch out as a cause -- a conclusion consistent with the stub
having won the link. The per-matrix batch verification added in 0.0.192
(#392) is what now guards the path on machines where it does run,
and the #389 determinism arbiter passes with the CUDA backend
live on a device-equipped machine.