arrayfire-python icon indicating copy to clipboard operation
arrayfire-python copied to clipboard

OpenCL interoperability does not work on CUDA machine

Open villekf opened this issue 1 year ago • 1 comments

On (Linux) CUDA machine, the backend returned by af.get_backend() remains at unified even if the backend is correctly set as OpenCL. af.get_active_backend() correctly returns OpenCL as the backend, but since the interoperability functions use different way to check the backend, an error is output (see https://github.com/arrayfire/arrayfire-python/blob/master/arrayfire/opencl.py#L107). Commenting all those instances fixes the issue. The (commented) tests reproduce this error, i.e. https://github.com/arrayfire/arrayfire-python/blob/master/tests/simple/interop.py#L82

Note that this wasn't an issue on a (Windows) AMD machine, where OpenCL is the default backend.

villekf avatar Apr 22 '24 08:04 villekf

I get it too

>>> af.get_active_backend()
'opencl'
>>> af.get_backend()
'unified'
>>> af.set_backend("opencl")
>>> af.get_backend()
'unified'

TheFloatingBrain avatar Oct 08 '24 22:10 TheFloatingBrain