-
Notifications
You must be signed in to change notification settings - Fork 0
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
Trying to make it work on CPU #6
base: master
Are you sure you want to change the base?
Conversation
src/transduce.jl
Outdated
ill = @index(Local, Linear) | ||
igl = @index(Group, Linear) | ||
igl = @uniform @index(Group, Linear) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
igl = @uniform @index(Group, Linear) | |
igl = @index(Group, Linear) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I might need to put it in @uniform
since I'm using it after @synchronize
?
FoldsKernelAbstractions.jl/src/transduce.jl
Lines 173 to 175 in 18c7b8f
if t == 1 | |
@inbounds dest[igl] = shared[1] | |
end |
I can re-fetch the index, there, though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@index
expression are always valid (and automatically inserted into the loop body).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without @uniform
, I'm now getting UndefVarError: igl not defined
: https://github.com/JuliaFolds/FoldsKernelAbstractions.jl/pull/6/checks?check_run_id=1958277481
Actually, I just remember putting it in @uniform
since it was the dependency of other @uniform
variables:
FoldsKernelAbstractions.jl/src/transduce.jl
Lines 151 to 152 in 064aba9
offsetb = (igl - 1) * groupsize()[1] | |
bound = max(0, nbasecases - offsetb) |
src/transduce.jl
Outdated
t = ill | ||
s = 1 | ||
c = nextpow(2, groupsize()[1]) >> 1 | ||
@private m = ill - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this form of @private
is rather slow until KernelCompiler.jl lands. Using the older form is likely faster
Not sure if this is helpful, but I've also played with block-level reduction with KernelAbstractions. I could get it to work on GPU (code similar to the one here), but not on CPU. I tried replacing |
Yeah, I wonder if we need to tweak something in KernelAbstractions.jl or maybe just wait for KernelCompiler.jl cc @vchuravy |
No description provided.