@@ -127,30 +127,25 @@ namespace axom
127
127
{
128
128
129
129
// / \brief Return default allocator id for a runtime policy.
130
- static const std::map< axom::runtime_policy::Policy, int > s_policyToDefaultAllocatorID {
131
- {axom::runtime_policy::Policy::seq,
132
- axom::execution_space<axom::SEQ_EXEC>:: allocatorID ()}
130
+ inline int policyToDefaultAllocatorID ( axom::runtime_policy::Policy policy)
131
+ {
132
+ return
133
133
#if defined(AXOM_RUNTIME_POLICY_USE_OPENMP)
134
- ,
135
- { axom::runtime_policy::Policy::omp,
136
- axom::execution_space<axom::OMP_EXEC>:: allocatorID ()}
134
+ policy == axom::runtime_policy::Policy::omp
135
+ ? axom::execution_space<axom::OMP_EXEC>:: allocatorID ()
136
+ :
137
137
#endif
138
138
#if defined(AXOM_RUNTIME_POLICY_USE_CUDA)
139
- ,
140
- { axom::runtime_policy::Policy::cuda,
141
- axom::execution_space<axom::CUDA_EXEC< 256 >>:: allocatorID ()}
139
+ policy == axom::runtime_policy::Policy::cuda
140
+ ? axom::execution_space<axom::CUDA_EXEC< 256 >>:: allocatorID ()
141
+ :
142
142
#endif
143
143
#if defined(AXOM_RUNTIME_POLICY_USE_HIP)
144
- ,
145
- { axom::runtime_policy::Policy::hip,
146
- axom::execution_space<axom::HIP_EXEC< 256 >>:: allocatorID ()}
144
+ policy == axom::runtime_policy::Policy::hip
145
+ ? axom::execution_space<axom::HIP_EXEC< 256 >>:: allocatorID ()
146
+ :
147
147
#endif
148
- };
149
-
150
- // / \brief Return default allocator id for a runtime policy.
151
- inline int policyToDefaultAllocatorID (axom::runtime_policy::Policy policy)
152
- {
153
- return s_policyToDefaultAllocatorID.find (policy)->second ;
148
+ axom::execution_space<axom::SEQ_EXEC>::allocatorID ();
154
149
}
155
150
156
151
} // namespace axom
0 commit comments