Skip to content

Commit 9d1eee3

Browse files
committed
Update sparse_tensor_format.h (#886)
* Update sparse_tensor_format.h * Update type_utils.h
1 parent 479fa96 commit 9d1eee3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

include/matx/core/sparse_tensor_format.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ template <LvlOp o, int d, int c> class LvlExpr {
153153
return "d" + std::to_string(di) + " div " + std::to_string(cj);
154154
} else if constexpr (op == LvlOp::Mod) {
155155
return "d" + std::to_string(di) + " mod " + std::to_string(cj);
156-
}
156+
} else { // Should not happen
157+
return "";
158+
}
157159
}
158160
};
159161

@@ -179,7 +181,9 @@ template <typename Expr, LvlType ltype> class LvlSpec {
179181
return "compressed";
180182
} else if constexpr (ltype == LvlType::CompressedNonUnique) {
181183
return "compressed(non-unique)";
182-
}
184+
} else { // Should not happen
185+
return "";
186+
}
183187
}
184188
};
185189

include/matx/core/type_utils.h

+3
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,9 @@ constexpr cusparseIndexType_t MatXTypeToCuSparseIndexType() {
11821182
if constexpr (std::is_same_v<T, index_t>) {
11831183
return CUSPARSE_INDEX_64I;
11841184
}
1185+
else { // Should not happen
1186+
return CUSPARSE_INDEX_32I;
1187+
}
11851188
}
11861189

11871190
} // end namespace detail

0 commit comments

Comments
 (0)