Skip to content

Follow up fixes after enabling LIT for Level Zero #1876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2020
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
8 changes: 8 additions & 0 deletions sycl/plugins/level_zero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,16 @@ if (NOT DEFINED L0_LIBRARY OR NOT DEFINED L0_INCLUDE_DIR)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS l0-loader)
else()
include_directories("${L0_INCLUDE_DIR}")
add_custom_target(l0-loader
DEPENDS ${L0_LIBRARY} COMMENT "Using provided L0 Loader")
endif()

add_library (L0Loader-Headers INTERFACE)
add_library (L0Loader::Headers ALIAS L0Loader-Headers)
target_include_directories(L0Loader-Headers
INTERFACE "${L0_INCLUDE_DIR}"
)

include_directories("${sycl_inc_dir}")
include_directories(${OPENCL_INCLUDE})

Expand Down
2 changes: 1 addition & 1 deletion sycl/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def getDeviceCount(device_type):
if exit_code != 0:
lit_config.error("getDeviceCount {TYPE} {BACKEND}: Non-zero exit code {CODE}".format(
TYPE=device_type, BACKEND=backend, CODE=exit_code))
return [0,False]
return [0,False,False]

result = output.decode().replace('\n', '').split(':', 1)
try:
Expand Down
11 changes: 7 additions & 4 deletions sycl/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ add_subdirectory(sycl-ls)
add_executable(get_device_count_by_type get_device_count_by_type.cpp)
add_dependencies(get_device_count_by_type ocl-headers ocl-icd l0-loader)

if(MSVC)
set(L0_LIBRARY
if (NOT DEFINED L0_LIBRARY)
if(MSVC)
set(L0_LIBRARY
"${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_loader${CMAKE_STATIC_LIBRARY_SUFFIX}")
else()
set(L0_LIBRARY
else()
set(L0_LIBRARY
"${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}ze_loader${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
endif()

target_link_libraries(get_device_count_by_type
PRIVATE
OpenCL::Headers
L0Loader::Headers
${OpenCL_LIBRARIES}
${L0_LIBRARY}
$<$<BOOL:${SYCL_BUILD_PI_CUDA}>:cudadrv>
Expand Down