Skip to content

Commit

Permalink
Fixed inlining: don't comile exception throwing MKL wrappers for GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Zuzek committed Jan 5, 2022
1 parent c747fdb commit 7b2b1bf
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/sparse/impl/KokkosSparse_spgemm_mkl_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace Impl {

#ifdef KOKKOSKERNELS_ENABLE_TPL_MKL

KOKKOS_INLINE_FUNCTION
inline
void mkl_call(sparse_status_t result, const char *err_msg) {
if (SPARSE_STATUS_SUCCESS != result) {
throw std::runtime_error(err_msg);
Expand All @@ -66,11 +66,11 @@ class MKLSparseMatrix {
sparse_matrix_t mtx;

public:
KOKKOS_INLINE_FUNCTION
inline
MKLSparseMatrix(const MKL_INT m, const MKL_INT n, MKL_INT *xadj, MKL_INT *adj,
value_type *values);

KOKKOS_INLINE_FUNCTION
inline
static MKLSparseMatrix<value_type> spmm(
sparse_operation_t operation, const MKLSparseMatrix<value_type> &A,
const MKLSparseMatrix<value_type> &B) {
Expand All @@ -80,22 +80,22 @@ class MKLSparseMatrix {
return MKLSparseMatrix<value_type>(c);
}

KOKKOS_INLINE_FUNCTION
inline
void get(MKL_INT &rows, MKL_INT &cols, MKL_INT *&rows_start,
MKL_INT *&columns, value_type *&values);

KOKKOS_INLINE_FUNCTION
inline
void destroy() {
mkl_call(mkl_sparse_destroy(mtx), "mkl_sparse_destroy() failed!");
}

private:
KOKKOS_INLINE_FUNCTION
inline
MKLSparseMatrix(sparse_matrix_t mtx_) : mtx(mtx_) {}
};

template <>
KOKKOS_INLINE_FUNCTION MKLSparseMatrix<float>::MKLSparseMatrix(
inline MKLSparseMatrix<float>::MKLSparseMatrix(
const MKL_INT rows, const MKL_INT cols, MKL_INT *xadj, MKL_INT *adj,
float *values) {
mkl_call(mkl_sparse_s_create_csr(&mtx, SPARSE_INDEX_BASE_ZERO, rows, cols,
Expand All @@ -104,7 +104,7 @@ KOKKOS_INLINE_FUNCTION MKLSparseMatrix<float>::MKLSparseMatrix(
}

template <>
KOKKOS_INLINE_FUNCTION MKLSparseMatrix<double>::MKLSparseMatrix(
inline MKLSparseMatrix<double>::MKLSparseMatrix(
const MKL_INT rows, const MKL_INT cols, MKL_INT *xadj, MKL_INT *adj,
double *values) {
mkl_call(mkl_sparse_d_create_csr(&mtx, SPARSE_INDEX_BASE_ZERO, rows, cols,
Expand All @@ -113,7 +113,7 @@ KOKKOS_INLINE_FUNCTION MKLSparseMatrix<double>::MKLSparseMatrix(
}

template <>
KOKKOS_INLINE_FUNCTION void MKLSparseMatrix<float>::get(MKL_INT &rows,
inline void MKLSparseMatrix<float>::get(MKL_INT &rows,
MKL_INT &cols,
MKL_INT *&rows_start,
MKL_INT *&columns,
Expand All @@ -131,7 +131,7 @@ KOKKOS_INLINE_FUNCTION void MKLSparseMatrix<float>::get(MKL_INT &rows,
}

template <>
KOKKOS_INLINE_FUNCTION void MKLSparseMatrix<double>::get(MKL_INT &rows,
inline void MKLSparseMatrix<double>::get(MKL_INT &rows,
MKL_INT &cols,
MKL_INT *&rows_start,
MKL_INT *&columns,
Expand Down Expand Up @@ -326,7 +326,7 @@ class MKLApply {
}

template <typename from_type, typename to_type>
KOKKOS_INLINE_FUNCTION static void copy(size_t num_elems, from_type from,
inline static void copy(size_t num_elems, from_type from,
to_type to) {
KokkosKernels::Impl::copy_vector<from_type, to_type, MyExecSpace>(num_elems,
from, to);
Expand Down

0 comments on commit 7b2b1bf

Please sign in to comment.