16 using IndexType =
typename MatrixT::IndexType ;
17 using ValueType =
typename MatrixT::ValueType ;
18 HCSRViewT(MatrixT
const* parent,
19 BackEnd::Memory::eType memory,
29 case BackEnd::Memory::Device :
31 if constexpr (
requires{m_parent->allocateDevicePointers(nrows,nnz,&m_rows,&m_ncols,&m_cols,&m_values);})
33 m_parent->allocateDevicePointers(nrows,nnz,&m_rows,&m_ncols,&m_cols,&m_values);
36 throw Arccore::FatalErrorException(A_FUNCINFO,
"Matrix Type doest not support allocateDevicePointers");
39 case BackEnd::Memory::Host :
42 if constexpr (
requires{m_parent->allocateHostPointers(nrows,nnz,&m_rows,&m_ncols,&m_cols,&m_values);})
44 m_parent->allocateHostPointers(nrows,nnz,&m_rows,&m_ncols,&m_cols,&m_values);
47 throw Arccore::FatalErrorException(A_FUNCINFO,
"Matrix Type doest not support allocateHostPointers");
58 case BackEnd::Memory::Device :
60 if constexpr (
requires{m_parent->freeDevicePointers(m_rows,m_ncols,m_cols,m_values);})
62 m_parent->freeDevicePointers(m_rows,m_ncols,m_cols,m_values);
66 case BackEnd::Memory::Host :
69 if constexpr (
requires{m_parent->freeHostPointers(m_rows,m_ncols,m_cols,m_values);})
71 m_parent->freeHostPointers(m_rows,m_ncols,m_cols,m_values);
78 MatrixT
const* m_parent = nullptr ;
79 BackEnd::Memory::eType m_memory = BackEnd::Memory::Host ;
80 std::size_t m_nrows = 0 ;
81 std::size_t m_nnz = 0 ;
82 IndexType* m_rows = nullptr ;
83 IndexType* m_ncols = nullptr ;
84 IndexType* m_cols = nullptr ;
85 ValueType* m_values = nullptr ;
92 using IndexType =
typename VectorT::IndexType ;
93 using ValueType =
typename VectorT::ValueType ;
94 HVectorViewT(VectorT
const* parent,
95 BackEnd::Memory::eType memory,
103 case BackEnd::Memory::Device :
105 if constexpr (
requires{m_parent->allocateDevicePointers(nrows,&m_values);})
107 m_parent->allocateDevicePointers(nrows,&m_values);
110 throw Arccore::FatalErrorException(A_FUNCINFO,
"Vector Type doest not support allocateDevicePointers");
113 case BackEnd::Memory::Host :
116 if constexpr (
requires{m_parent->allocateHostPointers(nrows,&m_values);})
118 m_parent->allocateHostPointers(nrows,&m_values);
121 throw Arccore::FatalErrorException(A_FUNCINFO,
"Vector Type doest not support allocateHostPointers");
127 virtual ~HVectorViewT()
131 case BackEnd::Memory::Device :
133 if constexpr (
requires{m_parent->freeDevicePointers(m_values);})
135 m_parent->freeDevicePointers(m_values);
139 case BackEnd::Memory::Host :
142 if constexpr (
requires{m_parent->freeHostPointers(m_values);})
144 m_parent->freeHostPointers(m_nrows,m_values);
151 VectorT
const* m_parent = nullptr ;
152 BackEnd::Memory::eType m_memory = BackEnd::Memory::Host ;
153 std::size_t m_nrows = 0 ;
154 ValueType* m_values = nullptr ;