diff --git a/cmake/toolchains/clang-werror.cmake b/cmake/toolchains/clang-werror.cmake index ce2f5bbe5..1d109b202 100644 --- a/cmake/toolchains/clang-werror.cmake +++ b/cmake/toolchains/clang-werror.cmake @@ -1,4 +1,4 @@ set(CMAKE_C_COMPILER clang) set(CMAKE_CXX_COMPILER clang++) -add_compile_options(-W -Wall -Werror -Wextra -Wno-gnu-string-literal-operator-template) \ No newline at end of file +add_compile_options(-W -Wall -Werror -Wextra -Wno-gnu-string-literal-operator-template -Wno-deprecated-declarations) \ No newline at end of file diff --git a/include/nmtools/array/eval/opencl/kernels/repeat.hpp b/include/nmtools/array/eval/opencl/kernels/repeat.hpp index 23a13f1e2..eae65a14a 100644 --- a/include/nmtools/array/eval/opencl/kernels/repeat.hpp +++ b/include/nmtools/array/eval/opencl/kernels/repeat.hpp @@ -37,9 +37,9 @@ kernel void nmtools_cl_kernel_name(out_type,inp_type) \ , const unsigned int axis \ ) \ { \ - auto repeats = na::create_vector(repeats_ptr,repeats_size); \ - auto input = na::create_array(inp_ptr,inp_shape_ptr,inp_dim); \ - auto output = na::create_mutable_array(out_ptr,out_shape_ptr,out_dim); \ + auto repeats = na::create_vector(repeats_ptr,repeats_size); \ + auto input = na::create_array(inp_ptr,inp_shape_ptr,inp_dim); \ + auto output = na::create_mutable_array(out_ptr,out_shape_ptr,out_dim); \ auto repeated = view::repeat(input,repeats,axis); \ opencl::assign_array(output,repeated); \ } diff --git a/tests/opencl/kernels/repeat.cpp b/tests/opencl/kernels/repeat.cpp index 633bdd56a..c2ad038d4 100644 --- a/tests/opencl/kernels/repeat.cpp +++ b/tests/opencl/kernels/repeat.cpp @@ -25,7 +25,7 @@ TEST_CASE("repeat(case1)" * doctest::test_suite("opencl::repeat")) { auto shape = nmtools_array{1,64}; auto input = na::reshape(na::arange(ix::product(shape)),shape); - auto repeats = nmtools_array{1,2}; + auto repeats = nmtools_array{2}; auto axis = 0; OPENCL_TEST(repeat,input,repeats,axis); } @@ -34,9 +34,27 @@ TEST_CASE("repeat(case2)" * doctest::test_suite("opencl::repeat")) { auto shape = nmtools_array{8,8}; auto input = na::reshape(na::arange(ix::product(shape)),shape); - auto repeats = nmtools_array{1,2}; + auto repeats = nmtools_array{2,1,1,1,1,1,1,1}; auto axis = 0; OPENCL_TEST(repeat,input,repeats,axis); } +TEST_CASE("repeat(case3)" * doctest::test_suite("opencl::repeat")) +{ + auto shape = nmtools_array{64,1}; + auto input = na::reshape(na::arange(ix::product(shape)),shape); + auto repeats = nmtools_array{3}; + auto axis = 1; + OPENCL_TEST(repeat,input,repeats,axis); +} + +TEST_CASE("repeat(case4)" * doctest::test_suite("opencl::repeat")) +{ + auto shape = nmtools_array{8,8}; + auto input = na::reshape(na::arange(ix::product(shape)),shape); + auto repeats = nmtools_array{1,2,3,4,1,1,1,1}; + auto axis = 1; + OPENCL_TEST(repeat,input,repeats,axis); +} + #endif // NMTOOLS_OPENCL_BUILD_KERNELS \ No newline at end of file