Skip to content

Commit 957502c

Browse files
committed
Fix one more warning and improve warnings LIT test
1 parent a82ea1c commit 957502c

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

sycl/include/CL/sycl/types.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ __SYCL_GENERATE_CONVERT_IMPL_FOR_ROUNDING_MODE(rtn, Rtn)
454454
typename OpenCLT, typename OpenCLR> \
455455
detail::enable_if_t<is_float_to_int<T, R>::value && \
456456
(std::is_same<OpenCLR, cl_##DestType>::value || \
457-
std::is_same<OpenCLR, signed char>::value && \
458-
std::is_same<DestType, char>::value) && \
457+
(std::is_same<OpenCLR, signed char>::value && \
458+
std::is_same<DestType, char>::value)) && \
459459
RoundingModeCondition<roundingMode>::value, \
460460
R> \
461461
convertImpl(T Value) { \

sycl/test/warnings/warnings.cpp

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
11
// 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
2-
2+
// RUN: %clangxx -fsycl -E --no-system-header-prefix=CL/sycl %s -o %t.ii
3+
// 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
34
#include <CL/sycl.hpp>
45

56
using namespace cl::sycl;
67
int main() {
78
vec<long, 4> newVec;
89
queue myQueue;
910
buffer<vec<long, 4>, 1> resultBuf{&newVec, range<1>{1}};
10-
myQueue.submit([&](handler &cgh) {
11+
auto event = myQueue.submit([&](handler &cgh) {
1112
auto writeResult = resultBuf.get_access<access::mode::write>(cgh);
1213
cgh.single_task<class kernel_name>([=]() {
1314
writeResult[0] = (vec<int, 4>{1, 2, 3, 4}).template convert<long>();
1415
});
1516
});
17+
(void)event;
1618
return 0;
1719
}
20+
21+
// explicitly instantiate a few more classes to check if there are some issues
22+
// with them:
23+
24+
namespace sycl {
25+
26+
template class buffer<vec<int, 3>, 2>;
27+
28+
template class accessor<int, 1>;
29+
template class accessor<vec<float, 2>, 2, access_mode::read>;
30+
31+
template class marray<double, 7>;
32+
template class marray<short, 3>;
33+
34+
template class kernel_bundle<bundle_state::input>;
35+
template class kernel_bundle<bundle_state::objectj>;
36+
template class kernel_bundle<bundle_state::executable>;
37+
38+
template class device_image<bundle_state::input>;
39+
template class device_image<bundle_state::objectj>;
40+
template class device_image<bundle_state::executable>;
41+
42+
}

0 commit comments

Comments
 (0)