Skip to content

Commit

Permalink
Merge pull request #1311 from masterleinad/more_printf
Browse files Browse the repository at this point in the history
Use the SYCL workaround for printf in a couple more places
  • Loading branch information
lucbv authored Feb 10, 2022
2 parents 9fea83c + 225d8a6 commit 771c45c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
24 changes: 12 additions & 12 deletions src/batched/dense/impl/KokkosBatched_Dot_Internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ struct SerialDot<Trans::Transpose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(1) != dot.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Second dimension of X and alpha do not match: "
"X: "
"%d x %d, dot: %d\n",
Expand Down Expand Up @@ -215,15 +215,15 @@ struct SerialDot<Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != dot.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: First dimension of X and alpha do not match: X: "
"%d x %d, dot: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)dot.extent(0));
Expand Down Expand Up @@ -264,15 +264,15 @@ struct TeamDot<MemberType, Trans::Transpose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(1) != dot.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Second dimension of X and alpha do not match: "
"X: "
"%d x %d, dot: %d\n",
Expand Down Expand Up @@ -311,15 +311,15 @@ struct TeamDot<MemberType, Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != dot.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: First dimension of X and alpha do not match: X: "
"%d x %d, dot: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)dot.extent(0));
Expand Down Expand Up @@ -360,15 +360,15 @@ struct TeamVectorDot<MemberType, Trans::Transpose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(1) != dot.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Second dimension of X and alpha do not match: "
"X: "
"%d x %d, dot: %d\n",
Expand Down Expand Up @@ -407,15 +407,15 @@ struct TeamVectorDot<MemberType, Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != dot.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::dot: First dimension of X and alpha do not match: X: "
"%d x %d, dot: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)dot.extent(0));
Expand Down
12 changes: 6 additions & 6 deletions src/batched/dense/impl/KokkosBatched_HadamardProduct_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ KOKKOS_INLINE_FUNCTION int SerialHadamardProduct::invoke(const XViewType& X,

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::HadamardProduct: Dimensions of X and Y do not match: "
"X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != V.extent(0) || X.extent(1) != V.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::HadamardProduct: Dimensions of X and V do not match: "
"X: %d x %d, "
"V: %d x %d\n",
Expand Down Expand Up @@ -187,15 +187,15 @@ KOKKOS_INLINE_FUNCTION int TeamHadamardProduct<MemberType>::invoke(

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::HadamardProduct: Dimensions of X and Y do not match: "
"X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != V.extent(0) || X.extent(1) != V.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::HadamardProduct: Dimensions of X and V do not match: "
"X: %d x %d, "
"V: %d x %d\n",
Expand Down Expand Up @@ -240,15 +240,15 @@ KOKKOS_INLINE_FUNCTION int TeamVectorHadamardProduct<MemberType>::invoke(

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::HadamardProduct: Dimensions of X and Y do not match: "
"X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != V.extent(0) || X.extent(1) != V.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::HadamardProduct: Dimensions of X and V do not match: "
"X: %d x %d, "
"V: %d x %d\n",
Expand Down
12 changes: 6 additions & 6 deletions src/batched/dense/impl/KokkosBatched_Xpay_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ KOKKOS_INLINE_FUNCTION int SerialXpay::invoke(const alphaViewType& alpha,

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::xpay: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::xpay: First dimension of X and alpha do not match: X: "
"%d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
Expand Down Expand Up @@ -273,14 +273,14 @@ KOKKOS_INLINE_FUNCTION int TeamXpay<MemberType>::invoke(

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::xpay: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::xpay: First dimension of X and alpha do not match: X: "
"%d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
Expand Down Expand Up @@ -317,14 +317,14 @@ KOKKOS_INLINE_FUNCTION int TeamVectorXpay<MemberType>::invoke(

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::xpay: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::xpay: First dimension of X and alpha do not match: X: "
"%d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
Expand Down
8 changes: 4 additions & 4 deletions src/batched/sparse/impl/KokkosBatched_Spmv_Serial_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,23 @@ struct SerialSpmv<Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimensions of X and Y do not match: X: %d x "
"%d, Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != values.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: First dimension of X and the first dimension "
"of values do not match: X: %d x %d, values: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)values.extent(0),
(int)values.extent(1));
return 1;
}
if (colIndices.extent(0) != values.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimension of colIndices and the second "
"dimension of values do not match: colIndices: %d , values: %d x "
"%d\n",
Expand All @@ -294,7 +294,7 @@ struct SerialSpmv<Trans::NoTranspose> {
return 1;
}
if (row_ptr.extent(0) - 1 != X.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimension of row_ptr and the second dimension "
"of X do not match: colIndices (-1): %d , values: %d x %d\n",
(int)row_ptr.extent(0) - 1, (int)X.extent(0), (int)X.extent(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,23 +312,23 @@ struct TeamVectorSpmv<MemberType, Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimensions of X and Y do not match: X: %d x "
"%d, Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != values.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: First dimension of X and the first dimension "
"of values do not match: X: %d x %d, values: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)values.extent(0),
(int)values.extent(1));
return 1;
}
if (colIndices.extent(0) != values.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimension of colIndices and the second "
"dimension of values do not match: colIndices: %d , values: %d x "
"%d\n",
Expand All @@ -337,7 +337,7 @@ struct TeamVectorSpmv<MemberType, Trans::NoTranspose> {
return 1;
}
if (row_ptr.extent(0) - 1 != X.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimension of row_ptr and the second dimension "
"of X do not match: colIndices (-1): %d , values: %d x %d\n",
(int)row_ptr.extent(0) - 1, (int)X.extent(0), (int)X.extent(1));
Expand Down
8 changes: 4 additions & 4 deletions src/batched/sparse/impl/KokkosBatched_Spmv_Team_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,23 @@ struct TeamSpmv<MemberType, Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimensions of X and Y do not match: X: %d x "
"%d, Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != values.extent(0)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: First dimension of X and the first dimension "
"of values do not match: X: %d x %d, values: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)values.extent(0),
(int)values.extent(1));
return 1;
}
if (colIndices.extent(0) != values.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimension of colIndices and the second "
"dimension of values do not match: colIndices: %d , values: %d x "
"%d\n",
Expand All @@ -333,7 +333,7 @@ struct TeamSpmv<MemberType, Trans::NoTranspose> {
return 1;
}
if (row_ptr.extent(0) - 1 != X.extent(1)) {
printf(
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
"KokkosBatched::spmv: Dimension of row_ptr and the second dimension "
"of X do not match: colIndices (-1): %d , values: %d x %d\n",
(int)row_ptr.extent(0) - 1, (int)X.extent(0), (int)X.extent(1));
Expand Down

0 comments on commit 771c45c

Please sign in to comment.