Skip to content

Commit ec275a8

Browse files
committed
Use high priority CUDA streams
1 parent 793c766 commit ec275a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/ghex/device/cuda/stream.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ struct stream
2727
cudaStream_t m_stream;
2828
ghex::util::moved_bit m_moved;
2929

30-
stream(){GHEX_CHECK_CUDA_RESULT(cudaStreamCreateWithFlags(&m_stream, cudaStreamNonBlocking))}
30+
stream() {
31+
int least_priority, greatest_priority;
32+
GHEX_CHECK_CUDA_RESULT(cudaDeviceGetStreamPriorityRange(&least_priority, &greatest_priority))
33+
GHEX_CHECK_CUDA_RESULT(cudaStreamCreateWithPriority(&m_stream, cudaStreamNonBlocking, greatest_priority))
34+
}
3135

3236
stream(const stream&) = delete;
3337
stream& operator=(const stream&) = delete;

0 commit comments

Comments
 (0)