|
opm-simulators
|
A small, fixed‑dimension MiniVector class backed by std::array that can be used in both host and CUDA device code. More...
Namespaces | |
| namespace | detail |
| Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading. | |
| namespace | HypreInterface |
| Unified interface for Hypre operations with both CPU and GPU data structures. | |
Classes | |
| class | AmgxError |
| Exception class for AMGX errors. More... | |
| class | AmgxInterface |
| Unified interface for AMGX operations with both CPU and GPU data structures. More... | |
| class | GpuVector |
| class | GpuSparseMatrixWrapper |
| The GpuSparseMatrixWrapper Checks CUDA/HIP version and dispatches a version either using the old or the generic CUDA API. More... | |
| class | GpuSparseMatrixGeneric |
| The GpuSparseMatrixGeneric class uses cuSPARSE Generic API for sparse matrix operations. More... | |
| struct | is_gpu_type |
| Type trait to detect if a type is a GPU type. More... | |
| struct | is_gpu_type< GpuVector< T > > |
| struct | is_gpu_type< GpuSparseMatrixWrapper< T, ForceLegacy > > |
| struct | is_gpu_type< GpuSparseMatrixGeneric< T > > |
| class | PointerView |
| A view towards a smart pointer to GPU-allocated memory. More... | |
| class | PointerView< void > |
| Specialization of PointerView for void type This is needed beause we cannot have a PointerView<void> specialization due to dereferincing a void ptr. More... | |
| class | ValueAsPointer |
| A value stored with a pointer interface. More... | |
| class | GPUAwareMPISender |
| Derived class of GPUSender that handles MPI made with CUDA aware MPI The copOwnerToAll function uses MPI calls refering to data that resides on the GPU in order to send it directly to other GPUs, skipping the staging step on the CPU. More... | |
| class | GpuBlockPreconditioner |
| Is an adaptation of Dune::BlockPreconditioner that works within the CuISTL framework. More... | |
| class | GpuDILU |
| DILU preconditioner on the GPU. More... | |
| class | GpuJac |
| Jacobi preconditioner on the GPU. More... | |
| class | GPUObliviousMPISender |
| Derived class of GPUSender that handles MPI calls that should NOT use GPU direct communicatoin The implementation moves data fromthe GPU to the CPU and then sends it using regular MPI. More... | |
| class | GpuOwnerOverlapCopy |
| CUDA compatiable variant of Dune::OwnerOverlapCopyCommunication. More... | |
| class | GpuPressureTransferPolicy |
| class | GPUSender |
| GPUSender is a wrapper class for classes which will implement copOwnerToAll This is implemented with the intention of creating communicators with generic GPUSender To hide implementation that will either use GPU aware MPI or not. More... | |
| class | GpuSeqILU0 |
| Sequential ILU0 preconditioner on the GPU through the CuSparse library. More... | |
| class | GpuSparseMatrix |
| The GpuSparseMatrix class simple wrapper class for a CuSparse matrix. More... | |
| class | GpuView |
| The GpuView class is provides a view of some data allocated on the GPU Essenstially is only stores a pointer and a size. More... | |
| struct | ParallelInfo |
| Parallel domain decomposition information for HYPRE-Dune interface. More... | |
| struct | SparsityPattern |
| Compressed Sparse Row (CSR) sparsity pattern for HYPRE matrix assembly. More... | |
| struct | HypreHostDataArrays |
| Host arrays for HYPRE matrix and vector data transfers. More... | |
| struct | HypreDeviceDataArrays |
| GPU device memory arrays for HYPRE operations with GPU backend. More... | |
| class | HypreError |
| Exception class for Hypre errors. More... | |
| class | ISTLSolverGPUISTL |
| ISTL solver for GPU using the GPU ISTL backend. More... | |
| class | MiniMatrix |
| A small fixed-size square matrix class for use in CUDA kernels. More... | |
| class | MiniVector |
| class | OpmGpuILU0 |
| ILU0 preconditioner on the GPU. More... | |
| class | PinnedMemoryHolder |
| RAII class for pinning host memory using cudaHostRegister. More... | |
| class | PreconditionerAdapter |
| Makes a CUDA preconditioner available to a CPU simulator. More... | |
| class | PreconditionerConvertFieldTypeAdapter |
| Converts the field type (eg. More... | |
| class | PreconditionerCPUMatrixToGPUMatrix |
| Convert a CPU matrix to a GPU matrix and use a CUDA preconditioner on the GPU. More... | |
| class | PreconditionerHolder |
| Common interface for adapters that hold preconditioners. More... | |
| class | SolverAdapter |
| Wraps a CUDA solver to work with CPU data. More... | |
Enumerations | |
| enum class | MatrixStorageMPScheme { DOUBLE_DIAG_DOUBLE_OFFDIAG = 0 , FLOAT_DIAG_FLOAT_OFFDIAG = 1 , DOUBLE_DIAG_FLOAT_OFFDIAG = 2 } |
Functions | |
| std::string | getAmgxErrorMessage (AMGX_RC err, const std::string &expression, const std::string &file, const std::string &function, int line) |
| Get a descriptive error message for an AMGX error code. | |
| void | amgxSafeCall (AMGX_RC rc, const std::string &expression, const std::string &file, const std::string &function, int line) |
| Safe call wrapper for AMGX functions. | |
| MatrixStorageMPScheme | makeMatrixStorageMPScheme (int scheme) |
| void | printDevice () |
| void | setDevice () |
| OPM_CREATE_GPU_RESOURCE (GPUStream, cudaStream_t, cudaStreamCreate, cudaStreamDestroy) | |
| Manages a CUDA stream resource. | |
| OPM_CREATE_GPU_RESOURCE (GPUEvent, cudaEvent_t, cudaEventCreate, cudaEventDestroy) | |
| Manages a CUDA event resource. | |
| OPM_CREATE_GPU_RESOURCE (GPUGraph, cudaGraph_t, cudaGraphCreate, cudaGraphDestroy, 0) | |
| Manages a CUDA graph resource. | |
| OPM_CREATE_GPU_RESOURCE_NO_CREATE (GPUGraphExec, cudaGraphExec_t, cudaGraphExecDestroy) | |
| Manages a CUDA graph execution resource. | |
| template<typename T> | |
| std::shared_ptr< T > | make_gpu_shared_ptr () |
| Creates a shared pointer managing GPU-allocated memory of the specified element type. | |
| template<typename T> | |
| std::shared_ptr< T > | make_gpu_shared_ptr (const T &value) |
| Creates a shared pointer managing GPU-allocated memory of the specified element type. | |
| template<typename T> | |
| auto | make_gpu_unique_ptr () |
| Creates a unique pointer managing GPU-allocated memory of the specified element type. | |
| template<typename T> | |
| auto | make_gpu_unique_ptr (const T &value) |
| Creates a unique pointer managing GPU-allocated memory of the specified element type. | |
| template<class T> | |
| T | copyFromGPU (const T *value) |
| Copies a value from GPU-allocated memory to the host. | |
| template<class T> | |
| T | copyFromGPU (const std::shared_ptr< T > &value) |
| Copies a value from GPU-allocated memory to the host. | |
| template<class T, class Deleter> | |
| T | copyFromGPU (const std::unique_ptr< T, Deleter > &value) |
| Copies a value from GPU-allocated memory to the host. | |
| template<class T> | |
| void | copyToGPU (const T &value, T *ptr) |
| Copies a value from the host to GPU-allocated memory. | |
| template<class T> | |
| void | copyToGPU (const T &value, const std::shared_ptr< T > &ptr) |
| Copies a value from the host to GPU-allocated memory using a shared_ptr. | |
| template<class T, class Deleter> | |
| void | copyToGPU (const T &value, const std::unique_ptr< T, Deleter > &ptr) |
| Copies a value from the host to GPU-allocated memory using a unique_ptr. | |
| template<class T> | |
| PointerView< T > | make_view (const std::shared_ptr< T > &ptr) |
| template<class T, class Deleter> | |
| PointerView< T > | make_view (const std::unique_ptr< T, Deleter > &ptr) |
| template<class field_type, int block_size, class OwnerOverlapCopyCommunicationType> | |
| std::shared_ptr< GpuOwnerOverlapCopy< field_type, OwnerOverlapCopyCommunicationType > > | makeGpuOwnerOverlapCopy (const OwnerOverlapCopyCommunicationType &cpuOwnerOverlapCopy) |
| INSTANTIATE_FOR_TYPE_AND_CLASS (GpuSparseMatrix, float) | |
| INSTANTIATE_FOR_TYPE_AND_CLASS (GpuSparseMatrix, double) | |
| INSTANTIATE_FOR_TYPE_AND_CLASS (GpuSparseMatrixGeneric, float) | |
| INSTANTIATE_FOR_TYPE_AND_CLASS (GpuSparseMatrixGeneric, double) | |
| void | setZeroAtIndexSet (const GpuVector< int > &indexSet) |
| The GpuVector class is a simple (arithmetic) vector class for the GPU. | |
| std::string | toDebugString () |
| template<typename T> | |
| void | writeMatrixMarket (const GpuVector< T > &vectorOnDevice, std::ostream &ostr) |
| std::string | getHypreErrorMessage (HYPRE_Int err, const std::string &expression, const std::string &file, const std::string &function, int line) |
| Get a descriptive error message for a Hypre error code. | |
| void | hypreSafeCall (HYPRE_Int rc, const std::string &expression, const std::string &file, const std::string &function, int line) |
| Safe call wrapper for Hypre functions. | |
| void | setDevice (int mpiRank, int numberOfMpiRanks) |
| Sets the correct CUDA device in the setting of MPI. | |
| void | printDevice (int mpiRank, int numberOfMpiRanks) |
Variables | |
| template<typename T> | |
| constexpr bool | is_gpu_type_v = is_gpu_type<T>::value |
| Helper variable template for easier usage. | |
A small, fixed‑dimension MiniVector class backed by std::array that can be used in both host and CUDA device code.
The implementation purposefully remains lightweight, containing only the utilities required for element access, iteration, and initialization. It avoids dynamic memory and leverages the compile‑time Dimension parameter to enable full constexpr evaluation whenever possible.
|
inline |
Safe call wrapper for AMGX functions.
Checks the return code from AMGX functions and throws an AmgxError if an error occurred.
| rc | The AMGX return code to check |
| expression | The expression being evaluated (for error reporting) |
| file | The source file (typically FILE) |
| function | The function name (typically func) |
| line | The line number (typically LINE) |
| AmgxError | if the return code indicates an error |
| T Opm::gpuistl::copyFromGPU | ( | const std::shared_ptr< T > & | value | ) |
Copies a value from GPU-allocated memory to the host.
| value | A shared pointer to the value on the GPU. |
| T Opm::gpuistl::copyFromGPU | ( | const std::unique_ptr< T, Deleter > & | value | ) |
Copies a value from GPU-allocated memory to the host.
| Deleter | The custom deleter type. |
| value | A unique pointer to the value on the GPU (with a custom deleter). |
| T Opm::gpuistl::copyFromGPU | ( | const T * | value | ) |
Copies a value from GPU-allocated memory to the host.
| value | A pointer to the value on the GPU. |
| void Opm::gpuistl::copyToGPU | ( | const T & | value, |
| const std::shared_ptr< T > & | ptr ) |
Copies a value from the host to GPU-allocated memory using a shared_ptr.
| value | The value to copy to the GPU. |
| ptr | A shared_ptr to the GPU-allocated memory. |
| void Opm::gpuistl::copyToGPU | ( | const T & | value, |
| const std::unique_ptr< T, Deleter > & | ptr ) |
Copies a value from the host to GPU-allocated memory using a unique_ptr.
| Deleter | The custom deleter type. |
| value | The value to copy to the GPU. |
| ptr | A unique_ptr to the GPU-allocated memory (with a custom deleter). |
| void Opm::gpuistl::copyToGPU | ( | const T & | value, |
| T * | ptr ) |
Copies a value from the host to GPU-allocated memory.
| value | The value to copy to the GPU. |
| ptr | A pointer to the GPU-allocated memory. |
|
inline |
Get a descriptive error message for an AMGX error code.
| err | The AMGX error code |
| expression | The AMGX expression that caused the error |
| file | The source file where the error occurred |
| function | The function where the error occurred |
| line | The line number where the error occurred |
|
inline |
Get a descriptive error message for a Hypre error code.
| err | The Hypre error code |
| expression | The Hypre expression that caused the error |
| file | The source file where the error occurred |
| function | The function where the error occurred |
| line | The line number where the error occurred |
|
inline |
Safe call wrapper for Hypre functions.
Checks the return code from Hypre functions and throws a HypreError if an error occurred.
| rc | The Hypre return code to check |
| expression | The expression being evaluated (for error reporting) |
| file | The source file (typically FILE) |
| function | The function name (typically func) |
| line | The line number (typically LINE) |
| HypreError | if the return code indicates an error |
| std::shared_ptr< T > Opm::gpuistl::make_gpu_shared_ptr | ( | ) |
Creates a shared pointer managing GPU-allocated memory of the specified element type.
This function allocates memory on the GPU for the type T, using cudaMalloc. It returns a std::shared_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.
| T | The element type to allocate on the GPU. |
| std::shared_ptr< T > Opm::gpuistl::make_gpu_shared_ptr | ( | const T & | value | ) |
Creates a shared pointer managing GPU-allocated memory of the specified element type.
This function allocates memory on the GPU for the type T, using cudaMalloc. It returns a std::shared_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.
| T | The element type to allocate on the GPU. |
| value | The value to copy to the GPU-allocated memory. |
| auto Opm::gpuistl::make_gpu_unique_ptr | ( | ) |
Creates a unique pointer managing GPU-allocated memory of the specified element type.
This function allocates memory on the GPU for the type T, using cudaMalloc . It returns a std::unique_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.
| T | The element type to allocate on the GPU. |
| auto Opm::gpuistl::make_gpu_unique_ptr | ( | const T & | value | ) |
Creates a unique pointer managing GPU-allocated memory of the specified element type.
This function allocates memory on the GPU for the type T, using cudaMalloc. It returns a std::unique_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.
| T | The element type to allocate on the GPU. |
| value | The value to copy to the GPU-allocated memory. |
| Opm::gpuistl::OPM_CREATE_GPU_RESOURCE | ( | GPUEvent | , |
| cudaEvent_t | , | ||
| cudaEventCreate | , | ||
| cudaEventDestroy | ) |
Manages a CUDA event resource.
This resource encapsulates a cudaEvent_t handle and provides automatic creation and destruction of the CUDA event. Use this resource to measure elapsed time or synchronize GPU executions between different streams.
| Opm::gpuistl::OPM_CREATE_GPU_RESOURCE | ( | GPUGraph | , |
| cudaGraph_t | , | ||
| cudaGraphCreate | , | ||
| cudaGraphDestroy | , | ||
| 0 | ) |
Manages a CUDA graph resource.
This resource encapsulates a cudaGraph_t handle and provides automatic creation and destruction of a CUDA graph. It represents a series of operations captured for efficient replay, execution, or modification.
| Opm::gpuistl::OPM_CREATE_GPU_RESOURCE | ( | GPUStream | , |
| cudaStream_t | , | ||
| cudaStreamCreate | , | ||
| cudaStreamDestroy | ) |
Manages a CUDA stream resource.
This resource encapsulates a cudaStream_t handle and provides automatic creation and destruction of the CUDA stream. Use this resource to schedule and synchronize GPU kernels or other asynchronous operations.
| Opm::gpuistl::OPM_CREATE_GPU_RESOURCE_NO_CREATE | ( | GPUGraphExec | , |
| cudaGraphExec_t | , | ||
| cudaGraphExecDestroy | ) |
Manages a CUDA graph execution resource.
This resource encapsulates a cudaGraphExec_t handle and provides automatic destruction of the CUDA graph execution object. It represents the compiled and optimized version of a CUDA graph ready for efficient execution.
| void Opm::gpuistl::setDevice | ( | int | mpiRank, |
| int | numberOfMpiRanks ) |
Sets the correct CUDA device in the setting of MPI.
| void Opm::gpuistl::setZeroAtIndexSet | ( | const GpuVector< int > & | indexSet | ) |
The GpuVector class is a simple (arithmetic) vector class for the GPU.
Example usage: