Skip to content
Snippets Groups Projects
Commit 001284f0 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

corrected streaming bug and updated makefile

parent c5e7d59c
No related branches found
No related tags found
No related merge requests found
...@@ -142,17 +142,14 @@ let collision [n] (f_in: [9][n]f64)(tau: f64): [9][n]f64 = ...@@ -142,17 +142,14 @@ let collision [n] (f_in: [9][n]f64)(tau: f64): [9][n]f64 =
-- ) -- )
-- propagation phase -- propagation phase
let propagation [n] (f_out: [9][n]f64)(nx: i32)(ny: i32): [9][n]f64 = let propagation [n] (f_out: [9][n]f64)(nx: i32)(ny: i32): *[9][n]f64 =
unsafe unsafe
tabulate_2d 9 n (\i ind-> unflatten(9)(n) (flatten_3d (tabulate_3d 9 nx ny (\i x y ->
let y = ind / nx
let x = ind - nx * y
let next_x = (x-(i32.f64 c[i].1) + nx) % nx let next_x = (x-(i32.f64 c[i].1) + nx) % nx
let next_y = (y-(i32.f64 c[i].2) + ny) % ny let next_y = (y-(i32.f64 c[i].2) + ny) % ny
in f_out[i, (next_x + nx * next_y)] in f_out[i, (next_y + ny * next_x)]
) )))
-- executes one iteration of Lattice-Boltzmann -- executes one iteration of Lattice-Boltzmann
-- which means it takes an f_in and updates it -- which means it takes an f_in and updates it
......
CUDA=false
OPENCL=true
SDL=false
TARGET=c TARGET=c
SDL=true
ifeq ($(CUDA),true) ifeq ($(TARGET),cuda)
CUDALIBS=-lcudart -lcuda -lnvrtc CUDALIBS=-lcudart -lcuda -lnvrtc
TARGET=cuda else ifeq ($(TARGET),opencl)
endif
ifeq ($(OPENCL),true)
OPENCLIBS=-lOpenCL OPENCLIBS=-lOpenCL
TARGET=opencl
endif endif
ifeq ($(SDL),true) ifeq ($(SDL),true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment