From 001284f09d18b4db206f877f53d75169c0b98cbd Mon Sep 17 00:00:00 2001 From: Orestis Malaspinas <orestis.malaspinas@hesge.ch> Date: Sun, 21 Jul 2019 13:33:01 +0200 Subject: [PATCH] corrected streaming bug and updated makefile --- src/liblbm.fut | 11 ++++------- src/makefile | 13 +++---------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/liblbm.fut b/src/liblbm.fut index b9daf9e..74bbc24 100644 --- a/src/liblbm.fut +++ b/src/liblbm.fut @@ -142,17 +142,14 @@ let collision [n] (f_in: [9][n]f64)(tau: f64): [9][n]f64 = -- ) -- 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 - tabulate_2d 9 n (\i ind-> - let y = ind / nx - let x = ind - nx * y - + unflatten(9)(n) (flatten_3d (tabulate_3d 9 nx ny (\i x y -> let next_x = (x-(i32.f64 c[i].1) + nx) % nx 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 -- which means it takes an f_in and updates it diff --git a/src/makefile b/src/makefile index 86d0ed9..d006422 100644 --- a/src/makefile +++ b/src/makefile @@ -1,17 +1,10 @@ -CUDA=false -OPENCL=true -SDL=false - TARGET=c +SDL=true -ifeq ($(CUDA),true) +ifeq ($(TARGET),cuda) CUDALIBS=-lcudart -lcuda -lnvrtc - TARGET=cuda -endif - -ifeq ($(OPENCL),true) +else ifeq ($(TARGET),opencl) OPENCLIBS=-lOpenCL - TARGET=opencl endif ifeq ($(SDL),true) -- GitLab