Skip to content

Refactor gpu indexing

Markus Holzer requested to merge holzer/pystencils:indexing into master

To map an iteration space to GPU Threads indexing classes are used. These indexing classes receive a field and iterations slice to determine the iteration space. This MR refactors the indexing classes to directly receive an iteration space. With this, the indexing classes are more general and not dependent on pystencils Fields.

Further improvements/fixes:

  • Line indexing works now with iteration slices. This did not work at all before
  • Both indexing schemes calculate a correct block and grid size for iteration slices. This means if for example if only every second element is touched (due to a given iteration slice) the number of threads will be half. This removes modulo calculation that was needed before
  • Both indexing schemes now support up to 4 dimensions
Edited by Markus Holzer

Merge request reports