CUDA 13.4 samples update - v13.4-public

Release 13.4 of the CUDA Samples supported by CUDA Toolkit 13.4.
See Changelog for more information.
This commit is contained in:
Dheemanth
2026-09-09 15:07:08 -07:00
committed by GitHub
parent b7c5481c55
commit 5443602d89
871 changed files with 6843 additions and 321849 deletions

View File

@@ -53,14 +53,22 @@ except ImportError as e:
sys.exit(1)
def main() -> bool:
"""Run prefix sum sample. Returns True if all tests passed."""
def main() -> int:
"""Run prefix sum sample. Returns 0 if all tests passed."""
print("=" * 60)
print("Prefix Sum (Scan) - Using cuda.compute")
print("=" * 60)
device = Device(0)
device.set_current()
# cuda.compute allocates temporary storage from the device's default memory
# pool, which requires CUDA memory-pool support. This is not available on
# every platform (for example, Windows in TCC mode).
if not device.properties.memory_pools_supported:
print("CUDA memory pools are not supported on this platform.")
return 2
stream = device.create_stream()
cp_stream = cp.cuda.Stream.from_external(stream)
@@ -187,13 +195,11 @@ def main() -> bool:
print("• cuda.core Stream integrates with CuPy via Stream.from_external")
print("• Applications: stream compaction, radix sort, histograms")
print("=" * 60)
return ok
return 0 if ok else 1
finally:
cp.cuda.Stream.null.use()
stream.close()
if __name__ == "__main__":
success = main()
if not success:
sys.exit(1)
sys.exit(main())