OpenCL tests fail gracefully if the OpenCL library can't be loaded#116
OpenCL tests fail gracefully if the OpenCL library can't be loaded#116michel-steuwer wants to merge 5 commits intomainfrom
Conversation
Bastacyclop
left a comment
There was a problem hiding this comment.
@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
UnsatisfiedLinkErrorthat is called from within atestfunction.