Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
543 Discussions

Warnings when compiling SYCL program with Clang++

vincent_
Novice
1,414 Views

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, 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. 

Labels (1)
0 Kudos
7 Replies
VarshaS_Intel
Moderator
1,381 Views

Hi,


Thanks for posting in Intel Communities.


Could you please let us know the OS details and hardware you are using?


Here is the list of compiler options to enable the warning for your code. Please find the below link:

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-reference/compiler-options/alphabetical-option-list.html


Thanks & Regards,

Varsha



0 Kudos
vincent_
Novice
1,375 Views

First of all, thanks for reaching out!

I am running on Suse Linux Enterprise Server version 12 SP2. CPU is Intel Xeon Platinum 8160 CPU.

About the link you provided on how to enable/disable warnings, please note that I do not wish to hide warnings, I want to know why the warnings only arise on compilers different than DPC++ and what their implications might be.

Thanks a lot.

0 Kudos
VarshaS_Intel
Moderator
1,295 Views

Hi,

 

Could you please let us know the steps you have followed with clang++ as we are not able to reproduce the warnings at our end?

 

At our end, we are getting the below error trying with the command provided by you, could you please help us to reproduce the issue at our end? Please find the below screenshot:

clang_error.png

And also, could you please let us know how you are able to install clang 16 as it isn't even included in Ubuntu 22.04 LTS?

 

Thanks & Regards,

Varsha

0 Kudos
vincent_
Novice
1,274 Views

Hi,

 

I have reproduced the same warnings again with clang++ version 12.0.1, so I guess you can try with whichever  version you have available in Ubuntu repositories.

 

About your compilation error: You also need to include the dir that includes the accessor_property_list.hpp. In your environment this is /opt/intel/oneapi/compiler/2022.2.0/linux/include.

 

Thanks,

Vincent.

0 Kudos
VarshaS_Intel
Moderator
870 Views

Hi,


Thanks for the information.


Could you please try using the "icpx -fsycl" in place of "dpcpp" compiler? Since dpcpp is going to be deprecated in future releases.


And also, the warning is arising because it is been incorrectly the clang++ compiler and also incorrectly includes SYCL. Clang(vanilla) does not support the SYCL standard.


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
827 Views

Hi,


We have not heard back from you. Could you please provide us with an update?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
696 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need additional information, please post a new question.


Thanks & Regards,

Varsha


0 Kudos
Reply