Skip to content

Commit

Permalink
Use assert instead for validity check
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcrimsontianyu committed Jan 26, 2025
1 parent 3f78be3 commit aff60d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/include/kvikio/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
#pragma once

#include <cassert>
#include <chrono>
#include <cstring>
#include <future>
Expand Down Expand Up @@ -152,7 +153,7 @@ std::tuple<void*, std::size_t, std::size_t> get_alloc_info(const void* devPtr,
template <typename T>
bool is_future_done(const T& future)
{
if (!future.valid()) { return true; }
assert(future.valid());

// If the future is returned from std::async(std::launch::deferred, ...), its state is always
// deferred until wait() is called to make it ready.
Expand Down

0 comments on commit aff60d5

Please sign in to comment.