Skip to content

Support cuda.bench.State.set_stream method #440

Description

@oleksandr-pavlyk

cuda.bench currently does not support use case exemplified in examples/stream.cu we user can specify an existing stream to be used for benchmarking.

The proposed API would be cuda.bench.State.set_stream(stream_provider), where

  1. stream_provider is not an instance of type cuda.bench.CudaStream
    • needed to avoid lifetime footguns
  2. stream_provider must support __cuda_stream__ protocol, which cuda.core.Stream does.

The stream would be set only if the handle in __cuda_stream__ is different from the one held by underlying nvbench::state object to avoid lifetime footgun issues.

Perhaps a dedicated convenience method cuda.bench.State.set_default_stream() should be implemented as well.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions