gpu_pointer_attributes.hpp File Reference
#include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <cuda.h>
#include <cuda_runtime.h>
#include <format>
#include <memory>
#include <source_location>
#include <stdexcept>
#include <string_view>
Include dependency graph for gpu_pointer_attributes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Opm
 
namespace  Opm::gpuistl
 A small, fixed‑dimension MiniVector class backed by std::array that can be used in both host and CUDA device code.
 
namespace  Opm::gpuistl::detail
 

Macros

#define OPM_GPUISTL_DETAIL_ASSERT_HOST_POINTER(x)   ::Opm::gpuistl::detail::assertHostPointer((x), #x)
 Captures the argument name for assertHostPointer (call site via source_location). More...
 
#define OPM_GPUISTL_DETAIL_ASSERT_DEVICE_POINTER(x)    ::Opm::gpuistl::detail::assertDevicePointer((x), #x)
 Captures the argument name for assertDevicePointer (call site via source_location). More...
 

Functions

template<class T >
bool Opm::gpuistl::detail::isGPUPointer (const T *ptr)
 Checks whether the given pointer is associated with GPU device memory. More...
 
template<class T , class D >
bool Opm::gpuistl::detail::isGPUPointer (const std::unique_ptr< T, D > &ptr)
 Checks if the given std::unique_ptr with custom deleter refers to GPU memory. More...
 
template<class T >
bool Opm::gpuistl::detail::isGPUPointer (const std::shared_ptr< T > &ptr)
 Checks if the given std::shared_ptr refers to GPU memory. More...
 
template<class T >
bool Opm::gpuistl::detail::isCPUPointer (const T *ptr)
 Checks whether the given pointer is associated with CPU host memory. More...
 
template<class T , class D >
bool Opm::gpuistl::detail::isCPUPointer (const std::unique_ptr< T, D > &ptr)
 Checks if the given std::unique_ptr with custom deleter refers to CPU memory. More...
 
template<class T >
bool Opm::gpuistl::detail::isCPUPointer (const std::shared_ptr< T > &ptr)
 Checks if the given std::shared_ptr refers to CPU memory. More...
 
void Opm::gpuistl::detail::assertHostPointer (const void *ptr, std::string_view name, const std::source_location location=std::source_location::current())
 Debug-only check that ptr is host/CPU memory. More...
 
void Opm::gpuistl::detail::assertDevicePointer (const void *ptr, std::string_view name, const std::source_location location=std::source_location::current())
 Debug-only check that ptr is device/GPU memory. More...
 

Macro Definition Documentation

◆ OPM_GPUISTL_DETAIL_ASSERT_DEVICE_POINTER

#define OPM_GPUISTL_DETAIL_ASSERT_DEVICE_POINTER (   x)     ::Opm::gpuistl::detail::assertDevicePointer((x), #x)

Captures the argument name for assertDevicePointer (call site via source_location).

◆ OPM_GPUISTL_DETAIL_ASSERT_HOST_POINTER

#define OPM_GPUISTL_DETAIL_ASSERT_HOST_POINTER (   x)    ::Opm::gpuistl::detail::assertHostPointer((x), #x)

Captures the argument name for assertHostPointer (call site via source_location).