From 620357327ffd6e5595e70973e67395b9c42d2a2b Mon Sep 17 00:00:00 2001 From: Aleksander Fadeev Date: Mon, 25 May 2020 14:54:35 +0300 Subject: [PATCH 1/5] RUN fix and parentheses fix Signed-off-by: Aleksander Fadeev --- sycl/include/CL/sycl/types.hpp | 16 ++++++++-------- sycl/test/warnings/warnings.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sycl/include/CL/sycl/types.hpp b/sycl/include/CL/sycl/types.hpp index 27e639d8ad97d..797fece9226a5 100644 --- a/sycl/include/CL/sycl/types.hpp +++ b/sycl/include/CL/sycl/types.hpp @@ -330,8 +330,8 @@ convertImpl(T Value) { detail::enable_if_t::value && \ !std::is_same::value && \ (std::is_same::value || \ - std::is_same::value && \ - std::is_same::value), \ + (std::is_same::value && \ + std::is_same::value)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -382,8 +382,8 @@ convertImpl(T Value) { typename OpenCLT, typename OpenCLR> \ detail::enable_if_t::value && \ (std::is_same::value || \ - std::is_same::value && \ - std::is_same::value), \ + (std::is_same::value && \ + std::is_same::value)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -402,8 +402,8 @@ __SYCL_GENERATE_CONVERT_IMPL(SToF, double) typename OpenCLT, typename OpenCLR> \ detail::enable_if_t::value && \ (std::is_same::value || \ - std::is_same::value && \ - std::is_same::value), \ + (std::is_same::value && \ + std::is_same::value)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -424,8 +424,8 @@ __SYCL_GENERATE_CONVERT_IMPL(UToF, double) detail::enable_if_t::value && \ !std::is_same::value && \ (std::is_same::value || \ - std::is_same::value && \ - std::is_same::value) && \ + (std::is_same::value && \ + std::is_same::value)) && \ RoundingModeCondition::value, \ R> \ convertImpl(T Value) { \ diff --git a/sycl/test/warnings/warnings.cpp b/sycl/test/warnings/warnings.cpp index 1d81132aa3edf..cc3d3303ab55f 100644 --- a/sycl/test/warnings/warnings.cpp +++ b/sycl/test/warnings/warnings.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl --no-system-header-prefix=CL/ -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out +// RUN: %clangxx -fsycl --no-system-header-prefix=CL/ -c -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out #include From 75ca18baffff7094d85502e815d9ba1acf645873 Mon Sep 17 00:00:00 2001 From: Aleksander Fadeev Date: Mon, 25 May 2020 16:12:17 +0300 Subject: [PATCH 2/5] [SYCL] vec_convert_warnings add Signed-off-by: Aleksander Fadeev --- sycl/test/warnings/vec_convert_warnings.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 sycl/test/warnings/vec_convert_warnings.cpp diff --git a/sycl/test/warnings/vec_convert_warnings.cpp b/sycl/test/warnings/vec_convert_warnings.cpp new file mode 100644 index 0000000000000..356b60c9a7188 --- /dev/null +++ b/sycl/test/warnings/vec_convert_warnings.cpp @@ -0,0 +1,18 @@ +// RUN: %clangxx -fsycl --no-system-header-prefix=CL/ -c -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out + +#include +#include + +using namespace cl::sycl; +int main() { + vec newVec; + queue myQueue; + buffer, 1> resultBuf {&newVec, range<1> {1}}; + myQueue.submit([&](handler& cgh) { + auto writeResult = resultBuf.get_access(cgh); + cgh.single_task([=]() { + writeResult[0] = (vec{1, 2, 3, 4}).template convert(); + }); + }); +} + \ No newline at end of file From c9bb0f901bccf66bfaa9eedaab9abb303a56bb5f Mon Sep 17 00:00:00 2001 From: Aleksander Fadeev Date: Tue, 26 May 2020 11:22:49 +0300 Subject: [PATCH 3/5] fix RUN for warnings and vec_convert_warnings Signed-off-by: Aleksander Fadeev --- sycl/test/warnings/vec_convert_warnings.cpp | 2 +- sycl/test/warnings/warnings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/test/warnings/vec_convert_warnings.cpp b/sycl/test/warnings/vec_convert_warnings.cpp index 356b60c9a7188..eb6f461b62380 100644 --- a/sycl/test/warnings/vec_convert_warnings.cpp +++ b/sycl/test/warnings/vec_convert_warnings.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl --no-system-header-prefix=CL/ -c -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out +// RUN: %clangxx -fsycl --no-system-header-prefix=CL/sycl -fsyntax-only -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out #include #include diff --git a/sycl/test/warnings/warnings.cpp b/sycl/test/warnings/warnings.cpp index cc3d3303ab55f..1173676ac3c75 100644 --- a/sycl/test/warnings/warnings.cpp +++ b/sycl/test/warnings/warnings.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl --no-system-header-prefix=CL/ -c -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out +// RUN: %clangxx -fsycl --no-system-header-prefix=CL/sycl -fsyntax-only -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out #include From 4ceafd0f9534eb68ec20e64f3c921b086a374c97 Mon Sep 17 00:00:00 2001 From: Aleksander Fadeev Date: Tue, 26 May 2020 14:02:07 +0300 Subject: [PATCH 4/5] vec_warnings.cpp and warnings.cpp merge Signed-off-by: Aleksander Fadeev --- sycl/include/CL/sycl/types.hpp | 10 +++++----- sycl/test/warnings/vec_convert_warnings.cpp | 18 ------------------ sycl/test/warnings/warnings.cpp | 19 ++++++++----------- 3 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 sycl/test/warnings/vec_convert_warnings.cpp diff --git a/sycl/include/CL/sycl/types.hpp b/sycl/include/CL/sycl/types.hpp index 797fece9226a5..6765e73ca1251 100644 --- a/sycl/include/CL/sycl/types.hpp +++ b/sycl/include/CL/sycl/types.hpp @@ -331,7 +331,7 @@ convertImpl(T Value) { !std::is_same::value && \ (std::is_same::value || \ (std::is_same::value && \ - std::is_same::value)), \ + std::is_same::value)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -383,7 +383,7 @@ convertImpl(T Value) { detail::enable_if_t::value && \ (std::is_same::value || \ (std::is_same::value && \ - std::is_same::value)), \ + std::is_same::value)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -403,7 +403,7 @@ __SYCL_GENERATE_CONVERT_IMPL(SToF, double) detail::enable_if_t::value && \ (std::is_same::value || \ (std::is_same::value && \ - std::is_same::value)), \ + std::is_same::value)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -424,8 +424,8 @@ __SYCL_GENERATE_CONVERT_IMPL(UToF, double) detail::enable_if_t::value && \ !std::is_same::value && \ (std::is_same::value || \ - (std::is_same::value && \ - std::is_same::value)) && \ + (std::is_same::value && \ + std::is_same::value)) && \ RoundingModeCondition::value, \ R> \ convertImpl(T Value) { \ diff --git a/sycl/test/warnings/vec_convert_warnings.cpp b/sycl/test/warnings/vec_convert_warnings.cpp deleted file mode 100644 index eb6f461b62380..0000000000000 --- a/sycl/test/warnings/vec_convert_warnings.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// RUN: %clangxx -fsycl --no-system-header-prefix=CL/sycl -fsyntax-only -Wall -Wextra -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Werror -Wno-unknown-cuda-version %s -o %t.out - -#include -#include - -using namespace cl::sycl; -int main() { - vec newVec; - queue myQueue; - buffer, 1> resultBuf {&newVec, range<1> {1}}; - myQueue.submit([&](handler& cgh) { - auto writeResult = resultBuf.get_access(cgh); - cgh.single_task([=]() { - writeResult[0] = (vec{1, 2, 3, 4}).template convert(); - }); - }); -} - \ No newline at end of file diff --git a/sycl/test/warnings/warnings.cpp b/sycl/test/warnings/warnings.cpp index 1173676ac3c75..00eaf62707269 100644 --- a/sycl/test/warnings/warnings.cpp +++ b/sycl/test/warnings/warnings.cpp @@ -3,18 +3,15 @@ #include using namespace cl::sycl; - -int main(void) { - // add a very simple kernel to see if compilation succeeds with -Werror - int data1[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; - buffer B(data1, range<1>(10), {property::buffer::use_host_ptr()}); - queue Q; - Q.submit([&](handler &CGH) { - auto Accessor = B.get_access(CGH); - CGH.parallel_for(range<1>{10}, [=](id<1> Item) { - Accessor[Item] = 0; +int main() { + vec newVec; + queue myQueue; + buffer, 1> resultBuf {&newVec, range<1> {1}}; + myQueue.submit([&](handler& cgh) { + auto writeResult = resultBuf.get_access(cgh); + cgh.single_task([=]() { + writeResult[0] = (vec{1, 2, 3, 4}).template convert(); }); }); - return 0; } From e84fd2030c2e542edba4c6fb8f9a0431c221ecf6 Mon Sep 17 00:00:00 2001 From: Aleksander Fadeev Date: Tue, 26 May 2020 15:42:03 +0300 Subject: [PATCH 5/5] Formatting Signed-off-by: Aleksander Fadeev --- sycl/test/warnings/warnings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/test/warnings/warnings.cpp b/sycl/test/warnings/warnings.cpp index 00eaf62707269..97ca4877f5a00 100644 --- a/sycl/test/warnings/warnings.cpp +++ b/sycl/test/warnings/warnings.cpp @@ -6,8 +6,8 @@ using namespace cl::sycl; int main() { vec newVec; queue myQueue; - buffer, 1> resultBuf {&newVec, range<1> {1}}; - myQueue.submit([&](handler& cgh) { + buffer, 1> resultBuf{&newVec, range<1>{1}}; + myQueue.submit([&](handler &cgh) { auto writeResult = resultBuf.get_access(cgh); cgh.single_task([=]() { writeResult[0] = (vec{1, 2, 3, 4}).template convert();