Created
October 10, 2020 21:55
-
-
Save tkf/23e15e3010affbc0fc4edc1a4c0e3807 to your computer and use it in GitHub Desktop.
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
using FLoops | |
using CUDA | |
function demo1(ex, xs = CUDA.ones(3)) | |
z = zero(eltype(xs)) | |
@floop FallbackEx() for x in xs | |
@reduce(s = z + x) | |
end | |
return s | |
end | |
function demo2(ex, xs = CUDA.ones(3)) | |
@floop FallbackEx() for x in xs | |
@reduce(s += x) | |
end | |
return s | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment