Skip to content

Commit 54678ab

Browse files
author
Alexander Johnston
committed
[SYCL][CUDA] Remove PI_CUDA specific details from clang
Removes PI_CUDA specific code paths and tests from clang, opting to always enable them. Signed-off-by: Alexander Johnston <[email protected]>
1 parent 5f5e017 commit 54678ab

File tree

10 files changed

+7
-20
lines changed

10 files changed

+7
-20
lines changed

clang/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ endif()
219219
include(CheckIncludeFile)
220220
check_include_file(sys/resource.h CLANG_HAVE_RLIMITS)
221221

222-
if(SYCL_BUILD_PI_CUDA)
223-
set(SYCL_HAVE_PI_CUDA 1)
224-
endif()
225-
226222
set(CLANG_RESOURCE_DIR "" CACHE STRING
227223
"Relative directory from the Clang binary to its resource files.")
228224

clang/include/clang/Config/config.h.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
#cmakedefine01 CLANG_ENABLE_OBJC_REWRITER
8181
#cmakedefine01 CLANG_ENABLE_STATIC_ANALYZER
8282

83-
/* Define if we have SYCL PI CUDA support */
84-
#cmakedefine01 SYCL_HAVE_PI_CUDA
85-
8683
/* Spawn a new process clang.exe for the CC1 tool invocation, when necessary */
8784
#cmakedefine01 CLANG_SPAWN_CC1
8885

clang/lib/Driver/Driver.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,9 @@ Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime(const ArgList &Args) const {
615615
}
616616

617617
static bool isValidSYCLTriple(llvm::Triple T) {
618-
#ifdef SYCL_HAVE_PI_CUDA
619618
// NVPTX is valid for SYCL.
620619
if (T.isNVPTX())
621620
return true;
622-
#endif
623621
// Check for invalid SYCL device triple values.
624622
// Non-SPIR arch.
625623
if (!T.isSPIR())

clang/test/Driver/sycl-libspirv-invalid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// Test that `-fsycl-libspirv-path=` produces a diagnostic when the library is not found.
2-
// REQUIRES: clang-driver, sycl-pi-cuda
2+
// REQUIRES: clang-driver
33
// UNSUPPORTED: system-windows
44

55
// RUN: %clangxx -### -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \

clang/test/Driver/sycl-libspirv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// Test that `-fsycl-libspirv-path=` adds `-mlink-builtin-bitcode` when the library is found.
2-
// REQUIRES: clang-driver, sycl-pi-cuda
2+
// REQUIRES: clang-driver
33
// UNSUPPORTED: system-windows
44

55
// RUN: %clangxx -### -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \

clang/test/Driver/sycl-offload-nvptx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// Tests specific to `-fsycl-targets=nvptx64-nvidia-nvcl-sycldevice`
2-
// REQUIRES: clang-driver, sycl-pi-cuda
2+
// REQUIRES: clang-driver
33

44
// UNSUPPORTED: system-windows
55

clang/test/lit.cfg.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@
7777
if config.clang_staticanalyzer_z3 == '1':
7878
config.available_features.add('z3')
7979

80-
if config.sycl_pi_cuda == '1':
81-
config.available_features.add('sycl-pi-cuda')
82-
8380
llvm_config.add_tool_substitutions(tools, tool_dirs)
8481

8582
config.substitutions.append(

clang/test/lit.site.cfg.py.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ config.host_arch = "@HOST_ARCH@"
3030
config.python_executable = "@PYTHON_EXECUTABLE@"
3131
config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
3232
config.has_plugins = @LLVM_ENABLE_PLUGINS@
33-
config.sycl_pi_cuda = "@SYCL_HAVE_PI_CUDA@"
3433

3534
# Support substitution of the tools and libs dirs with user parameters. This is
3635
# used when we can't determine the tool dir at configuration time.

llvm/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,6 @@ if( LLVM_USE_PERF )
462462
endif( NOT CMAKE_SYSTEM_NAME MATCHES "Linux" )
463463
endif( LLVM_USE_PERF )
464464

465-
option(SYCL_BUILD_PI_CUDA
466-
"Selects the PI API backend. When set to ON, the CUDA backend is selected. \
467-
When set to OFF, the OpenCL backend is selected." OFF)
468-
469465
set(LLVM_USE_SANITIZER "" CACHE STRING
470466
"Define the sanitizer used to build binaries and tests.")
471467
option(LLVM_OPTIMIZE_SANITIZED_BUILDS "Pass -O1 on debug sanitizer builds" ON)

sycl/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ install(DIRECTORY ${OPENCL_INCLUDE}/CL
137137
COMPONENT opencl-headers
138138
)
139139

140+
option(SYCL_BUILD_PI_CUDA
141+
"Selects the PI API backend. When set to ON, the CUDA backend is selected. \
142+
When set to OFF, the OpenCL backend is selected." OFF)
143+
140144
# Configure SYCL version macro
141145
set(sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
142146
set(sycl_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/source)

0 commit comments

Comments
 (0)