Class that registers dispatchers of all Kokkos functors.
More...
#include <KokkosDispatcher.h>
|
template<typename Operation , typename Object > |
static void | add (const std::string &name) |
| Register a dispatcher of an operation of a functor. More...
|
|
template<typename Operation > |
static void | hasUserMethod (const std::string &name, bool flag) |
| Set whether the user has overriden the hook method associated with an operation of a functor. More...
|
|
template<typename Operation > |
static bool | hasUserMethod (const std::string &name) |
| Get whether the user has overriden the hook method associated with an operation of a functor. More...
|
|
template<typename Operation > |
static std::unique_ptr< DispatcherBase > | build (const void *object, const std::string &name) |
| Build and get a dispatcher of an operation of a functor. More...
|
|
|
std::map< std::pair< std::type_index, std::string >, std::unique_ptr< DispatcherRegistryEntryBase > > | _dispatchers |
| Map containing the dispatcher shells with the key being the pair of function tag type index and registered object type name. More...
|
|
Class that registers dispatchers of all Kokkos functors.
Definition at line 148 of file KokkosDispatcher.h.
◆ DispatcherRegistry() [1/3]
Moose::Kokkos::DispatcherRegistry::DispatcherRegistry |
( |
| ) |
|
|
default |
◆ DispatcherRegistry() [2/3]
◆ DispatcherRegistry() [3/3]
◆ add()
template<typename Operation , typename Object >
static void Moose::Kokkos::DispatcherRegistry::add |
( |
const std::string & |
name | ) |
|
|
inlinestatic |
Register a dispatcher of an operation of a functor.
- Template Parameters
-
Operation | The function tag of operator() to be dispatched |
Object | The functor class type |
- Parameters
-
name | The registered object type name |
Definition at line 166 of file KokkosDispatcher.h.
168 auto operation = std::type_index(
typeid(Operation));
171 std::make_unique<DispatcherRegistryEntry<Operation, Object>>();
std::map< std::pair< std::type_index, std::string >, std::unique_ptr< DispatcherRegistryEntryBase > > _dispatchers
Map containing the dispatcher shells with the key being the pair of function tag type index and regis...
static DispatcherRegistry & getRegistry()
Get the registry singleton.
◆ build()
template<typename Operation >
static std::unique_ptr<DispatcherBase> Moose::Kokkos::DispatcherRegistry::build |
( |
const void * |
object, |
|
|
const std::string & |
name |
|
) |
| |
|
inlinestatic |
Build and get a dispatcher of an operation of a functor.
- Template Parameters
-
Operation | The function tag of operator() |
- Parameters
-
object | The pointer to the functor |
name | The registered object type name |
- Returns
- The dispatcher
Definition at line 206 of file KokkosDispatcher.h.
208 return getDispatcher<Operation>(
name)->
build(
object);
std::string name(const ElemQuality q)
static std::unique_ptr< DispatcherBase > build(const void *object, const std::string &name)
Build and get a dispatcher of an operation of a functor.
◆ getDispatcher()
template<typename Operation >
static auto& Moose::Kokkos::DispatcherRegistry::getDispatcher |
( |
const std::string & |
name | ) |
|
|
inlinestaticprivate |
Get the dispatcher shell of an operation of a functor.
- Template Parameters
-
Operation | The function tag of operator() |
- Parameters
-
name | The registered object type name |
- Returns
- The dispatcher shell
Definition at line 225 of file KokkosDispatcher.h.
227 auto operation = std::type_index(
typeid(Operation));
231 mooseError(
"Kokkos functor dispatcher not registered for object type '",
233 "'. Double check that you used Kokkos-specific registration macro.");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
std::map< std::pair< std::type_index, std::string >, std::unique_ptr< DispatcherRegistryEntryBase > > _dispatchers
Map containing the dispatcher shells with the key being the pair of function tag type index and regis...
static DispatcherRegistry & getRegistry()
Get the registry singleton.
◆ getRegistry()
◆ hasUserMethod() [1/2]
template<typename Operation >
static void Moose::Kokkos::DispatcherRegistry::hasUserMethod |
( |
const std::string & |
name, |
|
|
bool |
flag |
|
) |
| |
|
inlinestatic |
Set whether the user has overriden the hook method associated with an operation of a functor.
- Template Parameters
-
Operation | The function tag of operator() |
- Parameters
-
name | The registered object type name |
flag | Whether the user has overriden the hook method |
Definition at line 181 of file KokkosDispatcher.h.
Referenced by hasUserMethod().
std::string name(const ElemQuality q)
static void hasUserMethod(const std::string &name, bool flag)
Set whether the user has overriden the hook method associated with an operation of a functor...
◆ hasUserMethod() [2/2]
template<typename Operation >
static bool Moose::Kokkos::DispatcherRegistry::hasUserMethod |
( |
const std::string & |
name | ) |
|
|
inlinestatic |
Get whether the user has overriden the hook method associated with an operation of a functor.
- Template Parameters
-
Operation | The function tag of operator() |
- Parameters
-
name | The registered object type name |
- Returns
- Whether the user has overriden the hook method
Definition at line 193 of file KokkosDispatcher.h.
std::string name(const ElemQuality q)
static void hasUserMethod(const std::string &name, bool flag)
Set whether the user has overriden the hook method associated with an operation of a functor...
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ _dispatchers
std::map<std::pair<std::type_index, std::string>, std::unique_ptr<DispatcherRegistryEntryBase> > Moose::Kokkos::DispatcherRegistry::_dispatchers |
|
private |
The documentation for this class was generated from the following file: