From 492da45969690306d5a4003339c23659ca54bf6d Mon Sep 17 00:00:00 2001 From: rocking Date: Tue, 17 May 2022 20:53:45 +0800 Subject: [PATCH] Add static assert --- .../tensor_operation/gpu/device/device_binary_elementwise.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/ck/tensor_operation/gpu/device/device_binary_elementwise.hpp b/include/ck/tensor_operation/gpu/device/device_binary_elementwise.hpp index bc3fe61dc4..2cbb3f2f24 100644 --- a/include/ck/tensor_operation/gpu/device/device_binary_elementwise.hpp +++ b/include/ck/tensor_operation/gpu/device/device_binary_elementwise.hpp @@ -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)