Skip to content

Commit 581e8bd

Browse files
Add static assert
1 parent 4a22407 commit 581e8bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/vec_size_util.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ template <typename T, typename... Rest> struct VecSize
4545

4646
template <typename T> struct VecSize<T>
4747
{
48+
static_assert(sizeof(T) > 0, "Vacuous types are not supported");
49+
4850
static constexpr unsigned int value =
4951
1 + ((sizeof(std::uint32_t) - 1) / (sizeof(T)));
5052
};

0 commit comments

Comments
 (0)