clangintelsycldpc++

Warnings compiling simple SYCL program with Clang++


When compiling a very simple program with Clang++, vanilla version 16 (not intel version), I get warnings that do not arise when compiling with the dpcpp compiler. I am concerned since I have no way to know if the warnings will mean that my code will be malfunctioning in some way at runtime.

This minimal code generates some warnings about interop_handler being deprecated:

#include <CL/sycl.hpp>
int main(){}

The command issued is the following, where INCLUDEDIR is used to indicate where the SYCL headers are:

clang++ -std=c++17 -I$INCLUDEDIR -c t.cpp

The warnings are:

In file included from t.cpp:1:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl.hpp:16:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/backend.hpp:18:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/backend_traits_opencl.hpp:26:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/queue.hpp:20:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/handler.hpp:14:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/cg.hpp:27:
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/cg_types.hpp:234:32: warning: 'interop_handler' is deprecated: interop_handler class is deprecated, use interop_handle instead with host-task [-Wdeprecated-declarations]
  std::function<void(cl::sycl::interop_handler)> MFunc;
                               ^
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/interop_handler.hpp:18:7: note: 'interop_handler' has been explicitly marked deprecated here
class __SYCL_DEPRECATED("interop_handler class is deprecated, use"
      ^
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/defines_elementary.hpp:45:38: note: expanded from macro '__SYCL_DEPRECATED'
#define __SYCL_DEPRECATED(message) [[deprecated(message)]]
                                     ^
In file included from t.cpp:1:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl.hpp:16:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/backend.hpp:18:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/backend_traits_opencl.hpp:26:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/queue.hpp:20:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/handler.hpp:14:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/cg.hpp:27:
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/cg_types.hpp:237:44: warning: 'interop_handler' is deprecated: interop_handler class is deprecated, use interop_handle instead with host-task [-Wdeprecated-declarations]
  InteropTask(std::function<void(cl::sycl::interop_handler)> Func)
                                           ^
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/interop_handler.hpp:18:7: note: 'interop_handler' has been explicitly marked deprecated here
class __SYCL_DEPRECATED("interop_handler class is deprecated, use"
      ^
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/defines_elementary.hpp:45:38: note: expanded from macro '__SYCL_DEPRECATED'
#define __SYCL_DEPRECATED(message) [[deprecated(message)]]
                                     ^
In file included from t.cpp:1:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl.hpp:16:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/backend.hpp:18:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/backend_traits_opencl.hpp:26:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/queue.hpp:20:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/handler.hpp:14:
In file included from /ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/cg.hpp:27:
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/cg_types.hpp:239:23: warning: 'interop_handler' is deprecated: interop_handler class is deprecated, use interop_handle instead with host-task [-Wdeprecated-declarations]
  void call(cl::sycl::interop_handler &h) { MFunc(h); }
                      ^
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/interop_handler.hpp:18:7: note: 'interop_handler' has been explicitly marked deprecated here
class __SYCL_DEPRECATED("interop_handler class is deprecated, use"
      ^
/ONE_API_2022.3/compiler/2022.2.0/linux/include/sycl/CL/sycl/detail/defines_elementary.hpp:45:38: note: expanded from macro '__SYCL_DEPRECATED'
#define __SYCL_DEPRECATED(message) [[deprecated(message)]]
                                     ^
3 warnings generated.

As said, this happens with a minimal example; with more complicated SYCL code there would be more warnings. I want to know if I should be concerned and if there is some way to solve the warnings.


Solution

  • Intel's SYCL implementation spews warnings like there is no tomorrow due to extreme overuse of deprecation annotations. Just add -Wno-deprecated-declarations which is supported by both clang++ and g++.