@@ -127,30 +127,22 @@ 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 () :
137
136
#endif
138
137
#if defined(AXOM_RUNTIME_POLICY_USE_CUDA)
139
- ,
140
- {axom::runtime_policy::Policy::cuda,
141
- axom::execution_space<axom::CUDA_EXEC<256 >>::allocatorID ()}
138
+ policy == axom::runtime_policy::Policy::cuda ?
139
+ axom::execution_space<axom::CUDA_EXEC<256 >>::allocatorID () :
142
140
#endif
143
141
#if defined(AXOM_RUNTIME_POLICY_USE_HIP)
144
- ,
145
- {axom::runtime_policy::Policy::hip,
146
- axom::execution_space<axom::HIP_EXEC<256 >>::allocatorID ()}
142
+ policy == axom::runtime_policy::Policy::hip ?
143
+ axom::execution_space<axom::HIP_EXEC<256 >>::allocatorID () :
147
144
#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 ;
145
+ axom::execution_space<axom::SEQ_EXEC>::allocatorID () ;
154
146
}
155
147
156
148
} // namespace axom
0 commit comments