PY-CUDA0001 · direct_cuda_core_lifecycle_construction
Count direct construction of CUDA core stream and context wrappers.
This is a deterministic rule for python. Read its implementation.
Definition
Section titled “Definition”Report direct calls to cuda.core.Stream or cuda.core.Context. Their constructors are not a
supported ownership boundary. Streams come from Device.create_stream, and contexts come from
a device or stream that already owns the correct CUDA context.
Evidence
Section titled “Evidence”Each finding identifies the direct constructor call. The value is the number of unsupported stream or context constructions.
Exceptions
Section titled “Exceptions”Stream.from_handle is accepted because it explicitly borrows or wraps an existing stream.
Device.create_stream is accepted because the device establishes ownership and context.
Examples
Section titled “Examples”stream = Stream()device = Device()stream = device.create_stream()References
Section titled “References”- Cites “cuda.core documentation”, Stream construction. Open reference
- Cites “cuda.core documentation”, Context construction. Open reference