gaioguys / GAIO.jl

A Julia package for set oriented computations.
MIT License
9 stars 4 forks source link

:gpu flag not working? #61

Closed gaioguy closed 2 years ago

gaioguy commented 2 years ago

On the current master, I am running

using GAIO

const σ, ρ, β = 10.0f0, 28.0f0, 0.4f0
v((x,y,z)) = (σ*(y-x), ρ*x-y-x*z, x*y-β*z)

center, radius = (0,0,25), (30,30,30)
Q = Box(center, radius)
P = BoxPartition(Q, (128,128,128))
x = (sqrt(β*(ρ-1)), sqrt(β*(ρ-1)), ρ-1)

F(x) = rk4_flow_map(v, x, 0.0001f0, 2000)

G = BoxMap(F, P; no_of_points=200)
G_gpu = BoxMap(F, P, :gpu; no_of_points=200)

@time W = unstable_set!(G, P[x])
@time W = unstable_set!(G_gpu, P[x])

and obtain the following output:

 24.251723 seconds (419.31 k allocations: 31.015 MiB, 0.43% compilation time)
23455-element BoxSet in 128 x 128 x 128  BoxPartition

 27.616515 seconds (48.46 k allocations: 10.892 MiB, 0.13% compilation time)
23773-element BoxSet in 128 x 128 x 128  BoxPartition

I was expecting the accelerated version to be (much) faster ...