Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/sycl_span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/CL/sycl/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ __SYCL_GENERATE_CONVERT_IMPL_FOR_ROUNDING_MODE(rtn, Rtn)
typename OpenCLT, typename OpenCLR> \
detail::enable_if_t<is_float_to_int<T, R>::value && \
(std::is_same<OpenCLR, cl_##DestType>::value || \
std::is_same<OpenCLR, signed char>::value && \
std::is_same<DestType, char>::value) && \
(std::is_same<OpenCLR, signed char>::value && \
std::is_same<DestType, char>::value)) && \
RoundingModeCondition<roundingMode>::value, \
R> \
convertImpl(T Value) { \
Expand Down
29 changes: 27 additions & 2 deletions sycl/test/warnings/warnings.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
// 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 -E --no-system-header-prefix=CL/sycl %s -o %t.ii
// RUN: %clangxx -fsycl -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 %t.ii -o %t.out
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I don't know why -Wno-unused-parameter was added here, but we can pass this test just fine without disabling that diagnostic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outlined this into #3980

#include <CL/sycl.hpp>

using namespace cl::sycl;
int main() {
vec<long, 4> newVec;
queue myQueue;
buffer<vec<long, 4>, 1> resultBuf{&newVec, range<1>{1}};
myQueue.submit([&](handler &cgh) {
auto event = myQueue.submit([&](handler &cgh) {
auto writeResult = resultBuf.get_access<access::mode::write>(cgh);
cgh.single_task<class kernel_name>([=]() {
writeResult[0] = (vec<int, 4>{1, 2, 3, 4}).template convert<long>();
});
});
(void)event;
return 0;
}

// explicitly instantiate a few more classes to check if there are some issues
// with them:

namespace sycl {

template class buffer<vec<int, 3>, 2>;

template class accessor<int, 1>;
template class accessor<vec<float, 2>, 2, access_mode::read>;

template class marray<double, 7>;
template class marray<short, 3>;

template class kernel_bundle<bundle_state::input>;
template class kernel_bundle<bundle_state::objectj>;
template class kernel_bundle<bundle_state::executable>;

template class device_image<bundle_state::input>;
template class device_image<bundle_state::objectj>;
template class device_image<bundle_state::executable>;

}