NeoFOAM
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
NeoFOAM::GPUExecutor Class Reference

Executor for GPU offloading. More...

#include <GPUExecutor.hpp>

Public Types

using exec = Kokkos::DefaultExecutionSpace
 

Public Member Functions

 GPUExecutor ()
 
 ~GPUExecutor ()
 
template<typename T >
T * alloc (size_t size) const
 
template<typename T >
T * realloc (void *ptr, size_t newSize) const
 
template<typename ValueType >
decltype(auto) createKokkosView (ValueType *ptr, size_t size) const
 create a Kokkos view for a given ptr
 
void * alloc (size_t size) const
 
void * realloc (void *ptr, size_t newSize) const
 
void free (void *ptr) const noexcept
 
std::string name () const
 

Detailed Description

Executor for GPU offloading.

Definition at line 16 of file GPUExecutor.hpp.

Member Typedef Documentation

◆ exec

using NeoFOAM::GPUExecutor::exec = Kokkos::DefaultExecutionSpace

Definition at line 20 of file GPUExecutor.hpp.

Constructor & Destructor Documentation

◆ GPUExecutor()

NeoFOAM::GPUExecutor::GPUExecutor ( )

◆ ~GPUExecutor()

NeoFOAM::GPUExecutor::~GPUExecutor ( )

Member Function Documentation

◆ alloc() [1/2]

template<typename T >
T * NeoFOAM::GPUExecutor::alloc ( size_t  size) const
inline

Definition at line 26 of file GPUExecutor.hpp.

◆ alloc() [2/2]

void * NeoFOAM::GPUExecutor::alloc ( size_t  size) const
inline

Definition at line 52 of file GPUExecutor.hpp.

◆ createKokkosView()

template<typename ValueType >
decltype(auto) NeoFOAM::GPUExecutor::createKokkosView ( ValueType *  ptr,
size_t  size 
) const
inline

create a Kokkos view for a given ptr

Based on the executor this function creates a Kokkos view into the data managed by ptr

Parameters
ptrPointer to data for which a view should be created
sizeNumber of elements this view contains
Template Parameters
ValueTypeThe value type the underlying memory holds

Definition at line 45 of file GPUExecutor.hpp.

◆ free()

void NeoFOAM::GPUExecutor::free ( void *  ptr) const
inlinenoexcept

Definition at line 59 of file GPUExecutor.hpp.

◆ name()

std::string NeoFOAM::GPUExecutor::name ( ) const
inline

Definition at line 61 of file GPUExecutor.hpp.

◆ realloc() [1/2]

template<typename T >
T * NeoFOAM::GPUExecutor::realloc ( void *  ptr,
size_t  newSize 
) const
inline

Definition at line 32 of file GPUExecutor.hpp.

◆ realloc() [2/2]

void * NeoFOAM::GPUExecutor::realloc ( void *  ptr,
size_t  newSize 
) const
inline

Definition at line 54 of file GPUExecutor.hpp.


The documentation for this class was generated from the following file: