launch.h - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
HTML git clone git://src.adamsgaard.dk/sphere
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
launch.h (665B)
---
1 // launch.h -- backend-agnostic kernel launch macro.
2 // The argument list is passed parenthesized, e.g.
3 // KERNEL_LAUNCH(interact, dimGrid, dimBlock, 0, (dev_x, dev_vel));
4 // so commas inside it never split macro arguments, and templated kernels
5 // like setNSghostNodes<Float3> work as the kernel argument.
6 #ifndef LAUNCH_H_
7 #define LAUNCH_H_
8
9 #ifdef SPHERE_GPU
10 #define KERNEL_LAUNCH(kernel, grid, block, smem, args) \
11 kernel<<<(grid), (block), (smem)>>>args
12 #else
13 #define KERNEL_LAUNCH(kernel, grid, block, smem, args) \
14 cpuKernelLaunch((grid), (block), (smem), [&] { kernel args; })
15 #endif
16
17 #endif
18 // vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4