Skip to content

Commit 925a0b5

Browse files
authored
modify constexpr fall-through return into else (#888)
1 parent 7172584 commit 925a0b5

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

include/matx/transforms/convert/dense2sparse_cusparse.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,11 @@ using dense2sparse_cache_t =
250250
template <typename Op>
251251
__MATX_INLINE__ auto getD2SSupportedTensor(const Op &in, cudaStream_t stream) {
252252
const auto func = [&]() {
253-
if constexpr (is_tensor_view_v<Op>)
253+
if constexpr (is_tensor_view_v<Op>) {
254254
return in.Stride(Op::Rank() - 1) == 1;
255-
return true;
255+
} else {
256+
return true;
257+
}
256258
};
257259
return GetSupportedTensor(in, func, MATX_ASYNC_DEVICE_MEMORY, stream);
258260
}

include/matx/transforms/convert/sparse2dense_cusparse.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,11 @@ using sparse2dense_cache_t =
210210
template <typename Op>
211211
__MATX_INLINE__ auto getS2DSupportedTensor(const Op &in, cudaStream_t stream) {
212212
const auto func = [&]() {
213-
if constexpr (is_tensor_view_v<Op>)
213+
if constexpr (is_tensor_view_v<Op>) {
214214
return in.Stride(Op::Rank() - 1) == 1;
215-
return true;
215+
} else {
216+
return true;
217+
}
216218
};
217219
return GetSupportedTensor(in, func, MATX_ASYNC_DEVICE_MEMORY, stream);
218220
}

include/matx/transforms/matmul/matmul_cusparse.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,11 @@ template <typename Op>
259259
__MATX_INLINE__ auto getCuSparseSupportedTensor(const Op &in,
260260
cudaStream_t stream) {
261261
const auto func = [&]() {
262-
if constexpr (is_tensor_view_v<Op>)
262+
if constexpr (is_tensor_view_v<Op>) {
263263
return in.Stride(Op::Rank() - 1) == 1;
264-
return true;
264+
} else {
265+
return true;
266+
}
265267
};
266268
return GetSupportedTensor(in, func, MATX_ASYNC_DEVICE_MEMORY, stream);
267269
}

0 commit comments

Comments
 (0)