Make unified backend accept ArrayFire libraries in arbitrary paths (reopened) by mark-poscablo · Pull Request #2525 · arrayfire/arrayfire
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I can verify that it will choose whatever the AFSymbolManager constructor definition determines as the default backend (by the order of CUDA, OpenCL, and CPU) if the user does not explicitly call af::setBackend.
I think your suggestion that we initialize it to to AF_BACKEND_DEFAULT instead is fine. I see no problems with activeBackend and defaultBackend being initialized to that in any cases. If there's at least one backend available, both activeBackend and defaultBackend will be set to the determined default backend as per the order, and if there are no backends available, they will be both set to AF_BACKEND_DEFAULT, which I don't think will pose a problem - any arrayfire calls would just fail as expected, unless af_add/set_backend_library are called.