3#include <cusparse_v2.h>
4#include <muda/type_traits/always.h>
8inline constexpr cudaDataType_t cuda_data_type()
10 if constexpr(std::is_same_v<T, float>)
14 else if constexpr(std::is_same_v<T, double>)
18 else if constexpr(std::is_same_v<T, cuComplex>)
22 else if constexpr(std::is_same_v<T, cuDoubleComplex>)
28 static_assert(always_false_v<T>,
"not supported type");
32constexpr cublasOperation_t cublas_trans_operation(
bool b)
34 return b ? CUBLAS_OP_T : CUBLAS_OP_N;
38constexpr cusparseIndexType_t cusparse_index_type()
40 if constexpr(std::is_same_v<T, int>)
41 return cusparseIndexType_t::CUSPARSE_INDEX_32I;
42 else if constexpr(std::is_same_v<T, int64_t>)
43 return cusparseIndexType_t::CUSPARSE_INDEX_64I;
44 else if constexpr(std::is_same_v<T, uint16_t>)
45 return cusparseIndexType_t::CUSPARSE_INDEX_16U;
47 static_assert(always_false_v<T>,
"Unsupported type");