// Actual production step kernels under a CPU launch shim. No CUDA claim. #include #include #include #include #define __device__ #define __constant__ #define __global__ #define __forceinline__ inline #define __launch_bounds__(...) #define LATTICE_D2Q9 0 #define LATTICE_D3Q19 1 #define LATTICE_MODEL 0 #define NQ 9 #define DIM 2 #define NZ 1 #define NT 1 #define COLLISION_MODEL 0 #define BLOCK_ROOT_BC 2 #define USE_LES 0 #define RHO 1.f #define U0 .025f #define OMEGA_COLLISION_MIN .01f #define OMEGA_COLLISION_MAX 1.99f #define Y_WALL_BC 0 #define OUTLET_MODE 0 struct Dim {unsigned int x=0,y=0,z=0;} threadIdx,blockIdx,blockDim; inline float __fdiv_rn(float a,float b){return a/b;} #include "core/precision.cuh" #include "core/descriptors.cuh" #include "core/layout.cuh" #include "core/params.cuh" #include "core/flags.cuh" #include "operators/macro.cuh" #include "operators/collision_srt.cuh" #include "streaming/pull_double_buffer.cuh" #if UNIFORM #include "operators/forcing_guo.cuh" #include "operators/helpers.cuh" #include "boundary/bounce_back.cuh" #include "boundary/inlet_outlet.cuh" #include "step/one_step_double.cu" #else constexpr unsigned char KIND_OUTER=2; #include "step/block_channel.cu" #endif int main(){ constexpr int gx=24,gy=20,n=gx*gy; std::vector state(9*n),next(9*n); for(int q=0;q<9;q++)for(int y=0;y flags(n,FLAG_FLUID); for(int y=0;y input(nbx*nby*9*TOTAL_CELLS),output(input.size()); d_block_channel={gx,gy,U0}; #endif for(int step=0;step<5;step++){ #if UNIFORM for(int y=0;y