19 template <
typename Object>
44 template <
typename Object>
94 template <
typename Object>
95 class FunctorWrapperHost :
public FunctorWrapperHostBase
127 template <typename Object>
136 ::Kokkos::parallel_for(
141 static_cast<Object *
>(::Kokkos::kokkos_malloc<ExecSpace::memory_space>(
sizeof(Object)));
144 ::Kokkos::Impl::DeepCopy<MemSpace, ::Kokkos::HostSpace>(
147 return wrapper_device;
150 template <
typename Object>
158 ::Kokkos::Impl::DeepCopy<MemSpace, ::Kokkos::HostSpace>(
162 template <
typename Object>
169 template <
typename Object>
void copyFunctor() override final
Copy functor to device.
virtual ~FunctorWrapperHostBase()
Virtual destructor.
Object * _functor_device
Copy of the functor on device.
virtual KOKKOS_FUNCTION ~FunctorWrapperDeviceBase()
Virtual destructor.
Base class for host functor wrapper.
virtual void copyFunctor()=0
Copy functor to device.
Device functor wrapper class that provides polymorphic interfaces for a functor.
virtual FunctorWrapperDeviceBase * allocate()=0
Allocate device functor and wrapper.
Object * _functor
Pointer to the functor on device.
FunctorWrapperDeviceBase * allocate() override final
Allocate device functor and wrapper.
virtual void freeFunctor()=0
Free host and device copies of functor.
std::unique_ptr< Object > _functor_copy
Copy of the functor on host.
KOKKOS_FUNCTION FunctorWrapperDevice()
Constructor.
FunctorWrapperHost(const void *functor)
Constructor.
KOKKOS_FUNCTION FunctorWrapperDeviceBase()
Constructor.
Base class for device functor wrapper.
void freeFunctor() override final
Free host and device copies of functor.
~FunctorWrapperHost()
Desturctor.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const Object & _functor_host
Reference of the functor on host.
Host functor wrapper class that allocates a functor on device and creates its device wrapper...