Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions include/ghex/device/cuda/event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ struct cuda_event
if (!m_moved) { GHEX_CHECK_CUDA_RESULT_NO_THROW(cudaEventDestroy(m_event)) }
}

/**
* @brief Returns `true` if `*this` has been moved, i.e. can no longer be used.
*
* @todo The semantic of this function is a bit confusing as a valid object returns
* `false`. It should be changed such that a valid object returns `true` and an
* invalid one returns `false`. This is the behaviour for `GHEX_C_STRUCT` and
* `GHEX_C_MANAGED_STRUCT` but not for `stream` and `cuda_event`.
*/
operator bool() const noexcept { return m_moved; }
operator bool() const noexcept { return !m_moved; }

cudaEvent_t& get() noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion include/ghex/device/cuda/event_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct event_pool
while (!(m_next_event < m_events.size())) { m_events.emplace_back(cuda_event()); }

const std::size_t event_to_use = m_next_event;
assert(!bool(m_events[event_to_use]));
assert(bool(m_events[event_to_use]));
m_next_event += 1;
return m_events[event_to_use];
}
Expand Down
10 changes: 1 addition & 9 deletions include/ghex/device/cuda/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@ struct stream
if (!m_moved) { GHEX_CHECK_CUDA_RESULT_NO_THROW(cudaStreamDestroy(m_stream)) }
}

/**
* @brief Returns `true` if `*this` has been moved, i.e. can no longer be used.
*
* @todo The semantic of this function is a bit confusing as a valid object returns
* `false`. It should be changed such that a valid object returns `true` and an
* invalid one returns `false`. This is the behaviour for `GHEX_C_STRUCT` and
* `GHEX_C_MANAGED_STRUCT` but not for `stream` and `cuda_event`.
*/
operator bool() const noexcept { return m_moved; }
operator bool() const noexcept { return !m_moved; }

operator cudaStream_t() const noexcept
{
Expand Down
Loading