pystencils.codegen.gpu_indexing.GpuLaunchConfiguration#

class pystencils.codegen.gpu_indexing.GpuLaunchConfiguration#

Base class for launch configurations for CUDA and HIP kernels.

Parameters:
  • block_size – A triple of lambdas determining the GPU block size

  • grid_size – A triple of lambdas determining the GPU grid size

  • config_parameters – Set containing all parameters to the given lambdas that are not also parameters to the associated kernel

abstract property block_size: tuple[int, int, int] | None#

Returns desired block size if available.

abstract property parameters: frozenset[Parameter]#

Parameters of this launch configuration

abstract evaluate(**kwargs)#

Compute block and grid size for a kernel launch.

Parameters:

kwargs – Valuation providing a value for each parameter listed in parameters

Return type:

tuple[tuple[int, int, int], tuple[int, int, int]]

abstract jit_cache_key()#

Return a hashable object that represents any user-configurable options of this launch configuration, such that when the configuration changes, the JIT parameter cache is invalidated.

Return type:

Any

static get_default_block_size(rank)#

Returns the default block size configuration used by the generator.

Return type:

tuple[int, int, int]

Parameters:

rank (int)