diff --git a/sycl/include/CL/sycl/sycl_span.hpp b/sycl/include/CL/sycl/sycl_span.hpp index 1b5658372095d..1c7898dd1e44a 100644 --- a/sycl/include/CL/sycl/sycl_span.hpp +++ b/sycl/include/CL/sycl/sycl_span.hpp @@ -146,7 +146,7 @@ using byte = unsigned char; #if defined(__SYCL_DEVICE_ONLY__) #define _SYCL_SPAN_ASSERT(x, m) ((void)0) #else -#define _SYCL_SPAN_ASSERT(x, m) assert((x && m)) +#define _SYCL_SPAN_ASSERT(x, m) assert(((x) && m)) #endif inline constexpr size_t dynamic_extent = SIZE_MAX; diff --git a/sycl/include/CL/sycl/types.hpp b/sycl/include/CL/sycl/types.hpp index 5b3944abb1cb6..0415580576114 100644 --- a/sycl/include/CL/sycl/types.hpp +++ b/sycl/include/CL/sycl/types.hpp @@ -454,8 +454,8 @@ __SYCL_GENERATE_CONVERT_IMPL_FOR_ROUNDING_MODE(rtn, Rtn) 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)) && \ RoundingModeCondition::value, \ R> \ convertImpl(T Value) { \ diff --git a/sycl/test/warnings/warnings.cpp b/sycl/test/warnings/warnings.cpp index 929e4132de68f..48b49d0a89dc5 100644 --- a/sycl/test/warnings/warnings.cpp +++ b/sycl/test/warnings/warnings.cpp @@ -1,5 +1,6 @@ -// 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 -Wno-unused-parameter %s -o %t.out - +// RUN: %clangxx -fsycl --no-system-header-prefix=CL/sycl -fsyntax-only -Wall -Wextra -Werror -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Wno-unknown-cuda-version -Wno-unused-parameter %s +// RUN: %clangxx -fsycl -E --no-system-header-prefix=CL/sycl %s -o %t.ii +// RUN: %clangxx -fsycl -fsyntax-only -Wall -Wextra -Werror -Wno-ignored-attributes -Wno-deprecated-declarations -Wpessimizing-move -Wunused-variable -Wmismatched-tags -Wunneeded-internal-declaration -Wno-unknown-cuda-version -Wno-unused-parameter %t.ii #include using namespace cl::sycl; @@ -7,11 +8,35 @@ int main() { vec newVec; queue myQueue; buffer, 1> resultBuf{&newVec, range<1>{1}}; - myQueue.submit([&](handler &cgh) { + auto event = myQueue.submit([&](handler &cgh) { auto writeResult = resultBuf.get_access(cgh); cgh.single_task([=]() { writeResult[0] = (vec{1, 2, 3, 4}).template convert(); }); }); + (void)event; return 0; } + +// explicitly instantiate a few more classes to check if there are some issues +// with them: + +namespace sycl { + +template class buffer, 2>; + +template class accessor; +template class accessor, 2, access_mode::read>; + +template class marray; +template class marray; + +template class kernel_bundle; +template class kernel_bundle; +template class kernel_bundle; + +template class device_image; +template class device_image; +template class device_image; + +}