File indexing completed on 2026-07-26 08:22:12
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "traccc/hip/utils/stream.hpp"
0010
0011 #include "hip_error_handling.hpp"
0012 #include "opaque_stream.hpp"
0013 #include "utils.hpp"
0014
0015
0016 #include <hip/hip_runtime_api.h>
0017
0018 namespace traccc::hip {
0019
0020 stream::stream(int device) {
0021
0022 details::select_device dev_selector{
0023 device == INVALID_DEVICE ? details::get_device() : device};
0024
0025
0026 m_stream = std::make_unique<details::opaque_stream>(dev_selector.device());
0027 }
0028
0029 stream::stream(stream&& parent) noexcept = default;
0030
0031 stream::~stream() = default;
0032
0033 stream& stream::operator=(stream&& rhs) noexcept = default;
0034
0035 int stream::device() const {
0036 return m_stream->m_device;
0037 }
0038
0039 void* stream::hipStream() const {
0040 return m_stream->m_stream;
0041 }
0042
0043 void stream::synchronize() const {
0044 TRACCC_HIP_ERROR_CHECK(hipStreamSynchronize(m_stream->m_stream));
0045 }
0046
0047 }