Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does the package compare to Requires.jl? #14

Closed
juliohm opened this issue Aug 25, 2018 · 4 comments
Closed

How does the package compare to Requires.jl? #14

juliohm opened this issue Aug 25, 2018 · 4 comments

Comments

@juliohm
Copy link

juliohm commented Aug 25, 2018

Hi Tim,

I appreciate if you can clarify the mechanism of this package as compared to Requires.jl? I am trying to upgrade ImageQuilting.jl to Julia v0.7, and I will have to make OpenCL + CLFFT optional dependencies. As far as I understood the addresource command in this package plays the role of a "priority queue" of resources where GPUs have higher priority than CPUs? I wonder what is your recommendation for upgrading code in the long-term?

Thank you,

@timholy
Copy link
Owner

timholy commented Aug 25, 2018

This package is really about choosing which resource you want for a specific computation. In ImageFiltering you can run imfilter(CPUThreads(), img, kernel) and imfilter(CPU1(), img, kernel) in the same session, and therefore accurately benchmark the difference.

With regards to loading "glue" code I would switch to Requires. The mechanism documented here was reliable back in an era when Requires was pretty hacky (it did some crazy stuff), but Requires has become a better citizen and it's now better to use it.

A PR to change the README would be most appreciated!

@juliohm
Copy link
Author

juliohm commented Aug 25, 2018

Thank you, my short-term plan is to use Requires.jl to load both OpenCL.jl and CLFFT.jl as dependencies and load the related code in ImageQuilting.jl.

In the long-term, however, I would like to migrate the OpenCL imfilter implementation I have there to ImageFiltering.jl, and use ComputationalResources.jl to dispatch it: https://github.com/juliohm/ImageQuilting.jl/blob/master/src/imfilter_gpu.jl

Does it sound like a reasonable way forward?

@timholy
Copy link
Owner

timholy commented Aug 25, 2018

That's precisely how it should work 😄. Great plan.

@juliohm
Copy link
Author

juliohm commented Oct 12, 2018

Closing this one as the plan is clear 👍

@juliohm juliohm closed this as completed Oct 12, 2018
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

No branches or pull requests

2 participants