|
TDLS 0.4.0
Tiny Device-callable Linear Solvers
|
Detection of the compiler, of the language and of the side of the compilation pass: the one place where TDLS identifies the toolchain and the pass. Tests of a compiler version or of an architecture level stay where they serve, on top of these macros. More...
Go to the source code of this file.
Macros | |
| #define | TDLS_DETAIL_PASS_HOST |
| The host. | |
| #define | TDLS_DETAIL_TARGET_GPU 0 |
| The pass generates CPU code. | |
| #define | TDLS_TARGET_GPU TDLS_DETAIL_TARGET_GPU |
| 1 when the code is meant for a GPU, 0 for a CPU: what the defaults that depend on the hardware read (ArrowheadLUppConfig::block_row_interchange Auto, ArrowheadLUppConfig::rhs_pass_width -1). They shape the work of one solve only; TiledLUpp and CooperativeLUpp, whose factors can cross from the device to the host, reject RowInterchange::Auto. Deduced from the side of the pass (TDLS_DETAIL_TARGET_GPU). Where the pass cannot tell, it guesses the GPU: the generic mode of AdaptiveCpp, compiled for the device at run time, and the SPIR-V passes of SYCL and OpenMP, which an OpenCL CPU runs as well. -DTDLS_TARGET_GPU=0 (or 1) overrides the guess; a wrong value costs speed, never results. Under nvc++ with CUDA, one pass for the host and the device, the deduced value holds in constant expressions only: at run time, host code takes the CPU defaults and device code the GPU ones (NV_IF_TARGET), unless TDLS_TARGET_GPU is given. | |
Detection of the compiler, of the language and of the side of the compilation pass: the one place where TDLS identifies the toolchain and the pass. Tests of a compiler version or of an architecture level stay where they serve, on top of these macros.
Every macro below is internal (TDLS_DETAIL_) and defined when its condition holds; the headers that depend on the target include this one and test these macros instead of those of the toolchains.
Compilers:
Languages, for the function-space decorations:
Side of the compilation pass, exactly one of:
The order matters. clang defines CUDA_ARCH in the OpenMP device pass for AMDGCN up to clang 18, and DPC++ does not define it for NVPTX: the AMDGCN and NVPTX macros are tested first. AdaptiveCpp defines NVPTX in the host pass of its CUDA mode too, and the host pass of HIP defines AMDGCN, plus SPIRV for amdgcnspirv: the device macros count only outside the host passes of these languages. Every other SPIR-V device pass, SYCL or OpenMP, follows. The generic mode of AdaptiveCpp, recognized by the macro its compiler defines, comes last among the device passes.
Hardware of the pass: