add mixed gradient to cuda
This commit is contained in:
parent
10c5711346
commit
90afe56ead
@ -1,5 +1,7 @@
|
|||||||
/* Implement Mixed Gradient (Lee et al. JCP 2016)*/
|
/* Implement Mixed Gradient (Lee et al. JCP 2016)*/
|
||||||
#include <cuda.h>
|
#include <cuda.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <cuda_profiler_api.h>
|
||||||
|
|
||||||
#define NBLOCKS 560
|
#define NBLOCKS 560
|
||||||
#define NTHREADS 128
|
#define NTHREADS 128
|
||||||
@ -11,12 +13,13 @@ __global__ void dvc_ScaLBL_D3Q19_MixedGradient(int *Map, double *Phi, double *Gr
|
|||||||
{1,0,1},{-1,0,-1},{1,0,-1},{-1,0,1},
|
{1,0,1},{-1,0,-1},{1,0,-1},{-1,0,1},
|
||||||
{0,1,1},{0,-1,-1},{0,1,-1},{0,-1,1}};
|
{0,1,1},{0,-1,-1},{0,1,-1},{0,-1,1}};
|
||||||
|
|
||||||
int i,j,k,n,N;
|
int i,j,k,n,N,idx;
|
||||||
int np,np2,nm; // neighbors
|
int np,np2,nm; // neighbors
|
||||||
double v,vp,vp2,vm; // values at neighbors
|
double v,vp,vp2,vm; // values at neighbors
|
||||||
double grad;
|
double grad;
|
||||||
|
N = Nx*Ny*Nz;
|
||||||
|
|
||||||
int S = N/NBLOCKS/NTHREADS + 1;
|
int S = Np/NBLOCKS/NTHREADS + 1;
|
||||||
for (int s=0; s<S; s++){
|
for (int s=0; s<S; s++){
|
||||||
|
|
||||||
//........Get 1-D index for this thread....................
|
//........Get 1-D index for this thread....................
|
||||||
|
@ -26,5 +26,5 @@ cmake \
|
|||||||
-D USE_TIMER=0 \
|
-D USE_TIMER=0 \
|
||||||
~/LBPM-WIA
|
~/LBPM-WIA
|
||||||
|
|
||||||
make VERBOSE=1 -j8 && make install
|
make VERBOSE=1 -j4 && make install
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user