mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-13 00:08:26 +08:00
Release v13.3 of the CUDA samples with CUDA 13.3 Toolkit (#435)
This is the release of the CUDA 13.3 samples, which include additions for CUDA Tile C++, and updated CCCL and Python samples.
This commit is contained in:
@@ -28,7 +28,7 @@ This sample demonstrates CuPy integration with cuda.core streams:
|
||||
stream = device.create_stream()
|
||||
|
||||
# Use with CuPy operations
|
||||
cp.cuda.ExternalStream(int(stream.handle)).use()
|
||||
cp.cuda.Stream.from_external(stream).use()
|
||||
```
|
||||
|
||||
## Key APIs
|
||||
@@ -43,7 +43,7 @@ cp.cuda.ExternalStream(int(stream.handle)).use()
|
||||
|
||||
- `cp.fft.rfft()` - Real-to-complex FFT (GPU-accelerated via cuFFT)
|
||||
- `cp.fft.rfftfreq()` - Generate frequency bins for rfft
|
||||
- `cp.cuda.ExternalStream()` - Interop with cuda.core streams
|
||||
- `cp.cuda.Stream.from_external()` - Interop with cuda.core streams
|
||||
|
||||
### From NumPy:
|
||||
|
||||
@@ -115,7 +115,7 @@ VERIFICATION
|
||||
GPU vs CPU FFT magnitude: Test PASSED
|
||||
|
||||
Frequency Detection Accuracy:
|
||||
440 Hz: ✓
|
||||
440 Hz: [OK]
|
||||
...
|
||||
|
||||
Done
|
||||
|
||||
@@ -180,7 +180,7 @@ def run_fft_analysis(
|
||||
print(f"Compute Capability: sm_{device.arch}")
|
||||
|
||||
# Make CuPy use our cuda.core stream
|
||||
cp.cuda.ExternalStream(int(stream.handle)).use()
|
||||
cp.cuda.Stream.from_external(stream).use()
|
||||
|
||||
# Define test signal: composite of multiple frequencies
|
||||
test_frequencies = [440.0, 880.0, 1320.0, 2000.0, 5000.0] # Hz
|
||||
@@ -208,7 +208,7 @@ def run_fft_analysis(
|
||||
print("GPU FFT (cuFFT)")
|
||||
print("-" * 60)
|
||||
|
||||
event_opts = EventOptions(enable_timing=True)
|
||||
event_opts = EventOptions(timing_enabled=True)
|
||||
|
||||
# Warmup
|
||||
d_fft_result = cp.fft.rfft(d_signal)
|
||||
@@ -291,7 +291,7 @@ def run_fft_analysis(
|
||||
all_found = True
|
||||
for expected_freq in test_frequencies:
|
||||
found = any(abs(f - expected_freq) < 10 for f in detected_freqs)
|
||||
status = "✓" if found else "✗"
|
||||
status = "[OK]" if found else "[FAIL]"
|
||||
print(f" {expected_freq:6.0f} Hz: {status}")
|
||||
all_found = all_found and found
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# FFT Signal Analysis Requirements
|
||||
|
||||
cuda-python>=13.0.0
|
||||
cuda-core>=0.6.0
|
||||
cupy-cuda13x>=13.0.0
|
||||
cuda-core>=1.0.0
|
||||
cupy-cuda13x>=14.0.0
|
||||
numpy>=2.3.2
|
||||
|
||||
Reference in New Issue
Block a user