STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
Concurrency::details::_Amp_runtime_trace Class Reference

#include <amprt.h>

Public Member Functions

_AMPIMP ~_Amp_runtime_trace ()
 
_AMPIMP void _Write_end_event (ULONG _Span_id)
 
void _Add_accelerator_config_event (PVOID _Accelerator_id, LPCWSTR _Device_path, LPCWSTR _Device_description)
 
void _Write_all_accelerator_config_events ()
 
ULONG _Start_accelerator_view_wait_event (PVOID _Accelerator_id, PVOID _Accelerator_view_id)
 
void _Launch_flush_event (PVOID _Accelerator_id, PVOID _Accelerator_view_id)
 
ULONG _Launch_marker (PVOID _Accelerator_id, PVOID _Accelerator_view_id)
 
_AMPIMP ULONG _Start_parallel_for_each_event_helper (_In_ _DPC_call_handle *_Handle)
 
concurrency::completion_future _Start_async_op_wait_event_helper (ULONG _Async_op_id, _Event _Ev)
 
_AMPIMP ULONG _Start_array_view_synchronize_event_helper (const _Buffer_descriptor &_Buff_desc)
 
_AMPIMP ULONG _Launch_array_view_synchronize_event_helper (const _Buffer_descriptor &_Buff_desc)
 
_AMPIMP ULONG _Start_copy_event_helper (const _Buffer_descriptor &_Src, const _Buffer_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Start_copy_event_helper (nullptr_t, const _Buffer_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Start_copy_event_helper (const _Buffer_descriptor &_Src, nullptr_t, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Launch_async_copy_event_helper (const _Buffer_descriptor &_Src, const _Buffer_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Launch_async_copy_event_helper (nullptr_t, const _Buffer_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Launch_async_copy_event_helper (const _Buffer_descriptor &_Src, nullptr_t, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Start_copy_event_helper (const _Texture_descriptor &_Src, nullptr_t, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Start_copy_event_helper (nullptr_t, const _Texture_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Start_copy_event_helper (const _Texture_descriptor &_Src, const _Texture_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Launch_async_copy_event_helper (const _Texture_descriptor &_Src, nullptr_t, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Launch_async_copy_event_helper (nullptr_t, const _Texture_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
_AMPIMP ULONG _Launch_async_copy_event_helper (const _Texture_descriptor &_Src, const _Texture_descriptor &_Dest, ULONGLONG _Num_bytes_for_copy)
 
void _Enable_provider (bool _Enable=true)
 

Private Member Functions

 _Amp_runtime_trace (PVOID _Callback_function, _In_ _Trace *_Trace)
 
 _Amp_runtime_trace (const _Amp_runtime_trace &)
 
_Amp_runtime_traceoperator= (const _Amp_runtime_trace &)
 
void _Write_accelerator_config_event (const std::tuple< PVOID, LPCWSTR, LPCWSTR > &_ConfigTuple)
 
ULONG _Start_parallel_for_each_event (PVOID _Accelerator_id, PVOID _Accelerator_view_id, BOOL _Is_tiled_explicitly, ULONGLONG _Num_of_tiles, ULONG _Num_of_threads_per_tile, BOOL _Is_aliased, ULONG _Num_read_only_resources, ULONG _Num_read_write_resources, ULONGLONG _Size_of_all_resouces, ULONG _Size_of_const_data, ULONGLONG _Size_of_data_for_copy)
 
ULONG _Start_copy_event (PVOID _Src_accelerator_id, PVOID _Src_accelerator_view_id, PVOID _Dst_accelerator_id, PVOID _Dst_accelerator_view_id, ULONGLONG _Num_bytes_for_copy, BOOL _Is_src_staging, BOOL _Is_dst_staging)
 
ULONG _Launch_async_copy_event (PVOID _Src_accelerator_id, PVOID _Src_accelerator_view_id, PVOID _Dst_accelerator_id, PVOID _Dst_accelerator_view_id, ULONGLONG _Num_bytes_for_copy, BOOL _Is_src_staging, BOOL _Is_dst_staging)
 
_AMPIMP ULONG _Start_async_op_wait_event (ULONG _Async_op_id)
 
ULONG _Start_array_view_synchronize_event (ULONGLONG _Num_bytes_to_synchronize)
 
ULONG _Launch_array_view_synchronize_event (ULONGLONG _Num_bytes_to_synchronize)
 
std::tuple< PVOID, PVOID, BOOL > _Get_resource_diagnostic_info (const _Buffer_descriptor &_Buff_desc, accelerator_view _Accl_view) const
 
std::tuple< PVOID, PVOID, BOOL > _Get_resource_diagnostic_info (const _Texture_descriptor &_Tex_desc) const
 
ULONG _Get_unique_identifier ()
 

Private Attributes

Concurrency::critical_section _M_critical_section
 
std::vector< std::tuple< PVOID, LPCWSTR, LPCWSTR > > _M_accelerator_configs
 
volatile ULONG _M_counter
 
_Trace * _M_trace_ptr
 

Static Private Attributes

static const ULONG _M_event_disabled = 0
 

Friends

BOOL CALLBACK _Init_amp_runtime_trace (PINIT_ONCE _Init_once, PVOID _Param, _Inout_ PVOID *_Context)
 

Constructor & Destructor Documentation

_AMPIMP Concurrency::details::_Amp_runtime_trace::~_Amp_runtime_trace ( )
Concurrency::details::_Amp_runtime_trace::_Amp_runtime_trace ( PVOID  _Callback_function,
_In_ _Trace *  _Trace 
)
private
Concurrency::details::_Amp_runtime_trace::_Amp_runtime_trace ( const _Amp_runtime_trace )
private

Member Function Documentation

void Concurrency::details::_Amp_runtime_trace::_Add_accelerator_config_event ( PVOID  _Accelerator_id,
LPCWSTR  _Device_path,
LPCWSTR  _Device_description 
)
void Concurrency::details::_Amp_runtime_trace::_Enable_provider ( bool  _Enable = true)
std::tuple<PVOID, PVOID, BOOL> Concurrency::details::_Amp_runtime_trace::_Get_resource_diagnostic_info ( const _Buffer_descriptor _Buff_desc,
accelerator_view  _Accl_view 
) const
private
std::tuple<PVOID, PVOID, BOOL> Concurrency::details::_Amp_runtime_trace::_Get_resource_diagnostic_info ( const _Texture_descriptor _Tex_desc) const
private
ULONG Concurrency::details::_Amp_runtime_trace::_Get_unique_identifier ( )
private
ULONG Concurrency::details::_Amp_runtime_trace::_Launch_array_view_synchronize_event ( ULONGLONG  _Num_bytes_to_synchronize)
private
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Launch_array_view_synchronize_event_helper ( const _Buffer_descriptor _Buff_desc)
ULONG Concurrency::details::_Amp_runtime_trace::_Launch_async_copy_event ( PVOID  _Src_accelerator_id,
PVOID  _Src_accelerator_view_id,
PVOID  _Dst_accelerator_id,
PVOID  _Dst_accelerator_view_id,
ULONGLONG  _Num_bytes_for_copy,
BOOL  _Is_src_staging,
BOOL  _Is_dst_staging 
)
private
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Launch_async_copy_event_helper ( const _Buffer_descriptor _Src,
const _Buffer_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Launch_async_copy_event_helper ( nullptr_t  ,
const _Buffer_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Launch_async_copy_event_helper ( const _Buffer_descriptor _Src,
nullptr_t  ,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Launch_async_copy_event_helper ( const _Texture_descriptor _Src,
nullptr_t  ,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Launch_async_copy_event_helper ( nullptr_t  ,
const _Texture_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Launch_async_copy_event_helper ( const _Texture_descriptor _Src,
const _Texture_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
void Concurrency::details::_Amp_runtime_trace::_Launch_flush_event ( PVOID  _Accelerator_id,
PVOID  _Accelerator_view_id 
)
ULONG Concurrency::details::_Amp_runtime_trace::_Launch_marker ( PVOID  _Accelerator_id,
PVOID  _Accelerator_view_id 
)
ULONG Concurrency::details::_Amp_runtime_trace::_Start_accelerator_view_wait_event ( PVOID  _Accelerator_id,
PVOID  _Accelerator_view_id 
)
ULONG Concurrency::details::_Amp_runtime_trace::_Start_array_view_synchronize_event ( ULONGLONG  _Num_bytes_to_synchronize)
private
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_array_view_synchronize_event_helper ( const _Buffer_descriptor _Buff_desc)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_async_op_wait_event ( ULONG  _Async_op_id)
private
concurrency::completion_future Concurrency::details::_Amp_runtime_trace::_Start_async_op_wait_event_helper ( ULONG  _Async_op_id,
_Event  _Ev 
)
inline
3913  {
3914  std::shared_future<void> retFuture;
3915  concurrency::task_completion_event<void> retTaskCompletionEvent;
3916 
3917  // Create a std::shared_future by creating a deferred task through std::async that waits for the
3918  // event _Ev to finish. Wrap functor with start and end events
3919  retFuture = std::async(std::launch::sync, [=]() mutable {
3920  try
3921  {
3922  if (_Async_op_id == _Amp_runtime_trace::_M_event_disabled)
3923  {
3924  _Ev._Get();
3925  }
3926  else
3927  {
3928  auto _Span_id = details::_Get_amp_trace()->_Start_async_op_wait_event(_Async_op_id);
3929  _Ev._Get();
3931  }
3932  }
3933  catch(...)
3934  {
3935  // If an exception is encountered when executing the asynchronous operation
3936  // we should set the exception on the retTaskCompletionEvent so that it is
3937  // appropriately cancelled and the exception is propagated to continuations
3938  retTaskCompletionEvent.set_exception(std::current_exception());
3939  throw;
3940  }
3941 
3942  retTaskCompletionEvent.set();
3943  });
3944 
3945  // Register the async event with the runtime asynchronous events manager
3946  _Register_async_event(_Ev, retFuture);
3947 
3948  // Lets issue a continuation just to swallow any exceptions that are encountered during the
3949  // async operation and are never observed by the user or are just observed through the
3950  // shared_future and not through the task
3951  concurrency::task<void> retTask(retTaskCompletionEvent);
3952  retTask.then([](concurrency::task<void> _Task) {
3953  try {
3954  _Task.get();
3955  }
3956  catch(...) {
3957  }
3958  });
3959 
3960  return Concurrency::completion_future(retFuture, retTask);
3961  }
void get() const
Returns the result this task produced. If the task is not in a terminal state, a call to get will wai...
Definition: ppltasks.h:4387
exception_ptr current_exception()
Definition: exception:527
Class represents a future corresponding to a C++ AMP asynchronous operation
Definition: amprt.h:1342
static const ULONG _M_event_disabled
Definition: amprt.h:4064
_AMPIMP void _Get()
Wait until the _Event completes and throw any exceptions that occur.
_AMPIMP _Ret_ _Amp_runtime_trace *__cdecl _Get_amp_trace()
The task_completion_event class allows you to delay the execution of a task until a condition is sati...
Definition: ppltasks.h:2883
The Parallel Patterns Library (PPL) task class. A task object represents work that can be executed as...
Definition: ppltasks.h:4120
_AMPIMP ULONG _Start_async_op_wait_event(ULONG _Async_op_id)
bool set() const
Sets the task completion event.
Definition: ppltasks.h:2899
_AMPIMP void _Write_end_event(ULONG _Span_id)
_AMPIMP void __cdecl _Register_async_event(const _Event &_Ev, const std::shared_future< void > &_Shared_future)
ULONG Concurrency::details::_Amp_runtime_trace::_Start_copy_event ( PVOID  _Src_accelerator_id,
PVOID  _Src_accelerator_view_id,
PVOID  _Dst_accelerator_id,
PVOID  _Dst_accelerator_view_id,
ULONGLONG  _Num_bytes_for_copy,
BOOL  _Is_src_staging,
BOOL  _Is_dst_staging 
)
private
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_copy_event_helper ( const _Buffer_descriptor _Src,
const _Buffer_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_copy_event_helper ( nullptr_t  ,
const _Buffer_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_copy_event_helper ( const _Buffer_descriptor _Src,
nullptr_t  ,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_copy_event_helper ( const _Texture_descriptor _Src,
nullptr_t  ,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_copy_event_helper ( nullptr_t  ,
const _Texture_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_copy_event_helper ( const _Texture_descriptor _Src,
const _Texture_descriptor _Dest,
ULONGLONG  _Num_bytes_for_copy 
)
ULONG Concurrency::details::_Amp_runtime_trace::_Start_parallel_for_each_event ( PVOID  _Accelerator_id,
PVOID  _Accelerator_view_id,
BOOL  _Is_tiled_explicitly,
ULONGLONG  _Num_of_tiles,
ULONG  _Num_of_threads_per_tile,
BOOL  _Is_aliased,
ULONG  _Num_read_only_resources,
ULONG  _Num_read_write_resources,
ULONGLONG  _Size_of_all_resouces,
ULONG  _Size_of_const_data,
ULONGLONG  _Size_of_data_for_copy 
)
private
_AMPIMP ULONG Concurrency::details::_Amp_runtime_trace::_Start_parallel_for_each_event_helper ( _In_ _DPC_call_handle _Handle)
void Concurrency::details::_Amp_runtime_trace::_Write_accelerator_config_event ( const std::tuple< PVOID, LPCWSTR, LPCWSTR > &  _ConfigTuple)
private
void Concurrency::details::_Amp_runtime_trace::_Write_all_accelerator_config_events ( )
_AMPIMP void Concurrency::details::_Amp_runtime_trace::_Write_end_event ( ULONG  _Span_id)
_Amp_runtime_trace& Concurrency::details::_Amp_runtime_trace::operator= ( const _Amp_runtime_trace )
private

Friends And Related Function Documentation

BOOL CALLBACK _Init_amp_runtime_trace ( PINIT_ONCE  _Init_once,
PVOID  _Param,
_Inout_ PVOID *  _Context 
)
friend

Member Data Documentation

std::vector<std::tuple<PVOID, LPCWSTR, LPCWSTR> > Concurrency::details::_Amp_runtime_trace::_M_accelerator_configs
private
volatile ULONG Concurrency::details::_Amp_runtime_trace::_M_counter
private
Concurrency::critical_section Concurrency::details::_Amp_runtime_trace::_M_critical_section
private
const ULONG Concurrency::details::_Amp_runtime_trace::_M_event_disabled = 0
staticprivate
_Trace* Concurrency::details::_Amp_runtime_trace::_M_trace_ptr
private

The documentation for this class was generated from the following file: