16#ifndef OPM_SIMULATORS_LINALG_GPUISTL_GPU_SMART_POINTER_HPP
17#define OPM_SIMULATORS_LINALG_GPUISTL_GPU_SMART_POINTER_HPP
19#include <cuda_runtime.h>
23#include <opm/common/utility/gpuDecorators.hpp>
24#include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
25#include <opm/simulators/linalg/gpuistl/detail/is_gpu_pointer.hpp>
95 return std::unique_ptr<T, decltype(deleter)>(
ptr,
deleter);
165template <
class T,
class Deleter>
214template <
class T,
class Deleter>
239 template <
class Deleter>
271make_view(
const std::shared_ptr<T>&
ptr)
276template <
class T,
class Deleter>
278make_view(
const std::unique_ptr<T, Deleter>&
ptr)
A view towards a smart pointer to GPU-allocated memory.
Definition gpu_smart_pointer.hpp:230
void copyToGPU(const T &value, T *ptr)
Copies a value from the host to GPU-allocated memory.
Definition gpu_smart_pointer.hpp:182
std::shared_ptr< T > make_gpu_shared_ptr()
Creates a shared pointer managing GPU-allocated memory of the specified element type.
Definition gpu_smart_pointer.hpp:48
T copyFromGPU(const T *value)
Copies a value from GPU-allocated memory to the host.
Definition gpu_smart_pointer.hpp:129
auto make_gpu_unique_ptr()
Creates a unique pointer managing GPU-allocated memory of the specified element type.
Definition gpu_smart_pointer.hpp:89
bool isGPUPointer(const T *ptr)
Checks whether the given pointer is associated with GPU device memory.
Definition is_gpu_pointer.hpp:40
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242