Skip to content
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

Refactor interface to compiler, support SPIR-V IL programs #21

Merged
merged 6 commits into from
Sep 23, 2021

Conversation

jenatali
Copy link
Member

@jenatali jenatali commented Apr 19, 2021

The first (large) commit here abstracts the compiler interface, so that the external dependency on clc_compiler.h and clglon12compiler.dll is behind a pure-virtual interface, which allows us to have multiple drop-in implementations.

After that, a second compiler backend is dropped in, which uses a completely reworked clc_compiler.h and targets clon12compiler.dll. This corresponds to a Mesa merge request: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10322.

Then, support for SPIR-V IL programs is added. Lastly, a test is added - currently with bugfixes, I'd like to go back and clean up the commit history here.

@jenatali
Copy link
Member Author

History cleaned up. Since the v2 compiler interface isn't merged upstream yet, there's possibly going to be more changes to it, but it's isolated enough that I think that'll be fine.

One TBD is that if I flip the switch to claim CL 3.0, this change as it currently exists will be out-of-spec since it doesn't support specialization constants. Further, the v1 compiler will always be out-of-spec if it claims CL 3.0 support. Maybe this is okay, or maybe using the v1 compiler needs to not report SPIR-V support, or maybe the v1 compiler needs to not claim CL 3.0 support.

Filed KhronosGroup/OpenCL-Docs#602 to get more clarity on that. Either way, since CL 3.0 isn't flipped on by default yet, I think this is fine as-is.

include/compiler.hpp Show resolved Hide resolved
src/compilers/compiler_common.cpp Show resolved Hide resolved
src/compilers/v1/compiler_v1.cpp Show resolved Hide resolved
src/compilers/v1/compiler_v1.cpp Show resolved Hide resolved
src/compilers/v2/compiler_v2.cpp Show resolved Hide resolved
src/compilers/v2/compiler_v2.cpp Show resolved Hide resolved
test/openclon12test.cpp Show resolved Hide resolved
@jenatali jenatali merged commit b90dc58 into master Sep 23, 2021
@jenatali jenatali deleted the compiler-refactor branch September 23, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants