Opm::cuistl::detail::CuSparseResource< T > Class Template Reference The CuSparseResource class wraps a CuSparse resource in a proper RAII pattern. More...
Inheritance diagram for Opm::cuistl::detail::CuSparseResource< T >:
Detailed Descriptiontemplate<class T> class Opm::cuistl::detail::CuSparseResource< T > The CuSparseResource class wraps a CuSparse resource in a proper RAII pattern. Current we support the following types for T:
More types are in principle supported by supplying a manual Creator and Destructor. In addition to acting as an easier-to-use smart_ptr specialized for these types, it also adds error checking in the construction and deletion of these resources, which a plain std::smart_ptr would not support out of the box. It also solves the caveat of the pointer types of cuSparse resources not being exposed properly. Example usage: #include <opm/simulator/linalg/cuistl/detail/CuSparseResource.hpp>
void someFunction() {
auto resource = CuSparseResource<cuSparseMatDescr_t>();
}
The CuSparseResource class wraps a CuSparse resource in a proper RAII pattern. Definition: CuSparseResource.hpp:55 Member Typedef Documentation◆ CreatorType
template<class T >
◆ DeleterType
template<class T >
Constructor & Destructor Documentation◆ CuSparseResource() [1/3]
template<class T >
CuSparseResource creates a new instance by calling creator, and will delete using deleter.
References OPM_CUSPARSE_SAFE_CALL. ◆ CuSparseResource() [2/3]
template<class T >
CuSparseResource will automatically select the proper creator and deleter based on the type (and throw an exception if not available) ◆ ~CuSparseResource()
template<class T >
Calls the deleter functor References OPM_CUSPARSE_WARN_IF_ERROR. ◆ CuSparseResource() [3/3]
template<class T >
Member Function Documentation◆ get()
template<class T >
get returns the raw pointer to the resource. ◆ operator=()
template<class T >
The documentation for this class was generated from the following files: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||