Skip to content

Commit 57ee6e1

Browse files
againullbader
authored andcommitted
[SYCL] Remove wrapper headers
Even when compiling for the device, code meant only for host execution must be semantically analyzable. Existing wrapper headers were initially created to resolve this problem. But now -aux-triple is used to pass target triple of opposite side of compilation. Clang knows target triple for both sides of compilation so that preprocessor macros and target builtins from both sides are available. That is why there is no need in existing wrapper headers with stub definitions since they break compilation for cases when standard headers are included. Approach with -aux-triple is not complete solution. Host headers might provide definitions relying on host inline asm, intrinsics, using types not lowerable in device code. So we will need to provide a solution to overload some definitions for the device or to define only some macro for host headers. This will be resolved in other commits. Signed-off-by: Artur Gainullin <[email protected]>
1 parent b2248cc commit 57ee6e1

File tree

5 files changed

+0
-2109
lines changed

5 files changed

+0
-2109
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,16 +1168,6 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
11681168
if (JA.isOffloading(Action::OFK_Cuda))
11691169
getToolChain().AddCudaIncludeArgs(Args, CmdArgs);
11701170

1171-
// Add include directories for SYCL
1172-
if (!Args.hasArg(options::OPT_nobuiltininc) &&
1173-
getToolChain().getTriple().isSYCLDeviceEnvironment()) {
1174-
SmallString<128> P(D.ResourceDir);
1175-
llvm::sys::path::append(P, "include");
1176-
llvm::sys::path::append(P, "sycl_wrappers");
1177-
CmdArgs.push_back("-internal-isystem");
1178-
CmdArgs.push_back(Args.MakeArgString(P));
1179-
}
1180-
11811171
// If we are offloading to a target via OpenMP we need to include the
11821172
// openmp_wrappers folder which contains alternative system headers.
11831173
if (JA.isDeviceOffloading(Action::OFK_OpenMP) &&

clang/lib/Headers/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ set(ppc_wrapper_files
128128
ppc_wrappers/mmintrin.h
129129
)
130130

131-
set(sycl_wrapper_files
132-
sycl_wrappers/algorithm
133-
sycl_wrappers/random
134-
sycl_wrappers/__config
135-
)
136-
137131
set(openmp_wrapper_files
138132
openmp_wrappers/math.h
139133
openmp_wrappers/cmath
@@ -201,12 +195,6 @@ install(
201195
DESTINATION ${header_install_dir}/ppc_wrappers
202196
COMPONENT clang-resource-headers)
203197

204-
install(
205-
FILES ${sycl_wrapper_files}
206-
COMPONENT clang-resource-headers
207-
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
208-
DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/sycl_wrappers)
209-
210198
install(
211199
FILES ${openmp_wrapper_files}
212200
DESTINATION ${header_install_dir}/openmp_wrappers

clang/lib/Headers/sycl_wrappers/__config

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)