cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
event.hpp File Reference

A CUDA event wrapper class and some associated free-standing functions. More...

#include "types.hpp"
#include <chrono>
#include "constants.hpp"
#include "current_device.hpp"
#include "error.hpp"
#include "ipc.hpp"
Include dependency graph for event.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cuda::event_t
 Wrapper class for a CUDA event. More...
 

Namespaces

 cuda
 Definitions and functionality wrapping CUDA APIs.
 
 cuda::event
 CUDA timing functionality, via events and their related code (not including the event wrapper type event_t itself)
 

Typedefs

using cuda::event::duration_t = ::std::chrono::duration< float, ::std::milli >
 The type used by the CUDA Runtime API to represent the time difference between pairs of events.
 

Functions

event_t cuda::event::wrap (device::id_t device_id, context::handle_t context_handle, handle_t event_handle, bool take_ownership=false, bool hold_pc_refcount_unit=false) noexcept
 Wrap an existing CUDA event in a event_t instance. More...
 
::std::string cuda::event::identify (const event_t &event)
 
void cuda::wait (const event_t &event)
 Have the calling thread wait - either busy-waiting or blocking - and return only after this event has occurred (see event_t::has_occurred() More...
 
duration_t cuda::event::time_elapsed_between (const event_t &start, const event_t &end)
 Determine (inaccurately) the elapsed time between two events. More...
 
duration_t cuda::event::time_elapsed_between (const ::std::pair< const event_t &, const event_t &> &event_pair)
 
event_t cuda::event::create (const device_t &device, bool uses_blocking_sync=sync_by_busy_waiting, bool records_timing=do_record_timings, bool interprocess=not_interprocess)
 creates a new event on (the primary execution context of) a device. More...
 
event_t cuda::event::create (const context_t &context, bool uses_blocking_sync=sync_by_busy_waiting, bool records_timing=do_record_timings, bool interprocess=not_interprocess)
 creates a new event. More...
 
void cuda::synchronize (const event_t &event)
 

Detailed Description

A CUDA event wrapper class and some associated free-standing functions.