|
ImpactX
|
#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.
Classes | |
| struct | impactx::elements::mixin::GPUDataRegistry< T > |
Namespaces | |
| namespace | impactx |
| namespace | impactx::elements |
| namespace | impactx::elements::mixin |
Macros | |
| #define | IMPACTX_GPUDATA_EXTERN(ElementType) |
| #define | IMPACTX_GPUDATA_INSTANTIATE(ElementType) |
Variables | |
| template<typename T> | |
| int | impactx::elements::mixin::GPUDataRegistry< T >::s_next_id = 0 |
| template<typename T> | |
| std::map< int, std::shared_ptr< T > > | impactx::elements::mixin::GPUDataRegistry< T >::s_registry |
| #define IMPACTX_GPUDATA_EXTERN | ( | ElementType | ) |
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.
| ElementType | The element class (must define using DynamicData = ...) |
| #define IMPACTX_GPUDATA_INSTANTIATE | ( | ElementType | ) |
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.
| ElementType | The element class (must define using DynamicData = ...) |