You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It does this by setting the first of those defaulted parameters to false when it wants to use the native version.
This is consistent with other spec structs, e.g. SPMV_BSRMATRIX, where tpl_spec_available is the first defaulted parameter. However SPMV_BSR_MATRIX has integerScalarType as the first parameter, so really that logic is not selecting the non-TPL implementation, but the non-integer implementation here:
true and false instead of KOKKOSKERNELS_IMPL_COMPILE_LIBRARY
Now, the TPL selection logic actually discriminates using TPL availability, AND there TPL available is correctly indicated for SPMV_MV_BSRMATRIX for cuSparse, AND the TPL specialization actually exists properly for cuSparse. Prior to these changes the cuSparse code is compiled but always unreachable.
The text was updated successfully, but these errors were encountered:
The SPMV_MV_BSRMATRIX struct template has three defaulted parameters at the end:
integerScalarType
,tpl_spec_avail
, andeti_spec_avail
kokkos-kernels/src/sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp
Lines 143 to 162 in 10dfb89
In the SpMV interface, there is some logic that is intended to control whether to use the "native" KK implementation or a TPL:
kokkos-kernels/src/sparse/KokkosSparse_spmv.hpp
Lines 917 to 960 in 10dfb89
It does this by setting the first of those defaulted parameters to
false
when it wants to use the native version.This is consistent with other spec structs, e.g.
SPMV_BSRMATRIX
, where tpl_spec_available is the first defaulted parameter. However SPMV_BSR_MATRIX has integerScalarType as the first parameter, so really that logic is not selecting the non-TPL implementation, but the non-integer implementation here:kokkos-kernels/src/sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp
Line 197 in 10dfb89
The logic to select the TPL or not, needs to be changed to something like this:
(note the inclusion of
std::is_integral
for the appropriate template parameter)Furthermore, the CUSPARSE TPL is only marked as available when integerScalarType is true:
kokkos-kernels/src/impl/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_avail.hpp
Line 208 in 10dfb89
This is entirely inconsistent with the actual implementation, which wants floats or doubles:
kokkos-kernels/src/impl/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp
Lines 604 to 647 in 10dfb89
So, the avail macro also needs to be changed:
note
false
at the end of the template params instead oftrue
, indicating the TPL is only available for non-integer scalar typesFurthermore, the multivector view types will be
const SCALAR **
andSCALAR **
, so actually the macro definition should be something likeFinally, the cuSparse specialization should exist for non-integer scalar types, instead of integer as defined here:
kokkos-kernels/src/impl/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_decl.hpp
Line 761 in 10dfb89
So it should be
note
false, true, COMPILE_LIBRARY
instead oftrue, true, COMPILE_LIBRARY
Also need to change KokkosSparse_spmv_bsrmatrix_spec.hpp eti avail macro to use cuSparse even if an ETI is available:
true
andfalse
instead of KOKKOSKERNELS_IMPL_COMPILE_LIBRARYNow, the TPL selection logic actually discriminates using TPL availability, AND there TPL available is correctly indicated for SPMV_MV_BSRMATRIX for cuSparse, AND the TPL specialization actually exists properly for cuSparse. Prior to these changes the cuSparse code is compiled but always unreachable.
The text was updated successfully, but these errors were encountered: