Opm::gpuistl::HypreInterface Namespace Reference

Functions

template<typename VectorType >
void setContinuousVectorForHypre (const VectorType &v, std::vector< HYPRE_Real > &continuous_vector_values, const std::vector< int > &local_hypre_to_local_dune)
 Extract owned vector values in the order expected by HYPRE. More...
 
template<typename VectorType >
void setDuneVectorFromContinuousVector (VectorType &v, const std::vector< HYPRE_Real > &continuous_vector_values, const std::vector< int > &local_hypre_to_local_dune)
 Distribute HYPRE vector values back to original vector positions. More...
 
template<typename VectorType >
void transferCpuVectorToHypre (const VectorType &cpu_vec, HYPRE_IJVector hypre_vec, linalg::HypreInterface::HostDataArrays &host_arrays, const linalg::HypreInterface::DeviceDataArrays &device_arrays, const linalg::HypreInterface::ParallelInfo &par_info)
 Transfer CPU vector to Hypre vector. More...
 
template<typename VectorType >
void transferHypreToCpuVector (HYPRE_IJVector hypre_vec, VectorType &cpu_vec, linalg::HypreInterface::HostDataArrays &host_arrays, const linalg::HypreInterface::DeviceDataArrays &device_arrays, const linalg::HypreInterface::ParallelInfo &par_info)
 Transfer Hypre vector to CPU vector. More...
 
template<typename MatrixType >
void updateMatrixFromCpuMatrix (const MatrixType &cpu_matrix, HYPRE_IJMatrix hypre_matrix, const linalg::HypreInterface::SparsityPattern &sparsity_pattern, const linalg::HypreInterface::DeviceDataArrays &device_arrays)
 Update Hypre matrix from CPU matrix Uses HYPRE_IJMatrixSetValues2 with pre-computed row_indexes, which allows us to use the original CPU matrix data (with potential ghost values) directly. More...
 
template<typename VectorType >
void setContinuousGpuVectorForHypre (const VectorType &v, std::vector< HYPRE_Real > &continuous_vector_values, const std::vector< int > &local_hypre_to_local_dune)
 
template<typename VectorType >
void setGpuVectorFromContinuousVector (VectorType &v, const std::vector< HYPRE_Real > &continuous_vector_values, const std::vector< int > &local_hypre_to_local_dune)
 
template<typename T , bool ForceLegacy>
linalg::HypreInterface::SparsityPattern setupSparsityPatternFromGpuMatrix (const GpuSparseMatrixWrapper< T, ForceLegacy > &gpu_matrix, const linalg::HypreInterface::ParallelInfo &par_info, bool owner_first)
 Setup sparsity pattern from GPU matrix (GpuSparseMatrix) More...
 
template<typename T , bool ForceLegacy>
std::vector< HYPRE_Int > computeRowIndexesWithMappingGpu (const GpuSparseMatrixWrapper< T, ForceLegacy > &gpu_matrix, const std::vector< int > &local_dune_to_local_hypre)
 Compute row indexes for GPU matrix with ownership mapping. More...
 

Function Documentation

◆ computeRowIndexesWithMappingGpu()

template<typename T , bool ForceLegacy>
std::vector< HYPRE_Int > Opm::gpuistl::HypreInterface::computeRowIndexesWithMappingGpu ( const GpuSparseMatrixWrapper< T, ForceLegacy > &  gpu_matrix,
const std::vector< int > &  local_dune_to_local_hypre 
)

Compute row indexes for GPU matrix with ownership mapping.

GPU-specialized version that uses CSR row pointers to create row_indexes pointing directly into the FULL GPU matrix data for zero-copy operation. Same principle as CPU version but leverages GPU matrix's CSR structure.

Parameters
gpu_matrixGPU matrix to analyze
local_dune_to_local_hypreMapping from Dune indices to Hypre indices (-1 for ghost)
Returns
Vector containing row indexes that map to full GPU matrix data positions

References Opm::gpuistl::GpuSparseMatrixWrapper< T, ForceLegacy >::getRowIndices(), and Opm::gpuistl::GpuSparseMatrixWrapper< T, ForceLegacy >::N().

Referenced by Opm::linalg::HypreInterface::computeRowIndexes().

◆ setContinuousGpuVectorForHypre()

template<typename VectorType >
void Opm::gpuistl::HypreInterface::setContinuousGpuVectorForHypre ( const VectorType &  v,
std::vector< HYPRE_Real > &  continuous_vector_values,
const std::vector< int > &  local_hypre_to_local_dune 
)

◆ setContinuousVectorForHypre()

template<typename VectorType >
void Opm::gpuistl::HypreInterface::setContinuousVectorForHypre ( const VectorType &  v,
std::vector< HYPRE_Real > &  continuous_vector_values,
const std::vector< int > &  local_hypre_to_local_dune 
)

Extract owned vector values in the order expected by HYPRE.

Referenced by transferCpuVectorToHypre().

◆ setDuneVectorFromContinuousVector()

template<typename VectorType >
void Opm::gpuistl::HypreInterface::setDuneVectorFromContinuousVector ( VectorType &  v,
const std::vector< HYPRE_Real > &  continuous_vector_values,
const std::vector< int > &  local_hypre_to_local_dune 
)

Distribute HYPRE vector values back to original vector positions.

Referenced by transferHypreToCpuVector().

◆ setGpuVectorFromContinuousVector()

template<typename VectorType >
void Opm::gpuistl::HypreInterface::setGpuVectorFromContinuousVector ( VectorType &  v,
const std::vector< HYPRE_Real > &  continuous_vector_values,
const std::vector< int > &  local_hypre_to_local_dune 
)

◆ setupSparsityPatternFromGpuMatrix()

◆ transferCpuVectorToHypre()

◆ transferHypreToCpuVector()

◆ updateMatrixFromCpuMatrix()

template<typename MatrixType >
void Opm::gpuistl::HypreInterface::updateMatrixFromCpuMatrix ( const MatrixType &  cpu_matrix,
HYPRE_IJMatrix  hypre_matrix,
const linalg::HypreInterface::SparsityPattern sparsity_pattern,
const linalg::HypreInterface::DeviceDataArrays device_arrays 
)