Skip to content

[SYCL] Support cl_khr_il_program extension #315

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 9 commits into from
Jul 16, 2019

Conversation

alexbatashev
Copy link
Contributor

@alexbatashev alexbatashev commented Jul 15, 2019

clCreateProgramWithIL is used by SYCL, and this function is only available with OpenCL 2.1 or later. For OpenCL < 2.1 there is an extension cl_khr_il_program which makes the same function available under a different name: clCreateProgramWithILKHR. Make SYCL runtime check for its availability and use it.

Signed-off-by: Alexander Batashev [email protected]

Alexander Batashev added 9 commits July 11, 2019 13:50
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
@alexbatashev alexbatashev requested a review from bader July 15, 2019 10:39
@agozillon
Copy link
Contributor

agozillon commented Jul 15, 2019

Out of interest do you think a similar method of querying the OpenCL runtime in use could be used for Queue creation: https://github.com/intel/llvm/blob/sycl/sycl/include/CL/sycl/detail/queue_impl.hpp#L145

And is this an alteration that might be done in the future? As I think that's one, if not the only location that still relies on the CL_VERSION_2_0 define at the moment. I've also had some small issues with it as the CL_VERSION_2_0 macro always seems to exist if you have an OpenCL > 2.0 compliant runtime when compiling, even if you intend to use something lower... Although, that may just be me doing something odd...

@bader
Copy link
Contributor

bader commented Jul 15, 2019

Out of interest do you think a similar method of querying the OpenCL runtime in use could be used for Queue creation: https://github.com/intel/llvm/blob/sycl/sycl/include/CL/sycl/detail/queue_impl.hpp#L145

And is this an alteration that might be done in the future? As I think that's one, if not the only location that still relies on the CL_VERSION_2_0 define at the moment. I've also had some small issues with it as the CL_VERSION_2_0 macro always seems to exist if you have an OpenCL > 2.0 compliant runtime when compiling, even if you intend to use something lower... Although, that may just be me doing something odd...

I think we should do this.
@agozillon, do you have patches you would like to commit?
Today we test regularly on devices supporting OpenCL 2.1, but it's easy to skip usage of OpenCL 2.0+ API during the review/testing.
SYCL runtime is linked with ICD library and I don't know if we can build this library with OpenCL 1.2 support only. Last time I tried it failed.
I would really appreciate if you can help us to report/fix this kind of problems.

@agozillon
Copy link
Contributor

Out of interest do you think a similar method of querying the OpenCL runtime in use could be used for Queue creation: https://github.com/intel/llvm/blob/sycl/sycl/include/CL/sycl/detail/queue_impl.hpp#L145
And is this an alteration that might be done in the future? As I think that's one, if not the only location that still relies on the CL_VERSION_2_0 define at the moment. I've also had some small issues with it as the CL_VERSION_2_0 macro always seems to exist if you have an OpenCL > 2.0 compliant runtime when compiling, even if you intend to use something lower... Although, that may just be me doing something odd...

I think we should do this.
@agozillon, do you have patches you would like to commit?
Today we test regularly on devices supporting OpenCL 2.1, but it's easy to skip usage of OpenCL 2.0+ API during the review/testing.
SYCL runtime is linked with ICD library and I don't know if we can build this library with OpenCL 1.2 support only. Last time I tried it failed.
I would really appreciate if you can help us to report/fix this kind of problems.

I sadly do not have a patch ready right now, I've got a dirty hack in place at the moment as a quick work around. However, I'd be happy to work on one but it may be a little while till I get around to it unfortunately.

Although this is one of the few locations I've had issues with OpenCL < 2.0 (the other being the invocation this pull request fixes), but if I find any others I will do my best to supply fixes for them in the future.

@bader bader merged commit 2a45f51 into intel:sycl Jul 16, 2019
@alexbatashev alexbatashev deleted the private/abatashe/crprgril branch July 16, 2019 07:06
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