|
Celeritas 0.7.0-33+develop.9c828abdd
|
Include CUDA or HIP runtime APIs for compiling with host/cc compiler. More...
Macros | |
| #define | CELER_DEVICE_PLATFORM none |
| API prefix token for the device offloading type. | |
| #define | CELER_DEVICE_PLATFORM_UPPER_STR "" |
| #define | CELER_DEVICE_API_SYMBOL(TOK) void |
| Add a prefix "hip" or "cuda" to a code token. | |
| #define | CELER_EU_PER_CU 0 |
| Execution units per compute unit. | |
| #define | CELER_DEVICE_RUNTIME_INCLUDED 1 |
| This macro informs downstream Celeritas code (namely, Stream and DeviceEvent) that it's safe to use types from the device APIs. | |
| #define | CELER_DEVICE_API_CALL(STMT) |
| Safely and portably dispatch a CUDA/HIP API call. | |
| #define | CELER_DEVICE_PREFIX(STMT) CELER_DEVICE_API_SYMBOL(STMT) |
| #define | CELER_DEVICE_CALL_PREFIX(STMT) CELER_DEVICE_API_CALL(STMT) |
| #define | CELER_DEVICE_CHECK_ERROR() CELER_DEVICE_API_CALL(PeekAtLastError()) |
| #define | CELER_USE_THRUST 0 |
| #define | CELER_CUB_HAS_TRANSFORM 0 |
| #define | CELER_CUB_HAS_FLAGGEDIF 0 |
| #define | CELER_HIPCUB_HAS_TRANSFORM 0 |
| Determine if CUB or hipCUB is available, and if so, check the version. | |
Include CUDA or HIP runtime APIs for compiling with host/cc compiler.
| #define CELER_DEVICE_API_CALL | ( | STMT | ) |
Safely and portably dispatch a CUDA/HIP API call.
When CUDA or HIP support is enabled, execute the wrapped statement prepend the argument with "cuda" or "hip" and throw a RuntimeError if it fails. If no device platform is enabled, throw an unconfigured assertion.
| #define CELER_EU_PER_CU 0 |
Execution units per compute unit.
AMD multiprocessors each have 4 SIMD units per compute unit, but there is no device attribute or compiler definition that provides this information. For CUDA, each streaming multiprocessor (MP) is a single "execution unit" and a "compute unit".
| #define CELER_HIPCUB_HAS_TRANSFORM 0 |
Determine if CUB or hipCUB is available, and if so, check the version.
CUDA has included CUB since CUDA 11, but ROCm does not include hipCUB by default, so test for the availability of hipCUB and use thrust instead if it's unavailable.
DeviceTransform::Transform is unavailable in earlier versions of CUB/hipCUB, so the code uses thrust::transform in that case.
DeviceSelect::FlaggedIf is unavailable in earlier versions of CUB and doesn't work with hipCUB versions 3.4.0 through 4.1.0 when using celeritas OpaqueId data types, so use a transform and DeviceSelect::Flagged instead.