38#ifndef EBGEOMETRY_GPUTRANSFORM_HPP
39#define EBGEOMETRY_GPUTRANSFORM_HPP
60#if defined(EBGEOMETRY_CUDA) || defined(EBGEOMETRY_HIP)
61inline constexpr bool enabled =
true;
69#if defined(EBGEOMETRY_HIP)
71#elif defined(EBGEOMETRY_CUDA)
129template <class Query, class In>
254transform(const Query& a_query, const std::vector<In>& a_in, std::vector<Out>& a_out);
259#include "EBGeometry_GPUTransformImplem.hpp"
Backend-neutral GPU runtime API layer (CUDA or HIP) plus the EBGEOMETRY_GPU_CHECK macro.
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Placement-policy layer for the GPU memory foundation: the abstract MemoryResource and its concrete ho...
Placement-independent POD array views for the GPU memory foundation.
Abstract placement policy: allocates and frees raw, correctly-aligned byte blocks.
Definition EBGeometry_MemoryResource.hpp:69
Growable bump arena over a MemoryResource.
Definition EBGeometry_Pool.hpp:183
void parallelFor(std::size_t a_n, const F &a_f)
Run a functor on every index: a_f(i) for i = 0, ..., a_n - 1, in no particular order.
void transform(const Query &a_query, PODSpan< In > a_in, PODSpan< Out > a_out)
Run a query on every input in place: a_out[i] = a_query(a_in[i]), with no allocation and no copies.
constexpr bool enabled
Whether this translation unit is compiled as CUDA or HIP, so that parallelFor() and transform() run a...
Definition EBGeometry_GPUTransform.hpp:63
constexpr const char * backendName
Where parallelFor() and transform() run in this translation unit: "HIP", "CUDA" or "host".
Definition EBGeometry_GPUTransform.hpp:74
std::decay_t< std::invoke_result_t< const Query &, const In & > > TransformResult
The result type of a query on an input.
Definition EBGeometry_GPUTransform.hpp:130
constexpr unsigned int DefaultMinResidentThreads
The threads a launch asks the CUDA compiler to keep resident on each multiprocessor,...
Definition EBGeometry_GPUTransform.hpp:100
MemoryResource & memoryResource() noexcept
The memory a query's data must live in for parallelFor() and transform() to read it.
constexpr unsigned int DefaultBlockSize
The number of threads per block a launch uses unless it is given another.
Definition EBGeometry_GPUTransform.hpp:83
bool deviceAvailable() noexcept
Whether a GPU is visible to the runtime.
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Raw pointer + size view into a Pool block, for hot inner loops.
Definition EBGeometry_PODVector.hpp:52
Placement-independent descriptor of a POD array inside a Pool.
Definition EBGeometry_PODVector.hpp:119