This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 188
188
else :
189
189
arch_flag = ""
190
190
191
- # extra_include points to sycl/sycl.hpp location to workaround compiler
192
- # versions which supports only CL/sycl.hpp
193
- config .substitutions .append ( ('%clangxx' , ' ' + config .dpcpp_compiler + ' ' + config .cxx_flags + ' ' + arch_flag + ' ' + ( "/I" if cl_options else "-I" ) + config .extra_include ) )
194
- config .substitutions .append ( ('%clang' , ' ' + config .dpcpp_compiler + ' ' + config .c_flags + ( "/I" if cl_options else "-I" ) + config .extra_include ) )
191
+ # Add an extra include directory which points to a fake sycl/sycl.hpp (which just points to CL/sycl.hpp)
192
+ # location to workaround compiler versions which do not provide this header
193
+ check_sycl_hpp_file = 'sycl_hpp_include.cpp'
194
+ with open (check_sycl_hpp_file , 'w' ) as fp :
195
+ fp .write ('#include <sycl/sycl.hpp>\n ' )
196
+ fp .write ('int main() {}' )
197
+
198
+ extra_sycl_include = ""
199
+ sycl_hpp_available = subprocess .getstatusoutput (config .dpcpp_compiler + ' -fsycl ' + check_sycl_hpp_file )
200
+ if sp [0 ] != 0 :
201
+ extra_sycl_include = " " + ("/I" if cl_options else "-I" ) + config .extra_include
202
+
203
+
204
+ config .substitutions .append ( ('%clangxx' , ' ' + config .dpcpp_compiler + ' ' + config .cxx_flags + ' ' + arch_flag + extra_sycl_include ) )
205
+ config .substitutions .append ( ('%clang' , ' ' + config .dpcpp_compiler + ' ' + config .c_flags + extra_sycl_include ) )
206
+
195
207
config .substitutions .append ( ('%threads_lib' , config .sycl_threads_lib ) )
196
208
197
209
# Configure device-specific substitutions based on availability of corresponding
You can’t perform that action at this time.
0 commit comments