Skip to content

SYCL include path problem #5932

@ye-luo

Description

@ye-luo

Describe the bug

reproducer test_include.cpp

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

My intention is to call SYCL runtime library.
For this minimal SYCL code, I expect the needed include path is /opt/intel/oneapi/compiler/2022.0.2/linux/include/sycl.

$ icpx --std=c++17 -I/opt/intel/oneapi/compiler/2022.0.2/linux/include/sycl test_include.cpp
In file included from test_include.cpp:1:
In file included from /opt/intel/oneapi/compiler/2022.0.2/linux/include/sycl/CL/sycl.hpp:11:
In file included from /opt/intel/oneapi/compiler/2022.0.2/linux/include/sycl/CL/sycl/accessor.hpp:13:
/opt/intel/oneapi/compiler/2022.0.2/linux/include/sycl/CL/sycl/buffer.hpp:17:10: fatal error: 'sycl/ext/oneapi/accessor_property_list.hpp' file not found
#include <sycl/ext/oneapi/accessor_property_list.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

For sure adding another include path does work

icpx -I/opt/intel/oneapi/compiler/2022.0.2/linux/include/sycl -I /opt/intel/oneapi/compiler/2022.0.2/linux/include test_include.cpp

but why adding this burden to users?

I know -fsycl can hide the include problem but sycl should be allowed to use as a normal host library without relying on -fsycl.
It currently does work without -fsycl, however the include paths are messy.

The issue shows up similarly with GCC.

g++ --std=c++17 -I/opt/intel/oneapi/compiler/2022.0.2/linux/include/sycl -I /opt/intel/oneapi/compiler/2022.0.2/linux/include test_include.cpp -lsycl

after adding two include, g++ compiles the reproducer.

So it is not a compiler issue but a SYCL library issue

How about removing all the first sycl from all the include line for sycl extension and allow user to specify one include path only?

#include <sycl/ext/oneapi/accessor_property_list.hpp>

To Reproduce
Please describe the steps to reproduce the behavior:

See above

Environment (please complete the following information):

  • OS: LInux
  • Target device and vendor: running on host
  • DPC++ version: Intel(R) oneAPI DPC++/C++ Compiler 2022.0.0 (2022.0.0.20211123)
  • Dependencies version: compilation issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions