Skip to content

Conversation

@mark-poscablo
Copy link
Contributor

I had to make a new PR because I forced-push to my branch while the previous PR (#2514) was closed and it won't let me reopen it anymore.

Here are the screenshots of the docs:
image
image
image

Feel free to continue the discussion here.

, newCustomHandleIndex(NUM_BACKENDS)
, backendsAvailable(0)
, activeBackend(AF_BACKEND_CPU)
, defaultBackend(AF_BACKEND_CPU)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these two activeBackend and defaultBackend variables associated with only custom handles the user adds ?

Copy link
Contributor Author

@mark-poscablo mark-poscablo May 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they've always been there. In fact af_get_active_backend and af::setBackend(AF_BACKEND_DEFAULT) uses those variables. They're not currently being initialized, so I thought why not initialize them too as a good practice. They're actually being set in the AFSymbolManager constructor definition though. I can revert this change though if you think we should leave them not value-initialized.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I asked this is, default backend or active backend are automatically chosen if not set by user. So, I am concerned if we will mess that up by setting it to CPU here by default. Can you please verify that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid confusion, lets assign that to AF_BACKEND_DEFAULT instead of CPU.

Copy link
Contributor Author

@mark-poscablo mark-poscablo Jun 3, 2019

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.

@umar456 umar456 force-pushed the specify-libpath branch 5 times, most recently from d7477b1 to b68c968 Compare June 13, 2022 21:02
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.

2 participants