← 返回首页
Make unified backend accept ArrayFire libraries in arbitrary paths (reopened) by mark-poscablo · Pull Request #2525 · arrayfire/arrayfire · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Make unified backend accept ArrayFire libraries in arbitrary paths (reopened)#2525

Open
mark-poscablo wants to merge 1 commit into
arrayfire:masterfrom
mark-poscablo:specify-libpath
Open

Make unified backend accept ArrayFire libraries in arbitrary paths (reopened)#2525
mark-poscablo wants to merge 1 commit into
arrayfire:masterfrom
mark-poscablo:specify-libpath

Conversation

Copy link
Copy Markdown
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:


Feel free to continue the discussion here.

Comment thread src/api/unified/symbol_manager.cpp Outdated
, newCustomHandleIndex(NUM_BACKENDS)
, backendsAvailable(0)
, activeBackend(AF_BACKEND_CPU)
, defaultBackend(AF_BACKEND_CPU)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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

Copy link
Copy Markdown
Contributor Author

mark-poscablo May 31, 2019
edited
Loading

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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

Copy link
Copy Markdown
Contributor Author

mark-poscablo Jun 3, 2019
edited
Loading

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

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.

Comment thread src/api/unified/symbol_manager.cpp Outdated Show resolved Hide resolved
Comment thread test/CMakeLists.txt Outdated Show resolved Hide resolved
Comment thread test/CMakeLists.txt Show resolved Hide resolved
umar456 force-pushed the specify-libpath branch 5 times, most recently from d7477b1 to b68c968 Compare June 13, 2022 21:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.