Add static assert

This commit is contained in:
rocking
2022-05-17 20:53:45 +08:00
parent 4af77e1f0e
commit 492da45969

View File

@@ -78,6 +78,9 @@ struct DeviceBinaryElementwise : public BaseOperator
index_t gridSize,
index_t threadPerBlock)
{
static_assert(Dim == 1 || Dim == 2,
"wrong! DeviceBinaryElementwise not support this dimension");
if constexpr(Dim == 1)
return MakeDescriptor_M0_1d(shape, stride, gridSize, threadPerBlock);
else if constexpr(Dim == 2)