diff --git a/src/sparse/KokkosSparse_spmv.hpp b/src/sparse/KokkosSparse_spmv.hpp index ef2545a79d..7cf020e309 100644 --- a/src/sparse/KokkosSparse_spmv.hpp +++ b/src/sparse/KokkosSparse_spmv.hpp @@ -753,8 +753,17 @@ void spmv(KokkosKernels::Experimental::Controls controls, const char mode[], XVector_Internal x_i = x; YVector_Internal y_i = y; - // use native version if conjugate (cusparseSpMM does not support) - if (Conjugate[0] == mode[0]) { + bool useNative = false; + +// cusparseSpMM does not support conjugate mode +#ifdef KOKKOSKERNELS_ENABLE_TPL_CUSPARSE + useNative = useNative || (Conjugate[0] == mode[0]); +#endif + useNative = + useNative || controls.isParameter("algorithm") && + (controls.getParameter("algorithm") == "native"); + + if (useNative) { return Impl::SPMV_MV< typename AMatrix_Internal::value_type, typename AMatrix_Internal::ordinal_type,