Skip to content

[CMake] Enable UR plugin when building dependant plugins #11214

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

Closed
wants to merge 4 commits into from
Closed
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
11 changes: 8 additions & 3 deletions sycl/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|IntelLLVM" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default")
endif()

# level_zero plugin depends today on unified_runtime plugin
# level_zero, cuda, hip, and native_cpu plugins depends today on unified_runtime plugin
# and unified_runtime plugin is not an independent plugin, adding it explicitly
if ("level_zero" IN_LIST SYCL_ENABLE_PLUGINS)
add_subdirectory(unified_runtime)
if (NOT "unified_runtime" IN_LIST SYCL_ENABLE_PLUGINS)
if ("level_zero" IN_LIST SYCL_ENABLE_PLUGINS OR
"hip" IN_LIST SYCL_ENABLE_PLUGINS OR
"cuda" IN_LIST SYCL_ENABLE_PLUGINS OR
"native_cpu" IN_LIST SYCL_ENABLE_PLUGINS)
add_subdirectory(unified_runtime)
endif()
endif()

foreach(plugin ${SYCL_ENABLE_PLUGINS})
Expand Down
7 changes: 0 additions & 7 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ add_sycl_plugin(unified_runtime
Threads::Threads
UnifiedRuntimeLoader
UnifiedRuntime-Headers
LevelZeroLoader-Headers # we need for #include <ze_api.h> in common.h
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No common.h in sight, and nothing in sycl/plugins/unified_runtime/ rely on level_zero except the corresponding adapter.

)

add_dependencies(sycl-runtime-libraries ur_adapter_level_zero)
Expand Down Expand Up @@ -268,9 +267,3 @@ if (TARGET UnifiedRuntimeLoader)
)
endif()

# Install the UR adapters too
install(TARGETS ur_adapter_level_zero
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev
RUNTIME DESTINATION "bin" COMPONENT level-zero-sycl-dev
)