@@ -18,15 +18,15 @@ class LaunchConfig:
1818
1919 Attributes
2020 ----------
21- grid : Union[ tuple, int]
21+ grid : tuple | int
2222 Collection of threads that will execute a kernel function. When cluster
2323 is not specified, this represents the number of blocks, otherwise
2424 this represents the number of clusters.
25- cluster : Union[ tuple, int]
25+ cluster : tuple | int
2626 Group of blocks (Thread Block Cluster) that will execute on the same
2727 GPU Processing Cluster (GPC). Blocks within a cluster have access to
2828 distributed shared memory and can be explicitly synchronized.
29- block : Union[ tuple, int]
29+ block : tuple | int
3030 Group of threads (Thread Block) that will execute on the same
3131 streaming multiprocessor (SM). Threads within a thread blocks have
3232 access to shared memory and can be explicitly synchronized.
@@ -35,23 +35,29 @@ class LaunchConfig:
3535 (Default to size 0)
3636 is_cooperative : bool, optional
3737 Whether this config can be used to launch a cooperative kernel.
38+ programmatic_stream_serialization : bool, optional
39+ Whether to allow programmatic stream serialization (PDL). When True,
40+ the kernel may overlap with a previous kernel in the same stream that
41+ signals completion via programmatic means.
3842 """
3943
40- def __init__ (self , grid : int | tuple [int , ...] | None = None , cluster : int | tuple [int , ...] | None = None , block : int | tuple [int , ...] | None = None , shmem_size : int | None = None , is_cooperative : bool = False ) -> None :
44+ def __init__ (self , grid : int | tuple [int , ...] | None = None , cluster : int | tuple [int , ...] | None = None , block : int | tuple [int , ...] | None = None , shmem_size : int | None = None , is_cooperative : bool = False , programmatic_stream_serialization : bool = False ) -> None :
4145 """Initialize LaunchConfig with validation.
4246
4347 Parameters
4448 ----------
45- grid : Union[ tuple, int] , optional
49+ grid : tuple | int, optional
4650 Grid dimensions (number of blocks or clusters if cluster is specified)
47- cluster : Union[ tuple, int] , optional
51+ cluster : tuple | int, optional
4852 Cluster dimensions (Thread Block Cluster)
49- block : Union[ tuple, int] , optional
53+ block : tuple | int, optional
5054 Block dimensions (threads per block)
5155 shmem_size : int, optional
5256 Dynamic shared memory size in bytes (default: 0)
5357 is_cooperative : bool, optional
5458 Whether to launch as cooperative kernel (default: False)
59+ programmatic_stream_serialization : bool, optional
60+ Whether to allow programmatic stream serialization / PDL (default: False)
5561 """
5662
5763 def _identity (self ) -> tuple [Any , ...]:
@@ -65,7 +71,8 @@ class LaunchConfig:
6571
6672 def __hash__ (self ) -> int :
6773 ...
68- _LAUNCH_CONFIG_ATTRS = ('grid' , 'cluster' , 'block' , 'shmem_size' , 'is_cooperative' )
74+ _LAUNCH_CONFIG_ATTRS = ('grid' , 'cluster' , 'block' , 'shmem_size' , 'is_cooperative' , 'programmatic_stream_serialization' )
75+ __all__ = ['LaunchConfig' ]
6976
7077def _to_native_launch_config (config : LaunchConfig ) -> object :
7178 """Convert LaunchConfig to native driver CUlaunchConfig.
0 commit comments