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
3754  {
3755  std::shared_future<void> retFuture;
3756  concurrency::task_completion_event<void> retTaskCompletionEvent;
3757 
3758  // Create a std::shared_future by creating a deferred task through std::async that waits for the
3759  // event _Ev to finish. Wrap functor with start and end events
3760  retFuture = std::async(std::launch::deferred, [=]() mutable {
3761  try
3762  {
3763  if (_Async_op_id == _Amp_runtime_trace::_M_event_disabled)
3764  {
3765  _Ev._Get();
3766  }
3767  else
3768  {
3769  auto _Span_id = details::_Get_amp_trace()->_Start_async_op_wait_event(_Async_op_id);
3770  _Ev._Get();
3772  }
3773  }
3774  catch(...)
3775  {
3776  // If an exception is encountered when executing the asynchronous operation
3777  // we should set the exception on the retTaskCompletionEvent so that it is
3778  // appropriately canceled and the exception is propagated to continuations
3779  retTaskCompletionEvent.set_exception(std::current_exception());
3780  throw;
3781  }
3782 
3783  retTaskCompletionEvent.set();
3784  });
3785 
3786  // Register the async event with the runtime asynchronous events manager
3787  _Register_async_event(_Ev, retFuture);
3788 
3789  // Lets issue a continuation just to swallow any exceptions that are encountered during the
3790  // async operation and are never observed by the user or are just observed through the
3791  // shared_future and not through the task
3792  concurrency::task<void> retTask(retTaskCompletionEvent);
3793  retTask.then([](concurrency::task<void> _Task) {
3794  try {
3795  _Task.get();
3796  }
3797  catch(...) {
3798  }
3799  });
3800 
3801  return Concurrency::completion_future(retFuture, retTask);
3802  }
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:4184
Class represents a future corresponding to a C++ AMP asynchronous operation
Definition: amprt.h:1266
static const ULONG _M_event_disabled
Definition: amprt.h:3905
_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:2626
The Parallel Patterns Library (PPL) task class. A task object represents work that can be executed as...
Definition: ppltasks.h:3899
_AMPIMP ULONG _Start_async_op_wait_event(ULONG _Async_op_id)
exception_ptr current_exception() _NOEXCEPT
Definition: exception:366
bool set() const
Sets the task completion event.
Definition: ppltasks.h:2642
_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: