Commit 492da459 authored by rocking's avatar rocking
Browse files

Add static assert

parent 4af77e1f
...@@ -78,6 +78,9 @@ struct DeviceBinaryElementwise : public BaseOperator ...@@ -78,6 +78,9 @@ struct DeviceBinaryElementwise : public BaseOperator
index_t gridSize, index_t gridSize,
index_t threadPerBlock) index_t threadPerBlock)
{ {
static_assert(Dim == 1 || Dim == 2,
"wrong! DeviceBinaryElementwise not support this dimension");
if constexpr(Dim == 1) if constexpr(Dim == 1)
return MakeDescriptor_M0_1d(shape, stride, gridSize, threadPerBlock); return MakeDescriptor_M0_1d(shape, stride, gridSize, threadPerBlock);
else if constexpr(Dim == 2) else if constexpr(Dim == 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment