Skip to content

Commit

Permalink
Merge pull request #1456 from cwpearson/feature/spmvmv-crs-cusparse
Browse files Browse the repository at this point in the history
Removes a duplicate cuda_data_type_from when KOKKOS_HALF_T_IS_FLOAT
  • Loading branch information
lucbv authored Jul 5, 2022
2 parents aa1fb58 + b0e5c50 commit 1f559a5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sparse/KokkosSparse_Utils_cusparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ cudaDataType cuda_data_type_from() {
throw std::logic_error("unreachable throw after static_assert");
}

/* If half_t is not float, need to define a conversion for both
otherwise, conversion for half_t IS conversion for float
*/
#if defined(KOKKOS_HALF_T_IS_FLOAT) && !KOKKOS_HALF_T_IS_FLOAT
template <>
inline cudaDataType cuda_data_type_from<Kokkos::Experimental::half_t>() {
return CUDA_R_16F; // Kokkos half_t is a half
}
#else
template <>
inline cudaDataType cuda_data_type_from<Kokkos::Experimental::half_t>() {
return CUDA_R_32F; // Kokkos half_t is a float
}
#endif
// half_t is defined to be float, so this works for both half_t and float when
// half_t is float
template <>
inline cudaDataType cuda_data_type_from<float>() {
return CUDA_R_32F;
return CUDA_R_32F; // Kokkos half_t is a float
}
template <>
inline cudaDataType cuda_data_type_from<double>() {
Expand Down

0 comments on commit 1f559a5

Please sign in to comment.