Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Registered `DPCTL_PARTITION_AFFINITY_DOMAIN_UNKNOWN` enumerator when `DPCTLDevice_GetPartitionAffinityDomains` receives an unrecognized value from the SYCL runtime [gh-2324](https://github.com/IntelPython/dpctl/pull/2324)

### Fixed
* Fixed incorrect paths in `GetLevelZeroHeaders.cmake` [gh-2366](https://github.com/IntelPython/dpctl/pull/2366)

### Maintenance
* Updated pybind11 version used by `dpctl` and examples [gh-2357](https://github.com/IntelPython/dpctl/pull/2357)
Expand Down
16 changes: 10 additions & 6 deletions libsyclinterface/cmake/modules/GetLevelZeroHeaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#
# The module uses git to clone the Level Zero source repository into the
# CMAKE_CURRENT_BINARY_DIR. The path to the Level Zero headers is then returned
# CMAKE_BINARY_DIR. The path to the Level Zero headers is then returned
# to the caller in the LEVEL_ZERO_INCLUDE_DIR variable.
#
# Example usage:
Expand All @@ -26,13 +26,13 @@

function(get_level_zero_headers)

if(EXISTS level-zero)
if(EXISTS "${CMAKE_BINARY_DIR}/level-zero/.git")
# Update the checkout
execute_process(
COMMAND ${GIT_EXECUTABLE} fetch
RESULT_VARIABLE result
ERROR_VARIABLE error
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/level-zero
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/level-zero"
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
Expand All @@ -43,11 +43,15 @@ function(get_level_zero_headers)
)
endif()
else()
# remove level-zero directory if it exists
file(REMOVE_RECURSE "${CMAKE_BINARY_DIR}/level-zero")

# Clone the Level Zero git repo
execute_process(
COMMAND ${GIT_EXECUTABLE} clone https://github.com/oneapi-src/level-zero.git
RESULT_VARIABLE result
ERROR_VARIABLE error
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
Expand All @@ -65,7 +69,7 @@ function(get_level_zero_headers)
RESULT_VARIABLE result
OUTPUT_VARIABLE latest_tag
ERROR_VARIABLE error
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/level-zero
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/level-zero"
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
Expand All @@ -81,7 +85,7 @@ function(get_level_zero_headers)
COMMAND ${GIT_EXECUTABLE} checkout ${latest_tag}
RESULT_VARIABLE result
ERROR_VARIABLE error
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/level-zero
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/level-zero"
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
Expand All @@ -95,7 +99,7 @@ function(get_level_zero_headers)
# Populate the path to the headers
find_path(LEVEL_ZERO_INCLUDE_DIR
NAMES zet_api.h
PATHS ${CMAKE_BINARY_DIR}/level-zero/include
PATHS "${CMAKE_BINARY_DIR}/level-zero/include"
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_CMAKE_PATH
Expand Down
Loading