diff --git a/sycl/include/CL/sycl/types.hpp b/sycl/include/CL/sycl/types.hpp index 27e639d8ad97d..6765e73ca1251 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..97ca4877f5a00 100644 --- a/sycl/test/warnings/warnings.cpp +++ b/sycl/test/warnings/warnings.cpp @@ -1,20 +1,17 @@ -// 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/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 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; }