17 template <
typename Object>
42 template <
typename Object>
92 template <
typename Object>
93 class FunctorWrapperHost :
public FunctorWrapperHostBase
125 template <typename Object>
134 ::Kokkos::parallel_for(
139 static_cast<Object *
>(::Kokkos::kokkos_malloc<ExecSpace::memory_space>(
sizeof(Object)));
142 ::Kokkos::Impl::DeepCopy<MemSpace, ::Kokkos::HostSpace>(
145 return wrapper_device;
148 template <
typename Object>
156 ::Kokkos::Impl::DeepCopy<MemSpace, ::Kokkos::HostSpace>(
160 template <
typename Object>
167 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.
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...