19 template <
typename Object>
45 KOKKOS_FUNCTION
virtual Real div(Real t,
Real3 p)
const = 0;
59 template <
typename Object>
90 return _function->timeIntegral(t1, t2, p);
134 template <
typename Object>
135 class FunctionWrapperHost :
public FunctionWrapperHostBase
170 template <typename Object>
179 ::Kokkos::parallel_for(
184 static_cast<Object *
>(::Kokkos::kokkos_malloc<ExecSpace::memory_space>(
sizeof(Object)));
187 ::Kokkos::Impl::DeepCopy<MemSpace, ::Kokkos::HostSpace>(
190 return wrapper_device;
193 template <
typename Object>
201 ::Kokkos::Impl::DeepCopy<MemSpace, ::Kokkos::HostSpace>(
205 template <
typename Object>
212 template <
typename Object>
Device function wrapper class that provides polymorphic interfaces for a function.
KOKKOS_FUNCTION Real value(Real t, Real3 p) const override final
Virtual shims that calls the corresponding methods of the actual stored function. ...
Base class for device function wrapper.
const Object & _function_host
Reference of the function on host.
virtual KOKKOS_FUNCTION Real timeIntegral(Real t1, Real t2, Real3 p) const =0
std::unique_ptr< Object > _function_copy
Copy of the function on host.
virtual KOKKOS_FUNCTION Real3 gradient(Real t, Real3 p) const =0
virtual FunctionWrapperDeviceBase * allocate()=0
Allocate device function and wrapper.
KOKKOS_FUNCTION Real3 curl(Real t, Real3 p) const override final
Object * _function_device
Copy of the function on device.
virtual void copyFunction()=0
Copy function to device.
void freeFunction() override final
Free host and device copies of function.
virtual KOKKOS_FUNCTION Real3 vectorValue(Real t, Real3 p) const =0
KOKKOS_FUNCTION Real average() const override final
virtual KOKKOS_FUNCTION Real integral() const =0
KOKKOS_FUNCTION Real3 gradient(Real t, Real3 p) const override final
KOKKOS_FUNCTION FunctionWrapperDevice()
Constructor.
virtual KOKKOS_FUNCTION Real average() const =0
virtual void freeFunction()=0
Free host and device copies of function.
~FunctionWrapperHost()
Destructor.
FunctionWrapperDeviceBase * allocate() override final
Allocate device function and wrapper.
virtual KOKKOS_FUNCTION Real timeDerivative(Real t, Real3 p) const =0
Host function wrapper class that allocates a function on device and creates its device wrapper...
virtual KOKKOS_FUNCTION Real div(Real t, Real3 p) const =0
KOKKOS_FUNCTION Real timeIntegral(Real t1, Real t2, Real3 p) const override final
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FunctionWrapperHost(const void *function)
Constructor.
KOKKOS_FUNCTION Real timeDerivative(Real t, Real3 p) const override final
KOKKOS_FUNCTION Real integral() const override final
Object * _function
Pointer to the function on device.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
KOKKOS_FUNCTION FunctionWrapperDeviceBase()
Constructor.
virtual KOKKOS_FUNCTION Real value(Real t, Real3 p) const =0
Virtual shims that calls the corresponding methods of the actual stored function. ...
KOKKOS_FUNCTION Real3 vectorValue(Real t, Real3 p) const override final
virtual KOKKOS_FUNCTION Real3 curl(Real t, Real3 p) const =0
Base class for host function wrapper.
virtual ~FunctionWrapperHostBase()
Virtual destructor.
void copyFunction() override final
Copy function to device.
virtual KOKKOS_FUNCTION ~FunctionWrapperDeviceBase()
Virtual destructor.
KOKKOS_FUNCTION Real div(Real t, Real3 p) const override final