Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
16 changes: 8 additions & 8 deletions sycl/include/CL/sycl/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ convertImpl(T Value) {
detail::enable_if_t<is_sint_to_sint<T, R>::value && \
!std::is_same<OpenCLT, OpenCLR>::value && \
(std::is_same<OpenCLR, 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)), \
R> \
convertImpl(T Value) { \
OpenCLT OpValue = cl::sycl::detail::convertDataToType<T, OpenCLT>(Value); \
Expand Down Expand Up @@ -382,8 +382,8 @@ convertImpl(T Value) {
typename OpenCLT, typename OpenCLR> \
detail::enable_if_t<is_sint_to_float<T, R>::value && \
(std::is_same<OpenCLR, DestType>::value || \
std::is_same<OpenCLR, _Float16>::value && \
std::is_same<DestType, half>::value), \
(std::is_same<OpenCLR, _Float16>::value && \
std::is_same<DestType, half>::value)), \
R> \
convertImpl(T Value) { \
OpenCLT OpValue = cl::sycl::detail::convertDataToType<T, OpenCLT>(Value); \
Expand All @@ -402,8 +402,8 @@ __SYCL_GENERATE_CONVERT_IMPL(SToF, double)
typename OpenCLT, typename OpenCLR> \
detail::enable_if_t<is_uint_to_float<T, R>::value && \
(std::is_same<OpenCLR, DestType>::value || \
std::is_same<OpenCLR, _Float16>::value && \
std::is_same<DestType, half>::value), \
(std::is_same<OpenCLR, _Float16>::value && \
std::is_same<DestType, half>::value)), \
R> \
convertImpl(T Value) { \
OpenCLT OpValue = cl::sycl::detail::convertDataToType<T, OpenCLT>(Value); \
Expand All @@ -424,8 +424,8 @@ __SYCL_GENERATE_CONVERT_IMPL(UToF, double)
detail::enable_if_t<is_float_to_float<T, R>::value && \
!std::is_same<OpenCLT, OpenCLR>::value && \
(std::is_same<OpenCLR, DestType>::value || \
std::is_same<OpenCLR, _Float16>::value && \
std::is_same<DestType, half>::value) && \
(std::is_same<OpenCLR, _Float16>::value && \
std::is_same<DestType, half>::value)) && \
RoundingModeCondition<roundingMode>::value, \
R> \
convertImpl(T Value) { \
Expand Down
18 changes: 18 additions & 0 deletions sycl/test/warnings/vec_convert_warnings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// 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 <CL/sycl.hpp>
#include <cstdlib>

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 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>();
});
});
}

2 changes: 1 addition & 1 deletion sycl/test/warnings/warnings.cpp
Original file line number Diff line number Diff line change
@@ -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/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 <CL/sycl.hpp>

Expand Down