diff --git a/unsupported/test/cxx11_tensor_executor.cpp b/unsupported/test/cxx11_tensor_executor.cpp index 309ddeb1b..55d031988 100644 --- a/unsupported/test/cxx11_tensor_executor.cpp +++ b/unsupported/test/cxx11_tensor_executor.cpp @@ -136,7 +136,8 @@ void test_execute_broadcasting(Device d) { template struct test_execute_chipping_rvalue_runner { template - static void run_dim(Device& d, const array& dims, const Tensor& src) { + static std::enable_if_t<0 <= ChipDim, void> + run_dim(Device& d, const array& dims, const Tensor& src) { const auto offset = internal::random(0, dims[(ChipDim)] - 1); const auto expr = src.template chip(offset); @@ -158,8 +159,9 @@ struct test_execute_chipping_rvalue_runner { run_dim(d, dims, src); } - template <> - void run_dim<-1>(Device&, const array&, const Tensor&) {} + template + static std::enable_if_t + run_dim(Device&, const array&, const Tensor&) {} static void run(Device d) { auto dims = RandomDims(1, 10); @@ -177,7 +179,8 @@ void test_execute_chipping_rvalue(Device d) { template struct test_execute_chipping_lvalue_runner { template - static void run_dim(Device& d, const array& dims) { + static std::enable_if_t<0 <= ChipDim> + run_dim(Device& d, const array& dims) { /* Generate random data that we'll assign to the chipped tensor dim. */ array src_dims; for (int i = 0; i < NumDims - 1; ++i) { @@ -213,8 +216,8 @@ struct test_execute_chipping_lvalue_runner { run_dim(d, dims); } - template <> - void run_dim<-1>(Device&, const array&) {} + template + static std::enable_if_t run_dim(Device&, const array&) {} static void run(Device d) { auto dims = RandomDims(1, 10);