From a8141d399e79f945bc18493363a27f84bf313aee Mon Sep 17 00:00:00 2001 From: "Joao V. F. Lima" Date: Mon, 26 Jul 2010 16:18:32 -0300 Subject: [PATCH] Fix. --- lbm/gpu/Makefile | 6 ++++-- lbm/gpu/lb.cu | 12 ++++-------- lbm/gpu/main.cu | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lbm/gpu/Makefile b/lbm/gpu/Makefile index 46f11bd..f932bdb 100644 --- a/lbm/gpu/Makefile +++ b/lbm/gpu/Makefile @@ -1,9 +1,11 @@ CC := nvcc -CFLAGS := +CFLAGS := PROGS := lb +LDFLAGS := +all: $(PROGS) lb: lb.cu main.cu - nvcc --compiler-options -fpermissive -o $@ $^ # sem o fpermissive nao funciona no gcc4.4 + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) clean: rm -f $(PROGS) *.o diff --git a/lbm/gpu/lb.cu b/lbm/gpu/lb.cu index 85dc9b6..aa4b60e 100644 --- a/lbm/gpu/lb.cu +++ b/lbm/gpu/lb.cu @@ -10,7 +10,8 @@ lb::lb() {} -__device__ inline unsigned int pos( const int x, const int y, +__device__ inline +unsigned int pos( const int x, const int y, const int n ) { return ( y * n + x ); @@ -44,7 +45,7 @@ void lb::read( const char *parameters, const char *obstacles ) obs >> i; obs >> j; // TODO: problema aqui com indices e entrada - obst[pos(i-1,j-1)] = true; + obst[pos(i,j)] = true; //obst[pos(i,j)] = true; c++; } @@ -57,11 +58,6 @@ void lb::resize( const int n ) f0.resize( n ); f1.resize( n ); f2.resize( n ); f3.resize( n ); f4.resize( n ); f5.resize( n ); f6.resize( n ); f7.resize( n ); f8.resize( n ); - /* - d_f0.resize( n ); d_f1.resize( n ); d_f2.resize( n ); d_f3.resize( n ); - d_f4.resize( n ); d_f5.resize( n ); d_f6.resize( n ); d_f7.resize( n ); - d_f8.resize( n ); - */ d_tf0.resize( n ); d_tf1.resize( n ); d_tf2.resize( n ); d_tf3.resize( n ); d_tf4.resize( n ); d_tf5.resize( n ); d_tf6.resize( n ); d_tf7.resize( n ); d_tf8.resize( n ); @@ -474,7 +470,7 @@ void lb::relaxation( void ) void lb::write_results( const char *file ) { //local variables - int x, y, i; + int x, y; bool obsval; float u_x, u_y, d_loc, press; diff --git a/lbm/gpu/main.cu b/lbm/gpu/main.cu index 061aaf7..70d13f3 100644 --- a/lbm/gpu/main.cu +++ b/lbm/gpu/main.cu @@ -9,7 +9,7 @@ int main( int argc, char **argv ) { lb lbm; double tdelta; - float vel; + //float vel; struct timeval t1, t2; lbm.read( argv[1], argv[2] ); -- 2.11.4.GIT