Skip to content

Commit

Permalink
Remove enable_if from template instantiations
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy committed Jun 13, 2024
1 parent 7190c6a commit d68155b
Showing 1 changed file with 36 additions and 44 deletions.
80 changes: 36 additions & 44 deletions src/sparse_blas/backends/mkl_common/mkl_handles.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ void set_dense_vector_data(sycl::queue & /*queue*/,
dvhandle->set_usm_ptr(val);
}

#define INSTANTIATE_DENSE_VECTOR_FUNCS(FP_TYPE, FP_SUFFIX) \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> init_dense_vector<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t * p_dvhandle, \
std::int64_t size, sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> init_dense_vector<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t * p_dvhandle, \
std::int64_t size, FP_TYPE *val); \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> set_dense_vector_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t dvhandle, \
std::int64_t size, sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> set_dense_vector_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t dvhandle, \
#define INSTANTIATE_DENSE_VECTOR_FUNCS(FP_TYPE, FP_SUFFIX) \
template void init_dense_vector<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t * p_dvhandle, \
std::int64_t size, sycl::buffer<FP_TYPE, 1> val); \
template void init_dense_vector<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t * p_dvhandle, \
std::int64_t size, FP_TYPE *val); \
template void set_dense_vector_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t dvhandle, \
std::int64_t size, sycl::buffer<FP_TYPE, 1> val); \
template void set_dense_vector_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_vector_handle_t dvhandle, \
std::int64_t size, FP_TYPE *val)
FOR_EACH_FP_TYPE(INSTANTIATE_DENSE_VECTOR_FUNCS);
#undef INSTANTIATE_DENSE_VECTOR_FUNCS
Expand Down Expand Up @@ -133,22 +133,22 @@ void set_dense_matrix_data(sycl::queue & /*queue*/,
dmhandle->set_usm_ptr(val);
}

#define INSTANTIATE_DENSE_MATRIX_FUNCS(FP_TYPE, FP_SUFFIX) \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> init_dense_matrix<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t * p_dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
oneapi::mkl::layout dense_layout, sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> init_dense_matrix<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t * p_dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
oneapi::mkl::layout dense_layout, FP_TYPE *val); \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> set_dense_matrix_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
oneapi::mkl::layout dense_layout, sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::is_fp_supported_v<FP_TYPE>> set_dense_matrix_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
#define INSTANTIATE_DENSE_MATRIX_FUNCS(FP_TYPE, FP_SUFFIX) \
template void init_dense_matrix<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t * p_dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
oneapi::mkl::layout dense_layout, sycl::buffer<FP_TYPE, 1> val); \
template void init_dense_matrix<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t * p_dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
oneapi::mkl::layout dense_layout, FP_TYPE *val); \
template void set_dense_matrix_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
oneapi::mkl::layout dense_layout, sycl::buffer<FP_TYPE, 1> val); \
template void set_dense_matrix_data<FP_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::dense_matrix_handle_t dmhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t ld, \
oneapi::mkl::layout dense_layout, FP_TYPE *val)
FOR_EACH_FP_TYPE(INSTANTIATE_DENSE_MATRIX_FUNCS);
#undef INSTANTIATE_DENSE_MATRIX_FUNCS
Expand Down Expand Up @@ -247,25 +247,21 @@ void set_coo_matrix_data(sycl::queue &queue, oneapi::mkl::sparse::matrix_handle_
}

#define INSTANTIATE_COO_MATRIX_FUNCS(FP_TYPE, FP_SUFFIX, INT_TYPE, INT_SUFFIX) \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
init_coo_matrix<FP_TYPE, INT_TYPE>( \
template void init_coo_matrix<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t * p_smhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t nnz, \
oneapi::mkl::index_base index, sycl::buffer<INT_TYPE, 1> row_ind, \
sycl::buffer<INT_TYPE, 1> col_ind, sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
init_coo_matrix<FP_TYPE, INT_TYPE>( \
template void init_coo_matrix<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t * p_smhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t nnz, \
oneapi::mkl::index_base index, INT_TYPE *row_ind, INT_TYPE *col_ind, FP_TYPE *val); \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
set_coo_matrix_data<FP_TYPE, INT_TYPE>( \
template void set_coo_matrix_data<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t smhandle, std::int64_t num_rows, \
std::int64_t num_cols, std::int64_t nnz, oneapi::mkl::index_base index, \
sycl::buffer<INT_TYPE, 1> row_ind, sycl::buffer<INT_TYPE, 1> col_ind, \
sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
set_coo_matrix_data<FP_TYPE, INT_TYPE>( \
template void set_coo_matrix_data<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t smhandle, std::int64_t num_rows, \
std::int64_t num_cols, std::int64_t nnz, oneapi::mkl::index_base index, INT_TYPE *row_ind, \
INT_TYPE *col_ind, FP_TYPE *val)
Expand Down Expand Up @@ -345,25 +341,21 @@ void set_csr_matrix_data(sycl::queue &queue, oneapi::mkl::sparse::matrix_handle_
}

#define INSTANTIATE_CSR_MATRIX_FUNCS(FP_TYPE, FP_SUFFIX, INT_TYPE, INT_SUFFIX) \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
init_csr_matrix<FP_TYPE, INT_TYPE>( \
template void init_csr_matrix<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t * p_smhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t nnz, \
oneapi::mkl::index_base index, sycl::buffer<INT_TYPE, 1> row_ptr, \
sycl::buffer<INT_TYPE, 1> col_ind, sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
init_csr_matrix<FP_TYPE, INT_TYPE>( \
template void init_csr_matrix<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t * p_smhandle, \
std::int64_t num_rows, std::int64_t num_cols, std::int64_t nnz, \
oneapi::mkl::index_base index, INT_TYPE *row_ptr, INT_TYPE *col_ind, FP_TYPE *val); \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
set_csr_matrix_data<FP_TYPE, INT_TYPE>( \
template void set_csr_matrix_data<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t smhandle, std::int64_t num_rows, \
std::int64_t num_cols, std::int64_t nnz, oneapi::mkl::index_base index, \
sycl::buffer<INT_TYPE, 1> row_ptr, sycl::buffer<INT_TYPE, 1> col_ind, \
sycl::buffer<FP_TYPE, 1> val); \
template std::enable_if_t<detail::are_fp_int_supported_v<FP_TYPE, INT_TYPE>> \
set_csr_matrix_data<FP_TYPE, INT_TYPE>( \
template void set_csr_matrix_data<FP_TYPE, INT_TYPE>( \
sycl::queue & queue, oneapi::mkl::sparse::matrix_handle_t smhandle, std::int64_t num_rows, \
std::int64_t num_cols, std::int64_t nnz, oneapi::mkl::index_base index, INT_TYPE *row_ptr, \
INT_TYPE *col_ind, FP_TYPE *val)
Expand Down

0 comments on commit d68155b

Please sign in to comment.