Skip to content

sycl: add find_package call for OpenCL #13643

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions ggml/src/ggml-sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ target_compile_options(ggml-sycl PRIVATE "-Wno-narrowing")
# Link against oneDNN
set(GGML_SYCL_DNNL 0)
if(GGML_SYCL_DNN)

# The nightly dpcpp compiler may not ship libOpenCL
# When using a nightly build of oneDNN built with the said nightly compiler, it links against the target OpenCL::OpenCL
# For context, this line in the oneDNN CMake:
# https://github.com/uxlfoundation/oneDNN/blob/743e4273d18bcb0e733723bf9289f14e8366687f/cmake/SYCL.cmake#L127
# and when using this build of oneDNN in llama, it would expect the target OpenCL::OpenCL to be available.
# Hence the below find_package call is required. At the time of writing, the release compiler
# ships libOpenCL, hence only finding the package when the compiler is clang (nightly).

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
find_package(OpenCL REQUIRED)
endif()

find_package(DNNL)
if(DNNL_FOUND)
if (NOT DEFINED DNNL_GPU_VENDOR)
Expand Down
Loading