aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-02-02Implement basic multi-cuboid communication for CUDA targetHEADmasterAdrian Kummerlaender
2020-02-02Rename 'collide_and_stream' to 'collide'Adrian Kummerlaender
Streaming is only implicit depending on the selected propagation pattern.
2020-01-17Implement AA for CUDA targetAdrian Kummerlaender
2020-01-11Implement SSS for OpenCL targetAdrian Kummerlaender
Sadly OpenCL kernels don't accept pointer-to-pointer arguments which complicates the control structure implementation. A workaround is to cast them into `uintptr_t` which is guaranteed to be large enough to fit any pointer on the device. Special care has to be taken to always perform the pointer shifts on actual floating point pointers and not on type-less pointers.
2019-11-12Match OpenCL and CUDA cell list dispatch templatesAdrian Kummerlaender
2019-11-12Fix order of CSE and pow2 expansionAdrian Kummerlaender
This way the expanded call to pow2 is resolved into a common subexpression.
2019-11-10Implement basic CUDA targetAdrian Kummerlaender
Currently only for the SSS streaming pattern. CudaCodePrinter in `utility/printer.py` is required to add a 'f' suffix to all single precision floating point literals. If this is not done (when targeting single precision) most calculations happen in double precision which destroys performance. (In OpenCL this is not necessary as we can simply set the `-cl-single-precision-constant` flag. Sadly such a flag doesn't seem to exist for nvcc.)
2019-11-09Add support for population padding to SOA layoutAdrian Kummerlaender
2019-11-09Implement basic version of the SSS pattern for C++ targetAdrian Kummerlaender
An interesting extension of the AA pattern. The main advantage of this is that updating pointers in a control structure is much more elegant than duplicating all function implementations as is required by the normal AA pattern. For more details see [1]. Only works for the SOA layout. On a pure memory access level this pattern is equivalent to the AA pattern. The difference is how the memory locations are calculated (by pointer swap & shift or by different indexing functions for odd and even time steps). [1]: "An auto-vectorization friendly parallel lattice Boltzmann streaming scheme for direct addressing" by Mohrhard et al. (2019)
2019-11-09Add optional OpenGL interop helper function for OpenCL targetAdrian Kummerlaender
2019-11-09Mark equilibrilize, momenta result values as constAdrian Kummerlaender
Doesn't change the outcome but is more in line how the rest of the generated code looks like.
2019-11-08Rename OpenCL cell list wrapper functionsAdrian Kummerlaender
2019-11-06Check whether template for requested streaming pattern existsAdrian Kummerlaender
2019-11-05Update READMEAdrian Kummerlaender
2019-11-05Implement AA pattern for OpenCL targetAdrian Kummerlaender
Works well but function naming is getting kind of clunky, e.g. "velocity_momenta_boundary_tick_cells" This could be hidden to a degree by proving branching wrappers for the odd and even time step implementations. However this would not vectorize when targeting Intel via OpenCL.
2019-11-05Add cell index generator method to Geometry classAdrian Kummerlaender
2019-11-05Fix OpenCL vector indexingAdrian Kummerlaender
2019-11-05Implement AA pattern for C++ targetAdrian Kummerlaender
Note that special care has to be taken to provide ghost cells around active cells so the algorithm has somewhere to stream to and from. This is also the case for the AB pattern but there they only have to be equilibrilized once instead of after every other time step. Even when such an equilibrilization is performed there is still a potential bug as inbound populations at the outer boundary are never streamed to (this is not a problem for AB using pull-only streaming). A vectorizable solution may require direction-specific ghost cell equilibrization.
2019-11-04Drop AB suffix from streaming pattern definition namesAdrian Kummerlaender
2019-11-04Extract streaming pattern into Mako definitionsAdrian Kummerlaender
This should allow for plugging in e.g. a AA pattern implementation without without touching any file but `AA.$target.mako`. OpenCL and C++ target templates now look basically the same and could potentially be merged. However this would decrease flexibility should more differences appear in the future. Maintaining separate template files is an acceptable overhead to preserve flexibility.
2019-11-02Improve lattice, model selection error reportingv0.1.2Adrian Kummerlaender
2019-11-02Import `sympy.ccode` inside templates instead of as argumentAdrian Kummerlaender
2019-11-02Restructure LBM model / lattice distinctionAdrian Kummerlaender
2019-10-31Call symbolic generator inside code templatesAdrian Kummerlaender
This paves the way for dropping in other LBM collision models. As a side benefit the default momenta calulcation is now fully inlined where possible.
2019-10-30Move C++ example to boltzgen_examples repositoryAdrian Kummerlaender
2019-10-29Don't try to reuse population layout for moment array indexingv0.1.1Adrian Kummerlaender
2019-10-29Return cell id as string expression when requiredAdrian Kummerlaender
2019-10-29Add support for generating custom templates in boltzgen's contextAdrian Kummerlaender
2019-10-29Rename target module to memoryAdrian Kummerlaender
2019-10-29Move further generator arguments into its constructorAdrian Kummerlaender
2019-10-29Extract cell indexing functionAdrian Kummerlaender
2019-10-29Unify AOS, SOA specific cell preshift between targetsAdrian Kummerlaender
SOA and AOS should not be target specific, neighbor offset calculation / bijection between gid and cell coordinates should be customizable.
2019-10-28Set default order for custom ndindex overloadv0.1.0Adrian Kummerlaender
2019-10-28Use order-accepting ndindex method for generating cell indicesAdrian Kummerlaender
2019-10-28Add basic setup.pyAdrian Kummerlaender
No guarantee for correctness - I mostly fiddled this together in order to use common nixpkgs python package functions for including boltzgen in other shell environments.
2019-10-27Optionally generate cell-list-based OpenCL dispatch functionsAdrian Kummerlaender
Requires different function naming as OpenCL 1.2 doesn't support overloads. The OpenCL kernel code generated using this commit was successfully tested on an actual GPU. Time to set up some automatic validation.
2019-10-27Verify precision parameterAdrian Kummerlaender
2019-10-27Add READMEAdrian Kummerlaender
2019-10-27Accept cell id as parameter in OpenCL functionsAdrian Kummerlaender
It is more flexible to place OpenCL thread ID dependent dispatching in a separate function.
2019-10-27Add bounce back boundary conditionAdrian Kummerlaender
2019-10-27Tidy up shell environmentAdrian Kummerlaender
2019-10-27Use Mako defines to generate momenta boundariesAdrian Kummerlaender
2019-10-27Extract target-dependent floating point type nameAdrian Kummerlaender
2019-10-27Move layout implementations into separate folderAdrian Kummerlaender
2019-10-27Disable bytecode cachingAdrian Kummerlaender
2019-10-27Separate functions into separate template filesAdrian Kummerlaender
Selection of the desired templates is possible via a new `functions` parameter.
2019-10-26Add extra toggle for OpenMP in C++ test functionAdrian Kummerlaender
Yields ~160 MLUPs on a Xeon E3-1241 for D2Q9 double precision lid driven cavity. Obviously not anywhere near what is possible on GPUs but respectable for a CPU implementation. Especially considering how simple it is.
2019-10-26Change C++ test function to LDC with optional VTK outputAdrian Kummerlaender
2019-10-26Generate primitive velocity momenta BC for C++ targetAdrian Kummerlaender
2019-10-26Support passing additional string arguments to the generatorAdrian Kummerlaender