File tree Expand file tree Collapse file tree 10 files changed +25
-9
lines changed Expand file tree Collapse file tree 10 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,18 @@ jobs:
87
87
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
88
88
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
89
89
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
90
+ -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
90
91
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
91
92
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
92
93
93
94
- name : Build
94
95
# This is so that device binaries can find the sycl runtime library
95
96
run : cmake --build ${{github.workspace}}/build -j $(nproc)
96
97
98
+ - name : Install
99
+ # This is to check that install command does not fail
100
+ run : cmake --install ${{github.workspace}}/build
101
+
97
102
- name : Test adapter specific
98
103
working-directory : ${{github.workspace}}/build
99
104
run : ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
Original file line number Diff line number Diff line change @@ -139,6 +139,15 @@ function(add_ur_library name)
139
139
endif ()
140
140
endfunction ()
141
141
142
+ function (install_ur_library name )
143
+ install (TARGETS ${name}
144
+ EXPORT ${PROJECT_NAME} -targets
145
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
146
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
147
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT unified-runtime
148
+ )
149
+ endfunction ()
150
+
142
151
include (FetchContent )
143
152
144
153
function (FetchSource GIT_REPOSITORY GIT_TAG GIT_DIR DEST )
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ add_ur_adapter(${TARGET_NAME}
45
45
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.cpp
46
46
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.hpp
47
47
)
48
+ install_ur_library (${TARGET_NAME} )
48
49
49
50
set_target_properties (${TARGET_NAME} PROPERTIES
50
51
VERSION "${PROJECT_VERSION_MAJOR} .${PROJECT_VERSION_MINOR} .${PROJECT_VERSION_PATCH} "
@@ -100,7 +101,7 @@ if (UR_ENABLE_TRACING)
100
101
XPTI_ENABLE_INSTRUMENTATION
101
102
XPTI_STATIC_LIBRARY
102
103
)
103
- target_include_directories (${TARGET_NAME} PUBLIC
104
+ target_include_directories (${TARGET_NAME} PRIVATE
104
105
${XPTI_INCLUDES}
105
106
${CUDA_CUPTI_INCLUDE_DIR}
106
107
)
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ add_ur_adapter(${TARGET_NAME}
92
92
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.cpp
93
93
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.hpp
94
94
)
95
+ install_ur_library (${TARGET_NAME} )
95
96
96
97
if (NOT MSVC )
97
98
target_compile_options (${TARGET_NAME} PRIVATE
Original file line number Diff line number Diff line change @@ -50,14 +50,15 @@ if(UR_BUILD_ADAPTER_L0)
50
50
${CMAKE_CURRENT_SOURCE_DIR} /helpers/memory_helpers.cpp
51
51
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.cpp
52
52
)
53
+ install_ur_library (ur_adapter_level_zero )
53
54
54
55
if (UR_STATIC_ADAPTER_L0 )
55
56
target_compile_definitions (ur_adapter_level_zero PUBLIC UR_STATIC_ADAPTER_LEVEL_ZERO )
56
57
57
58
# 'utils' target from 'level-zero-loader' includes path which is prefixed
58
59
# in the source directory, this breaks the installation of 'utils' target.
59
60
set_target_properties (utils PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "" )
60
- install (TARGETS ur_adapter_level_zero ur_umf LevelZeroLoader LevelZeroLoader-Headers ze_loader utils
61
+ install (TARGETS ur_umf LevelZeroLoader LevelZeroLoader-Headers ze_loader utils
61
62
EXPORT ${PROJECT_NAME} -targets
62
63
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
63
64
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -150,6 +151,7 @@ if(UR_BUILD_ADAPTER_L0_V2)
150
151
${CMAKE_CURRENT_SOURCE_DIR} /v2/queue_immediate_in_order.cpp
151
152
${CMAKE_CURRENT_SOURCE_DIR} /v2/usm.cpp
152
153
)
154
+ install_ur_library (ur_adapter_level_zero_v2 )
153
155
154
156
if (NOT WIN32 )
155
157
# api.cpp contains NOT_SUPPORTED functions-only
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ add_ur_adapter(${TARGET_NAME}
41
41
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.cpp
42
42
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.hpp
43
43
)
44
+ install_ur_library (${TARGET_NAME} )
44
45
45
46
set_target_properties (${TARGET_NAME} PROPERTIES
46
47
VERSION "${PROJECT_VERSION_MAJOR} .${PROJECT_VERSION_MINOR} .${PROJECT_VERSION_PATCH} "
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ add_ur_adapter(${TARGET_NAME} SHARED
43
43
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.cpp
44
44
${CMAKE_CURRENT_SOURCE_DIR} /../../ur/ur.hpp
45
45
)
46
+ install_ur_library (${TARGET_NAME} )
46
47
47
48
set_target_properties (${TARGET_NAME} PROPERTIES
48
49
VERSION "${PROJECT_VERSION_MAJOR} .${PROJECT_VERSION_MINOR} .${PROJECT_VERSION_PATCH} "
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ add_ur_library(ur_loader
19
19
""
20
20
${CMAKE_CURRENT_BINARY_DIR} /UrLoaderVersion.rc
21
21
)
22
+ install_ur_library (ur_loader )
22
23
23
24
if (MSVC )
24
25
set (TARGET_LIBNAME ur_loader )
@@ -101,13 +102,6 @@ if(UNIX)
101
102
install (FILES "${CMAKE_CURRENT_BINARY_DIR} /libur_loader.pc" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR} /pkgconfig" COMPONENT unified-runtime )
102
103
endif ()
103
104
104
- install (TARGETS ur_loader
105
- EXPORT ${PROJECT_NAME} -targets
106
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
107
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
108
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT unified-runtime
109
- )
110
-
111
105
target_sources (ur_loader
112
106
PRIVATE
113
107
${CMAKE_CURRENT_SOURCE_DIR} /ur_object.hpp
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ set(UR_TEST_PLATFORMS_COUNT 1 CACHE STRING "Count of platforms on which conforma
15
15
set (UR_TEST_FUZZTESTS ON CACHE BOOL "Run fuzz tests if using clang and UR_DPCXX is specified" )
16
16
# For Windows: Prevent overriding the parent project's compiler/linker settings
17
17
set (gtest_force_shared_crt ON CACHE BOOL "" FORCE )
18
+ set (INSTALL_GTEST OFF )
18
19
FetchContent_MakeAvailable (googletest )
19
20
enable_testing ()
20
21
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ if(UR_BUILD_ADAPTER_L0)
45
45
# Make L0 use CallMap from a seprate shared lib so that we can access the map
46
46
# from the tests. This only seems to work on linux
47
47
add_library (zeCallMap SHARED zeCallMap.cpp )
48
+ install_ur_library (zeCallMap )
48
49
target_compile_definitions (ur_adapter_level_zero PRIVATE UR_L0_CALL_COUNT_IN_TESTS )
49
50
# TODO: stop exporting internals like this for tests...
50
51
target_link_libraries (ur_adapter_level_zero PRIVATE zeCallMap )
You can’t perform that action at this time.
0 commit comments