Serac  0.1
Serac is an implicit thermal strucural mechanics simulation code.
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
accelerator.hpp File Reference

This file contains the interface used for initializing/terminating any hardware accelerator-related functionality. More...

#include <memory>
#include <cstring>
#include <tuple>
#include "axom/core.hpp"
#include "serac/infrastructure/logger.hpp"
#include "serac/infrastructure/memory.hpp"
#include "serac/infrastructure/profiling.hpp"
#include "serac/serac_config.hpp"
Include dependency graph for accelerator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  serac::detail::execution_to_memory< space >
 Trait for "translating" between serac::ExecutionSpace and axom::MemorySpace. More...
 

Namespaces

 serac
 Accelerator functionality.
 
 serac::accelerator
 Namespace for methods involving accelerator-enabled builds.
 

Macros

#define SERAC_HOST_DEVICE
 Macro that evaluates to __host__ __device__ when compiling with nvcc and does nothing on a host compiler.
 
#define SERAC_HOST
 Macro that evaluates to __host__ when compiling with nvcc and does nothing on a host compiler.
 
#define SERAC_DEVICE
 Macro that evaluates to __device__ when compiling with nvcc and does nothing on a host compiler.
 
#define SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING
 Macro to turn off specific nvcc warnings.
 

Typedefs

template<typename T , int dim, ExecutionSpace space>
using serac::ExecArray = axom::Array< T, dim, detail::execution_to_memory_v< space > >
 Alias for an Array corresponding to a particular ExecutionSpace.
 
template<typename T , int dim = 1>
using serac::CPUArray = ExecArray< T, dim, ExecutionSpace::CPU >
 Alias for an array on the CPU.
 
template<typename T , int dim = 1>
using serac::GPUArray = ExecArray< T, dim, ExecutionSpace::CPU >
 Alias for an array on the GPU.
 
template<typename T , int dim = 1>
using serac::UnifiedArray = ExecArray< T, dim, ExecutionSpace::CPU >
 Alias for an array in unified memory.
 
template<typename T , int dim, ExecutionSpace space>
using serac::ExecArrayView = axom::ArrayView< T, dim, detail::execution_to_memory_v< space > >
 Alias for an ArrayView corresponding to a particular ExecutionSpace.
 
template<typename T , int dim = 1>
using serac::CPUArrayView = ExecArrayView< T, dim, ExecutionSpace::CPU >
 Alias for an array view on the CPU.
 

Enumerations

enum class  serac::ExecutionSpace { CPU , GPU , Dynamic }
 enum used for signalling whether or not to perform certain calculations on the CPU or GPU
 

Functions

template<typename T , int dim, axom::MemorySpace space>
void serac::detail::zero_out (axom::Array< T, dim, space > &arr)
 set the contents of an array to zero, byte-wise
 
template<typename T , int dim>
void serac::detail::zero_out (axom::ArrayView< T, dim, detail::host_memory_space > &arr)
 set the contents of an array to zero, byte-wise
 
template<typename T , int dim, axom::MemorySpace space>
auto serac::view (axom::Array< T, dim, space > &arr)
 convenience function for creating a view of an axom::Array type
 
void serac::accelerator::initializeDevice ()
 Initializes the device (GPU) More...
 
void serac::accelerator::terminateDevice ()
 Cleans up the device, if applicable.
 
template<ExecutionSpace exec, typename T >
std::shared_ptr< T[]> serac::accelerator::make_shared_array (std::size_t n)
 create shared_ptr to an array of n values of type T, either on the host or device More...
 
template<ExecutionSpace exec, typename... T>
auto serac::accelerator::make_shared_arrays (std::size_t n)
 create shared_ptr to an array of n values of type T, either on the host or device More...
 

Variables

constexpr ExecutionSpace serac::default_execution_space = ExecutionSpace::CPU
 The default execution space for serac builds.
 
template<ExecutionSpace space>
constexpr axom::MemorySpace serac::detail::execution_to_memory_v = execution_to_memory<space>::value
 Helper template for execution_to_memory trait.
 

Detailed Description

This file contains the interface used for initializing/terminating any hardware accelerator-related functionality.

Definition in file accelerator.hpp.