-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL][Cmake] Redesign OpenCL dependencies #3485
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
Conversation
47665e9
to
40af3a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2f0171b
to
5300a98
Compare
* Moved from ExternalProject to FetchContent: * External dependencies are downloaded at configure stage, not build * All dependencies targets become available earlier and become reusable * All dependencies are consolidated under _deps directory * Simplified cmake files for better maintenance * Outline opencl deps into separate opencl/CMakeLists.txt * Update other targets to new deps accordingly * Added comments inlined for not very clear logic in our cmake build system Signed-off-by: Pavel V Chupin <pavel.v.chupin@intel.com>
Finished the cleanup. Now it's ready for review. |
LGTM to move opencl-aot to opencl folder. The only problem is that opencl-aot history will be lost. It looks like there is a way to see the history before the movement, but it is unideal and may not work correctly sometimes. Anyway, there are 3-4 contributors to this component and it is ok to lose the history. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning this up.
opencl/CMakeLists.txt looks good to me with one minor comment.
@pvchupin, please, resolve merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you all for good review. I'm going to try suggestions mentioned.
Give me some time for the next iteration.
It didn't work for me. @vladimirlaz suggested a few tricks with paths, but it didn't help. Either it has some special undocumented prerequisites, or it's just broken for a while. We decided to cleanup the vars that's been used and I went further in removing the option from the script. These deps are downloaded in a few seconds anyway with the specific version we want. |
@pvchupin, FYI. BuildBot CI explicitly builds icd-loader in a separate I think this patch will introduce unnecessary redundancy in building ICD loader twice. |
I think we should fix this feature rather than removing it. |
Currently it's built twice because opencl-aot builds it separately. Note that it's been built twice before my patch. Next patch I'm going to make for opencl-aot will start reusing dependency. |
Can you or anybody specify what this feature was supposed to do and when/how it was working when it was working? Or how to use it now if it's still working for anybody. |
Thanks. I didn't know that. Will take a closer look tomorrow. Probably we should remove the whole dependency step. We have more dependencies right now than just opencl (level_zero, vc_intrinsics) and this script is getting opencl only. Can be fetched/reused at configure stage instead. |
I use it and works for me. |
This feature is critical for scenarios when we need to build SYCL project on the system w/o access to the Internet/GitHub. |
Co-authored-by: Alexey Bader <alexey.bader@intel.com> Co-authored-by: smaslov-intel <48694368+smaslov-intel@users.noreply.github.com>
Can be used by configure.py --cmake-opt="-DOpenCL_HEADERS=path" --cmake-opt="-DOpenCL_LIBRARY_SRC=path"
@bader as discussed added possibility to use predownloaded headers and library sources through cmake flags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladimirlaz, please, take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Some ideas next improvements (in next PR):
- apply the same changes for opencl-aot;
- remove dependency.py script as all its artifacts are ignored;
- add CMake variable for storing GIT_TAG for both OpenCL headers and ICD loader (like we have in https://github.com/intel/llvm/blob/sycl/llvm/lib/SYCLLowerIR/CMakeLists.txt#L7)
Adding one last change in this PR, actually the last from @vladimirlaz todo list. It will allow easier customizations of these if needed. |
Signed-off-by: Pavel V Chupin pavel.v.chupin@intel.com