PY-CUDA0004 · blocking_raw_memory_operation_in_stream_scope
Count blocking raw CUDA memory operations in Python stream scopes.
This is a deterministic rule for python. Read its implementation.
Definition
Section titled “Definition”Report synchronous allocation, copy, or free calls from cuda.bindings in a module that
creates streams. Stream-ordered buffers and asynchronous copies retain concurrency and express
ownership more safely through cuda.core.
Evidence
Section titled “Evidence”Each finding identifies the raw blocking call. The value is the number of blocking memory operations in stream-using modules.
Exceptions
Section titled “Exceptions”Initialization before any concurrent work and final teardown may be deliberate. A project can keep those isolated calls with measured evidence. Asynchronous raw APIs are accepted.
Examples
Section titled “Examples”stream = device.create_stream()runtime.cudaMemcpy(target, source, size, kind)target.copy_from(source, stream=stream)References
Section titled “References”- Cites “cuda.core documentation”, buffer copies and stream-ordered memory. Open reference
- Cites “cuda.core documentation”, Buffer asynchronous release. Open reference