-
Notifications
You must be signed in to change notification settings - Fork 8
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
OpenCL tests fail gracefully if the OpenCL library can't be loaded #116
base: main
Are you sure you want to change the base?
Conversation
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.
@michel-steuwer That looks fine for TestsWithExecutor
, but we also use util.withExecutor
sometimes (e.g. for shine.DPIA.Primitives.Scatter
), as well as util.ExecuteOpenCL
when using host code generation.
I wasn't aware of this, but I have added support for this now. |
For |
What about exposing this opt out switch to the user? That way we keep things explicit and not engage in guess work. |
We could have an environment variable to opt-in or opt-out. That would also be good going forward with CUDA-specific tests coming. @umazalakain, @Bastacyclop what should the defaults be? I.e. do we opt-in into OpenCL and CUDA tests, or opt-out? |
@umazalakain @michel-steuwer I like automatic support detection, maybe we can detect support by default while exposing override switches to bypass detection? |
So if |
Sorry, somehow I missed these notifications. Automatic support detection + override switch sounds great! |
Maybe the only risk of having it be automatic is that the user might not be aware of whether they are running or not, mostly because currently the tests output a lot of information (I've been thinking of getting rid of all those print statements left in the tests, they make it more difficult to scroll through the output) |
We should aim for having a configuration with three states: We should also make this work for CUDA. |
This PR makes all tests ineracting with the OpenCL executor fail gracefully if the executor library can not be loaded from disk (e.g. when it is not available on a specific development platform).
This PR guards against all code that failes do to a
UnsatisfiedLinkError
that is called from within atest
function.