From 3aac7ea915ce5178dda7ef2348e07c491ad73b7d Mon Sep 17 00:00:00 2001 From: Rui Luo Date: Wed, 22 Oct 2025 15:30:45 +0800 Subject: [PATCH 1/2] Add numpy version check in examples/thread_block_cluster.py --- cuda_core/examples/thread_block_cluster.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cuda_core/examples/thread_block_cluster.py b/cuda_core/examples/thread_block_cluster.py index c1785022e3..852e47e1ca 100644 --- a/cuda_core/examples/thread_block_cluster.py +++ b/cuda_core/examples/thread_block_cluster.py @@ -21,6 +21,11 @@ ProgramOptions, launch, ) +from packaging import version + +if version.parse(np.__version__) < version.parse("2.2.5"): + print("This example requires NumPy 2.2.5 or later", file=sys.stderr) + sys.exit(0) # prepare include cuda_path = os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME")) From ea6be6ec78aa9b8fb29f2e2182932bafb2a72f31 Mon Sep 17 00:00:00 2001 From: Rui Luo Date: Thu, 23 Oct 2025 09:05:24 +0800 Subject: [PATCH 2/2] Add numpy version check in examples/thread_block_cluster.py --- cuda_core/examples/thread_block_cluster.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cuda_core/examples/thread_block_cluster.py b/cuda_core/examples/thread_block_cluster.py index 852e47e1ca..e14158f8bd 100644 --- a/cuda_core/examples/thread_block_cluster.py +++ b/cuda_core/examples/thread_block_cluster.py @@ -21,9 +21,8 @@ ProgramOptions, launch, ) -from packaging import version -if version.parse(np.__version__) < version.parse("2.2.5"): +if np.lib.NumpyVersion(np.__version__) < "2.2.5": print("This example requires NumPy 2.2.5 or later", file=sys.stderr) sys.exit(0)