pystencils.backend.platforms.GenericGpu#
- class pystencils.backend.platforms.GenericGpu(ctx, indexing_rank, default_block_size, *, assume_warp_aligned_block_size=False, warp_size=None, use_cub_reductions=False)#
Common base platform for CUDA- and HIP-type GPU targets.
- Parameters:
ctx (
KernelCreationContext) – The kernel creation contextassume_warp_aligned_block_size (
bool) –Trueif the platform can assume that total GPU block sizes at runtime will always be a multiple of the warp sizeindexing_rank (int)
default_block_size (dim3 | None)
use_cub_reductions (bool)
- property required_headers: set[str]#
Set of header files that must be included at the point of definition of a kernel running on this platform.
- static gen_warp_reduce(symbol_expr, op, warp_size, mask_size=8)#
Set up shuffle instructions for warp-level reduction
- Return type:
tuple[PsExpression,list[PsStructuralNode]]- Parameters:
symbol_expr (PsSymbolExpr)
op (ReductionOp)
warp_size (int)
mask_size (int)
- select_function(call)#
Select an implementation for the given function on the given data type.
If no viable implementation exists, raise a
MaterializationError.- Return type:
- Parameters:
call (PsCall)