warp.get_cuda_kernel_properties#

warp.get_cuda_kernel_properties(kernel, device=None, block_dim=None)[source]#

Return properties of a compiled CUDA kernel.

The result contains "register_count" in registers per thread and "local_memory_size" in bytes per thread. Values may vary with the device, CUDA toolchain, Warp version, compilation options, and block_dim. Future Warp releases may add keys.

Parameters:
  • kernel – A concrete @warp.kernel-decorated kernel or explicitly constructed warp.Kernel. For a generic kernel, pass an overload returned by warp.overload().

  • device (Device | str | None) – The target CUDA device. If None, use the default device, which must be CUDA.

  • block_dim (int | None) – Threads per block for the compiled variant. If None, use the kernel module default.

Returns:

The complete dictionary of exposed CUDA kernel properties.

Raises:
  • TypeError – If kernel is not a Warp kernel.

  • ValueError – If device is not a valid device identifier or block_dim is not a positive integer.

  • RuntimeError – If kernel is generic, device is not a CUDA device, or loading or the native query fails.

Return type:

dict[str, int]