pystencils.codegen.gpu_indexing.GpuIndexing

pystencils.codegen.gpu_indexing.GpuIndexing#

class pystencils.codegen.gpu_indexing.GpuIndexing(ctx, target, scheme, warp_size, manual_launch_grid=False, assume_warp_aligned_block_size=False)#

Factory for GPU indexing objects required during code generation.

This class acts as a helper class for the code generation driver. It produces both the ThreadMapping required by the backend, as well as factories for the launch configuration required later by the runtime system.

Parameters:
  • ctx (KernelCreationContext) – The kernel creation context

  • scheme (GpuIndexingScheme) – The desired GPU indexing scheme

  • block_size – A user-defined default block size, required only if the indexing scheme permits modification of the block size

  • manual_launch_grid (bool) – If True, always emit a ManualLaunchConfiguration to force the runtime system to set the launch configuration explicitly

  • target (Target)

  • warp_size (int | None)

  • assume_warp_aligned_block_size (bool)

get_thread_mapping()#

Retrieve a thread mapping object for use by the backend

Return type:

ThreadMapping

get_launch_config_factory()#

Retrieve a factory for the launch configuration for later consumption by the runtime system

Return type:

Callable[[], GpuLaunchConfiguration]