File tree Expand file tree Collapse file tree 4 files changed +17
-15
lines changed Expand file tree Collapse file tree 4 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- cmake_minimum_required (VERSION 3.5 )
15
+ cmake_minimum_required (VERSION 3.20 )
16
16
17
17
project (mlir-extensions )
18
18
@@ -30,6 +30,8 @@ if(POLICY CMP0116)
30
30
cmake_policy (SET CMP0116 OLD )
31
31
endif ()
32
32
33
+ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules/" )
34
+
33
35
# SDL
34
36
# set(CMAKE_VERBOSE_MAKEFILE on) # enable for debug
35
37
if (CMAKE_SYSTEM_NAME STREQUAL Windows )
@@ -66,11 +68,15 @@ macro(apply_llvm_compile_flags target)
66
68
if (MSVC )
67
69
target_compile_options (${target} PRIVATE /EHsc )
68
70
endif ()
69
-
70
71
target_compile_definitions (${target} PRIVATE ${LLVM_DEFINITIONS} )
71
72
endmacro ()
72
73
73
74
if (GPU_ENABLE )
75
+ if (DEFINED ENV{LEVEL_ZERO_VERSION_CHECK_OFF} )
76
+ find_package (LevelZero REQUIRED )
77
+ else ()
78
+ find_package (LevelZero 1.6 REQUIRED )
79
+ endif ()
74
80
add_subdirectory (dpcomp_gpu_runtime )
75
81
endif ()
76
82
Original file line number Diff line number Diff line change 89
89
- script : |
90
90
git clone https://github.com/oneapi-src/level-zero.git
91
91
cd level-zero
92
- git checkout v1.5.0
92
+ git checkout v1.6.2
93
93
mkdir level_zero_install
94
94
mkdir build
95
95
cd build
@@ -111,6 +111,7 @@ jobs:
111
111
export LLVM_PATH=$(System.DefaultWorkingDirectory)/llvm_cache
112
112
export TBB_PATH=$(System.DefaultWorkingDirectory)/tbb
113
113
export LEVEL_ZERO_DIR=$(System.DefaultWorkingDirectory)/level-zero/level_zero_install
114
+ export LEVEL_ZERO_VERSION_CHECK_OFF=1
114
115
export OCL_ICD_FILENAMES_RESET=1
115
116
export OCL_ICD_FILENAMES=libintelocl.so
116
117
export SYCL_DEVICE_FILTER=opencl:cpu
Original file line number Diff line number Diff line change @@ -16,28 +16,24 @@ project(dpcomp-gpu-runtime LANGUAGES CXX C)
16
16
17
17
include (GenerateExportHeader )
18
18
19
- if (NOT LEVEL_ZERO_DIR )
20
- message (FATAL_ERROR "LEVEL_ZERO_DIR is not set" )
21
- endif ()
22
-
23
19
set (SOURCES_LIST
24
20
lib/gpu_runtime.cpp
25
- )
21
+ )
26
22
set (HEADERS_LIST
27
23
lib/level_zero_printing.hpp
28
24
lib/level_zero_wrapper.hpp
29
- )
25
+ )
30
26
31
27
add_library (${PROJECT_NAME} SHARED ${SOURCES_LIST} ${HEADERS_LIST} )
32
28
generate_export_header (${PROJECT_NAME} )
33
29
34
30
target_include_directories (${PROJECT_NAME} PRIVATE
35
31
${PROJECT_BINARY_DIR}
36
- ${LEVEL_ZERO_DIR} /include
37
- )
32
+ ${LevelZero_INCLUDE_DIR}
33
+ )
38
34
39
35
target_link_directories (${PROJECT_NAME} PRIVATE
40
- ${LEVEL_ZERO_DIR} /lib
41
- )
36
+ ${LevelZero_LIBRARIES_DIR}
37
+ )
42
38
43
- target_link_libraries (${PROJECT_NAME} PRIVATE ze_loader )
39
+ target_link_libraries (${PROJECT_NAME} PRIVATE ${LevelZero_LIBRARY} )
Original file line number Diff line number Diff line change 89
89
else :
90
90
print ("LEVEL_ZERO_DIR is" , LEVEL_ZERO_DIR )
91
91
cmake_cmd += [
92
- "-DLEVEL_ZERO_DIR=" + LEVEL_ZERO_DIR ,
93
92
"-DGPU_ENABLE=ON" ,
94
93
]
95
94
You can’t perform that action at this time.
0 commit comments