srdatalog.runtime¶
Bundled C++ runtime headers + vendored deps.
The Python codegen emits jit_batch_<rule>.cpp files that #include
srdatalog.h (the bundled SRDatalog runtime). The runtime in turn
includes boost / highway / RMM / spdlog (also bundled, under
vendor/) plus CUDA SDK headers (NOT bundled — must come from a
system NVIDIA install; auto-detected via find_cuda_root()).
runtime_include_paths() returns every -I path needed to compile
batch files, EXCEPT the CUDA toolkit. Combine with
cuda_include_paths() and cuda_compile_flags() for a full
CompilerConfig:
from srdatalog import CompilerConfig
from srdatalog.runtime import (
runtime_include_paths, cuda_include_paths,
cuda_compile_flags, runtime_defines, runtime_undefines,
)
cfg = CompilerConfig(
cxx="acpp",
include_paths=runtime_include_paths() + cuda_include_paths(),
defines=runtime_defines(),
cxx_flags=cuda_compile_flags(),
)
Package Contents¶
Functions¶
CUDA-specific clang flags ( |
|
All -I paths a CUDA-enabled compile needs. Auto-detects via
|
|
|
|
|
|
Locate a usable CUDA toolkit. Tries (in order): |
|
True if boost/highway/rmm/spdlog headers are present under
|
|
Preprocessor |
|
Absolute path to the bundled |
|
All bundled C++ -I paths (runtime + vendored deps). CUDA paths
are NOT included here — see |
|
Preprocessor |
API¶
- srdatalog.runtime.cuda_compile_flags(cuda_root: str | None = None, gpu_arch: str = 'sm_89') list[str][source]¶
CUDA-specific clang flags (
-x cuda,--cuda-gpu-arch=,--cuda-path=). Combine withruntime_include_paths()+cuda_include_paths()for a full CompilerConfig.
- srdatalog.runtime.cuda_include_paths(cuda_root: str | None = None) list[str][source]¶
All -I paths a CUDA-enabled compile needs. Auto-detects via
find_cuda_root()whencuda_rootis None; raises RuntimeError if no toolkit is found.
- srdatalog.runtime.cuda_libs() list[str][source]¶
-l<libname>entries needed to satisfy the runtime’s CUDA symbol references (cudaMemcpyAsync, cuLaunchKernel, …) and the vendored boost libs whose ABI must match the vendored boost headers.Boost is listed BEFORE cudart so that the static
.ain the vendor dir wins over any systemlibboost_*.soon the-Lsearch path.
- srdatalog.runtime.cuda_link_flags(cuda_root: str | None = None) list[str][source]¶
-Lpaths the link step needs. Pair withcuda_libs().
- srdatalog.runtime.find_cuda_root() str | None[source]¶
Locate a usable CUDA toolkit. Tries (in order):
$CUDA_HOME/$CUDA_PATHNVIDIA HPC SDK:
/opt/nvidia/hpc_sdk/.../cuda/<version>Standard install:
/usr/local/cuda,/opt/cuda
Among multiple HPC SDK CUDA versions, prefer one where
thrust/optional.hexists — that header was removed in CUDA 13.0+ but RMM (bundled in vendor/) still needs it. So 12.9 is preferred over 13.0+ on machines that have both.
- srdatalog.runtime.has_vendored_deps() bool[source]¶
True if boost/highway/rmm/spdlog headers are present under
runtime/vendor/. False on a fresh clone — callsrdatalog populate-vendor(or use the install hook) to fetch them.
- srdatalog.runtime.runtime_defines() list[str][source]¶
Preprocessor
-Dflags the runtime expects. Append toCompilerConfig.defines.ENABLE_LOGGINGis intentionally NOT here — it pulls in boost::log and its phoenix/proto/spirit transitive deps (~50 MB of headers we don’t ship in the wheel). Opt in by appending"ENABLE_LOGGING"to your own defines AND supplying system boost::log headers via an additional-Ipath, e.g.::cfg.defines.append("ENABLE_LOGGING") cfg.include_paths.append("/usr/include") # system boost
- srdatalog.runtime.runtime_include_path() str[source]¶
Absolute path to the bundled
generalized_datalog/headers. Kept for back-compat — preferruntime_include_paths()(plural).
- srdatalog.runtime.runtime_include_paths() list[str][source]¶
All bundled C++ -I paths (runtime + vendored deps). CUDA paths are NOT included here — see
cuda_include_paths().Order matters: more-specific subdirs first so
#include "../mir.h"resolves correctly via path arithmetic (e.g.build/../mir.h=mir.h).