Warning, file /include/corecel/Types.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #pragma once
0014
0015 #include <cstddef>
0016 #include <string>
0017
0018 #include "corecel/Config.hh"
0019
0020 #include "Macros.hh"
0021
0022 namespace celeritas
0023 {
0024
0025 #if CELER_USE_DEVICE || defined(__DOXYGEN__)
0026
0027 using size_type = unsigned int;
0028 #else
0029 using size_type = std::size_t;
0030 #endif
0031
0032 #if CELERITAS_REAL_TYPE == CELERITAS_REAL_TYPE_DOUBLE
0033
0034 using real_type = double;
0035 #elif CELERITAS_REAL_TYPE == CELERITAS_REAL_TYPE_FLOAT
0036 using real_type = float;
0037 #else
0038 using real_type = void;
0039 #endif
0040
0041
0042 using ull_int = unsigned long long int;
0043
0044
0045
0046
0047
0048 enum class MemSpace
0049 {
0050 host,
0051 device,
0052 mapped,
0053 size_,
0054 #if defined(CELER_DEVICE_SOURCE) || defined(__DOXYGEN__)
0055 native = device,
0056 #else
0057 native = host,
0058 #endif
0059 };
0060
0061
0062 enum class Ownership
0063 {
0064 value,
0065 reference,
0066 const_reference,
0067 };
0068
0069
0070
0071 enum class UnitSystem
0072 {
0073 none,
0074 cgs,
0075 si,
0076 clhep,
0077 size_,
0078 native = CELERITAS_UNITS,
0079 };
0080
0081
0082
0083
0084
0085
0086 template<template<Ownership, MemSpace> class P>
0087 using HostVal = P<Ownership::value, MemSpace::host>;
0088
0089 template<template<Ownership, MemSpace> class P>
0090 using HostCRef = P<Ownership::const_reference, MemSpace::host>;
0091
0092 template<template<Ownership, MemSpace> class S>
0093 using HostRef = S<Ownership::reference, MemSpace::host>;
0094
0095
0096 template<template<Ownership, MemSpace> class P>
0097 using DeviceCRef = P<Ownership::const_reference, MemSpace::device>;
0098
0099 template<template<Ownership, MemSpace> class S>
0100 using DeviceRef = S<Ownership::reference, MemSpace::device>;
0101
0102
0103 template<template<Ownership, MemSpace> class P>
0104 using NativeCRef = P<Ownership::const_reference, MemSpace::native>;
0105
0106 template<template<Ownership, MemSpace> class S>
0107 using NativeRef = S<Ownership::reference, MemSpace::native>;
0108
0109 template<class T, MemSpace M>
0110 class ObserverPtr;
0111
0112
0113 template<template<Ownership, MemSpace> class P, MemSpace M>
0114 using CRefPtr = ObserverPtr<P<Ownership::const_reference, M> const, M>;
0115
0116 template<template<Ownership, MemSpace> class S, MemSpace M>
0117 using RefPtr = ObserverPtr<S<Ownership::reference, M>, M>;
0118
0119
0120
0121
0122
0123
0124
0125
0126 char const* to_cstring(MemSpace m);
0127
0128
0129 char const* to_cstring(UnitSystem);
0130
0131
0132 UnitSystem to_unit_system(std::string const& s);
0133
0134
0135 }