#include "impactx_export.H"
#include <AMReX_Gpu.H>
#include <map>
#include <memory>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>
Go to the source code of this file.
◆ IMPACTX_GPUDATA_EXTERN
| #define IMPACTX_GPUDATA_EXTERN |
( |
| ElementType | ) |
|
Value:
ElementType::DynamicData::DataType>;
Definition dynamicdata.H:54
Suppress implicit instantiation of GPUDataRegistry for an element type.
GPUDataRegistry holds its registry map and ID counter in exported static data members (s_next_id, s_registry) declared inside the class and defined out-of-line in this header. Without explicit instantiation control, different translation units, especially downstream shared libraries built with -fvisibility=hidden and/or LTO (e.g. the Python bindings module), could materialize a separate copy of these statics, causing elements to be registered in one registry instance but looked up in another (ODR violation).
Use IMPACTX_GPUDATA_EXTERN in headers and IMPACTX_GPUDATA_INSTANTIATE in the corresponding .cpp file to ensure a single shared registry across the program.
- Parameters
-
| ElementType | The element class (must define using DynamicData = ...) |
◆ IMPACTX_GPUDATA_INSTANTIATE
| #define IMPACTX_GPUDATA_INSTANTIATE |
( |
| ElementType | ) |
|
Value:
ElementType::DynamicData::DataType>;
Explicit instantiation of GPUDataRegistry for an element type.
Provides the single definition of the registry's s_next_id / s_registry static data members. Pair with IMPACTX_GPUDATA_EXTERN in the header.
- Parameters
-
| ElementType | The element class (must define using DynamicData = ...) |