Skip to content

Instantly share code, notes, and snippets.

@tkf
Created October 10, 2020 21:55
Show Gist options
  • Save tkf/23e15e3010affbc0fc4edc1a4c0e3807 to your computer and use it in GitHub Desktop.
Save tkf/23e15e3010affbc0fc4edc1a4c0e3807 to your computer and use it in GitHub Desktop.
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