Skip to content

Commit 325d664

Browse files
author
Pavel Chupin
authored
[SYCL][CMake] Move opencl-aot into opencl subdir opencl/opencl-aot (#3670)
* Update opencl-aot target to reuse opencl deps * Add opencl-aot to standard SYCL bundle instead of separate deploy * Update configure.py accordingly * Minor fix in cmake print message * Update CODEOWNERS to new paths Signed-off-by: Pavel V Chupin <[email protected]>
1 parent 253d7fa commit 325d664

File tree

14 files changed

+29
-128
lines changed

14 files changed

+29
-128
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ clang/**/Driver @mdtoguchi @AGindinson
99
# LLVM-SPIRV translator
1010
llvm-spirv/ @AlexeySotkin @AlexeySachkov
1111

12+
# OpenCL deps
13+
opencl/ @pvchupin @vladimirlaz
14+
1215
# OpenCL "offline" compiler
13-
opencl-aot/ @dm-vodopyanov @AlexeySachkov @romanovvlad
16+
opencl/opencl-aot/ @dm-vodopyanov @AlexeySachkov @romanovvlad
1417

1518
# Device library
1619
libdevice/ @vzakhari @jinge90

buildbot/compile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def do_compile(args):
3232
"--build", abs_obj_dir,
3333
"--",
3434
"deploy-sycl-toolchain",
35-
"deploy-opencl-aot",
3635
"-j", str(cpu_count)]
3736

3837
if args.verbose:

buildbot/configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def do_configure(args):
1313
if not os.path.isdir(abs_obj_dir):
1414
os.makedirs(abs_obj_dir)
1515

16-
llvm_external_projects = 'sycl;llvm-spirv;opencl;opencl-aot;libdevice;xpti;xptifw'
16+
llvm_external_projects = 'sycl;llvm-spirv;opencl;libdevice;xpti;xptifw'
1717

1818
llvm_dir = os.path.join(abs_src_dir, "llvm")
1919
sycl_dir = os.path.join(abs_src_dir, "sycl")

opencl-aot/CMakeLists.txt

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

opencl/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(OCL_LOADER_TAG 5f8249691ec8c25775789498951f8e9eb62c201d)
1616

1717
# OpenCL Headers
1818
if(NOT OpenCL_HEADERS)
19-
message(STATUS "Will fetch OpenCL headers from github.com")
19+
message(STATUS "Will fetch OpenCL headers from ${OCL_HEADERS_REPO}")
2020

2121
FetchContent_Declare(ocl-headers
2222
GIT_REPOSITORY ${OCL_HEADERS_REPO}
@@ -49,7 +49,7 @@ set(OPENCL_ICD_LOADER_HEADERS_DIR
4949
set(BUILD_SHARED_LIBS ON)
5050

5151
if(NOT OpenCL_LIBRARY_SRC)
52-
message(STATUS "Will fetch OpenCL ICD Loader from github.com")
52+
message(STATUS "Will fetch OpenCL ICD Loader from ${OCL_LOADER_REPO}")
5353

5454
FetchContent_Declare(ocl-icd
5555
GIT_REPOSITORY ${OCL_LOADER_REPO}
@@ -69,3 +69,4 @@ endif()
6969
FetchContent_MakeAvailable(ocl-icd)
7070
add_library(OpenCL-ICD ALIAS OpenCL)
7171

72+
add_subdirectory(opencl-aot)
File renamed without changes.
File renamed without changes.

opencl/opencl-aot/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
set(LLVM_LINK_COMPONENTS
4+
${LLVM_TARGETS_TO_BUILD}
5+
Support
6+
)
7+
8+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
9+
file(GLOB TARGET_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
10+
11+
set(OPENCL_AOT_PROJECT_NAME opencl-aot)
12+
13+
add_llvm_tool(${OPENCL_AOT_PROJECT_NAME} ${TARGET_SOURCES})
14+
15+
target_link_libraries(${OPENCL_AOT_PROJECT_NAME}
16+
PRIVATE
17+
OpenCL-Headers
18+
OpenCL-ICD)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

sycl/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,11 @@ add_custom_target( sycl-toolchain
190190
llvm-objcopy
191191
sycl-post-link
192192
sycl-ls
193+
opencl-aot
193194
${XPTIFW_LIBS}
194195
COMMENT "Building SYCL compiler toolchain..."
195196
)
196197

197-
# Check if opencl-aot tool is enabled.
198-
list(FIND LLVM_ENABLE_PROJECTS opencl-aot OPENCL_AOT_FOUND)
199-
if(NOT OPENCL_AOT_FOUND EQUAL -1)
200-
add_dependencies(sycl-toolchain opencl-aot)
201-
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS opencl-aot)
202-
endif()
203-
204198
if (SYCL_ENABLE_XPTI_TRACING)
205199
add_dependencies( sycl-toolchain xpti)
206200
if (MSVC)
@@ -246,6 +240,7 @@ set( SYCL_TOOLCHAIN_DEPLOY_COMPONENTS
246240
sycl-ls
247241
clang-resource-headers
248242
OpenCL-Headers
243+
opencl-aot
249244
sycl-headers
250245
sycl-headers-extras
251246
sycl

sycl/doc/GetStartedGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ AOT compiler for each device type:
331331
#### CPU
332332
333333
* CPU AOT compiler `opencl-aot` is enabled by default. For more, see
334-
[opencl-aot documentation](../../opencl-aot/README.md).
334+
[opencl-aot documentation](../../opencl/opencl-aot/README.md).
335335
336336
#### Accelerator
337337

0 commit comments

Comments
 (0)