Skip to content

Commit afd7f4a

Browse files
authored
[SYCL][ESIMD] Bring vc-intrinsics sources (#1930)
VC intrinsics library is required by LowerESIMD pass.
1 parent 928b815 commit afd7f4a

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

sycl/CMakeLists.txt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.2)
1+
cmake_minimum_required(VERSION 3.14)
22

33
project(sycl-solution)
44
# Requirements
@@ -184,6 +184,35 @@ install(DIRECTORY ${OPENCL_INCLUDE}/CL
184184
COMPONENT opencl-headers
185185
)
186186

187+
# vc-intrinsics could have been added earlier from llvm/projects
188+
if (NOT TARGET LLVMGenXIntrinsics)
189+
if (NOT DEFINED LLVMGenXIntrinsics_SOURCE_DIR)
190+
message(STATUS "vc-intrinsics are missing. Will try to download them from github.com")
191+
192+
include(FetchContent)
193+
FetchContent_Declare(vc-intrinsics
194+
GIT_REPOSITORY https://github.com/intel/vc-intrinsics.git
195+
GIT_TAG cce6e48c28eb850d7dadd30841c0d95f009bbca1
196+
)
197+
FetchContent_MakeAvailable(vc-intrinsics)
198+
FetchContent_GetProperties(vc-intrinsics)
199+
200+
set(LLVMGenXIntrinsics_SOURCE_DIR ${vc-intrinsics_SOURCE_DIR})
201+
set(LLVMGenXIntrinsics_BINARY_DIR ${vc-intrinsics_BINARY_DIR})
202+
else()
203+
# -DLLVMGenXIntrinsics_SOURCE_DIR is provided
204+
message(STATUS "vc-intrinsics are added manually ${LLVMGenXIntrinsics_SOURCE_DIR}")
205+
206+
set(LLVMGenXIntrinsics_BINARY_DIR ${CMAKE_BINARY_DIR}/vc-intrinsics-build)
207+
add_subdirectory(${LLVMGenXIntrinsics_SOURCE_DIR} ${LLVMGenXIntrinsics_BINARY_DIR})
208+
endif()
209+
210+
target_include_directories(LLVMGenXIntrinsics
211+
PUBLIC $<BUILD_INTERFACE:${LLVMGenXIntrinsics_SOURCE_DIR}/GenXIntrinsics/include>
212+
PUBLIC $<BUILD_INTERFACE:${LLVMGenXIntrinsics_BINARY_DIR}/GenXIntrinsics/include>
213+
)
214+
endif()
215+
187216
option(SYCL_BUILD_PI_CUDA
188217
"Enables the CUDA backend for the Plugin Interface" OFF)
189218

sycl/doc/GetStartedGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and a wide range of compute accelerators such as GPU and FPGA.
2222
## Prerequisites
2323

2424
* `git` - [Download](https://git-scm.com/downloads)
25-
* `cmake` version 3.2 or later - [Download](http://www.cmake.org/download/)
25+
* `cmake` version 3.14 or later - [Download](http://www.cmake.org/download/)
2626
* `python` - [Download](https://www.python.org/downloads/release/python-2716/)
2727
* `ninja` -
2828
[Download](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages)

0 commit comments

Comments
 (0)