STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
amprt.h File Reference
#include <unknwn.h>
#include <crtdbg.h>
#include <string>
#include <vector>
#include <iterator>
#include <future>
#include <functional>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <concrt.h>
#include <type_traits>
#include "amprt_exceptions.h"

Go to the source code of this file.

Classes

class  Concurrency::details::_Reference_counter
 
class  Concurrency::details::_Reference_counted_obj_ptr< T >
 
class  Concurrency::details::_Event
 
struct  Concurrency::details::_Buffer_descriptor
 
struct  Concurrency::details::_Texture_descriptor
 
struct  Concurrency::details::_Sampler_descriptor
 
struct  Concurrency::direct3d::adopt_d3d_access_lock_t
 Tag type to indicate the D3D access lock should be adopted rather than acquired. More...
 
class  Concurrency::direct3d::scoped_d3d_access_lock
 RAII wrapper for a D3D access lock on an accelerator_view. More...
 
class  Concurrency::accelerator
 Class represents a accelerator abstraction for C++ AMP data-parallel devices More...
 
class  Concurrency::completion_future
 Class represents a future corresponding to a C++ AMP asynchronous operation More...
 
class  Concurrency::accelerator_view
 Class represents a virtual device abstraction on a C++ AMP data-parallel accelerator More...
 
class  Concurrency::details::_Accelerator_view_hasher
 
class  Concurrency::details::_View_shape
 
class  Concurrency::details::_Buffer
 
class  Concurrency::details::_Texture
 
class  Concurrency::details::_Sampler
 
struct  Concurrency::details::_Array_copy_desc
 
class  Concurrency::details::_Ubiquitous_buffer
 
class  Concurrency::details::_D3D_interop
 
struct  _Device_resource_info
 
struct  _Device_const_buffer_info
 
struct  Concurrency::details::_DPC_call_handle
 
struct  Concurrency::details::_Host_Scheduling_info
 
class  Concurrency::details::_Amp_runtime_trace
 

Namespaces

 Concurrency
 The Concurrency namespace provides classes and functions that provide access to the Concurrency Runtime, a concurrent programming framework for C++. For more information, see Concurrency Runtime.
 
 Concurrency::details
 
 Concurrency::direct3d
 

Macros

#define __GPU   restrict(amp,cpu)
 
#define __GPU_ONLY   restrict(amp)
 
#define __CPU_ONLY   restrict(cpu)
 
#define HELPERAPI   __cdecl
 

Typedefs

typedef enum _Short_vector_base_type_id Concurrency::details::_Texture_base_type_id
 
typedef details::_Reference_counted_obj_ptr< details::_Accelerator_view_impl > Concurrency::_Accelerator_view_impl_ptr
 
typedef details::_Reference_counted_obj_ptr< details::_Accelerator_impl > Concurrency::_Accelerator_impl_ptr
 
typedef details::_Reference_counted_obj_ptr< details::_Buffer > Concurrency::_Buffer_ptr
 
typedef details::_Reference_counted_obj_ptr< details::_Texture > Concurrency::_Texture_ptr
 
typedef details::_Reference_counted_obj_ptr< details::_Sampler > Concurrency::_Sampler_ptr
 
typedef details::_Reference_counted_obj_ptr< details::_Ubiquitous_buffer > Concurrency::_Ubiquitous_buffer_ptr
 
typedef details::_Reference_counted_obj_ptr< details::_Event_impl > Concurrency::_Event_impl_ptr
 
typedef details::_Reference_counted_obj_ptr< details::_View_shape > Concurrency::_View_shape_ptr
 
typedef _Buffer_descriptorConcurrency::details::_View_key
 
typedef struct Concurrency::details::_Buffer_descriptor Concurrency::details::_Buffer_descriptor
 
typedef struct Concurrency::details::_Texture_descriptor Concurrency::details::_Texture_descriptor
 
typedef struct Concurrency::details::_Sampler_descriptor Concurrency::details::_Sampler_descriptor
 
typedef std::unordered_set< accelerator_view, _Accelerator_view_hasherConcurrency::details::_Accelerator_view_unordered_set
 

Enumerations

enum  _Access_mode {
  _No_access = 0, _Read_access = (1 << 0), _Write_access = (1 << 1), _Is_array_mode = (1 << 30),
  _Read_write_access = _Read_access | _Write_access
}
 
enum  Concurrency::access_type {
  Concurrency::access_type_none = 0, Concurrency::access_type_read = (1 << 0), Concurrency::access_type_write = (1 << 1), Concurrency::access_type_read_write = access_type_read | access_type_write,
  Concurrency::access_type_auto = (1 << 31)
}
 Enumeration type used to denote the various types of access to data. More...
 
enum  Concurrency::details::_Short_vector_base_type_id : unsigned int {
  Concurrency::details::_Uint_type = 0, Concurrency::details::_Int_type = 1, Concurrency::details::_Float_type = 2, Concurrency::details::_Unorm_type = 3,
  Concurrency::details::_Norm_type = 4, Concurrency::details::_Double_type = 5, Concurrency::details::_Invalid_type = 0xFFFFFFFF
}
 
enum  Concurrency::queuing_mode { Concurrency::queuing_mode_immediate, Concurrency::queuing_mode_automatic }
 Queuing modes supported for accelerator views More...
 
enum  _Resource_kind { RESOURCE_BUFFER = 0, RESOURCE_TEXTURE = 1, RESOURCE_SAMPLER = 2 }
 

Functions

_Ret_ _Accelerator_view_impl * Concurrency::details::_Get_accelerator_view_impl_ptr (const accelerator_view &_Accl_view)
 
_Ret_ _Accelerator_impl * Concurrency::details::_Get_accelerator_impl_ptr (const accelerator &_Accl)
 
_Event Concurrency::details::_Get_access_async (const _View_key _Key, accelerator_view _Av, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr)
 
unsigned int Concurrency::details::_Get_mipmap_levels (const _Texture *_Tex)
 
bool Concurrency::details::_Is_valid_access_mode (_Access_mode _Mode)
 
_AMPIMP size_t __cdecl Concurrency::details::_Get_num_devices ()
 
_AMPIMP _Ret_ _Accelerator_impl_ptr *__cdecl Concurrency::details::_Get_devices ()
 
_AMPIMP accelerator __cdecl Concurrency::details::_Select_default_accelerator ()
 
_AMPIMP bool __cdecl Concurrency::details::_Set_default_accelerator (_Accelerator_impl_ptr _Accl)
 
_AMPIMP bool __cdecl Concurrency::details::_Is_D3D_accelerator_view (const accelerator_view &_Av)
 
_AMPIMP void __cdecl Concurrency::details::_Register_async_event (const _Event &_Ev, const std::shared_future< void > &_Shared_future)
 
_AMPIMP _Access_mode __cdecl Concurrency::details::_Get_recommended_buffer_host_access_mode (const accelerator_view &_Av)
 
_AMPIMP _Ret_ IUnknown *__cdecl Concurrency::direct3d::get_device (const accelerator_view &_Av)
 Get the D3D device interface underlying a accelerator_view. More...
 
_AMPIMP accelerator_view __cdecl Concurrency::direct3d::create_accelerator_view (_In_ IUnknown *_D3D_device, queuing_mode _Qmode=queuing_mode_automatic)
 Create a accelerator_view from a D3D device interface pointer. More...
 
_AMPIMP accelerator_view __cdecl Concurrency::direct3d::create_accelerator_view (accelerator &_Accelerator, bool _Disable_timeout, queuing_mode _Qmode=queuing_mode_automatic)
 Create and return a new accelerator view on the specified accelerator. More...
 
_AMPIMP bool __cdecl Concurrency::direct3d::is_timeout_disabled (const accelerator_view &_Accelerator_view)
 Returns a boolean flag indicating if timeout is disabled for the specified accelerator_view. This corresponds to the D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT flag for Direct3D device creation. More...
 
_AMPIMP void __cdecl Concurrency::direct3d::d3d_access_lock (accelerator_view &_Av)
 Acquire a lock on an accelerator_view for the purpose of safely performing D3D operations on resources shared with the accelerator_view. The accelerator_view and all C++ AMP resources associated with this accelerator_view internally take this lock when performing operations and will block while another thread holds the D3D access lock. More...
 
_AMPIMP bool __cdecl Concurrency::direct3d::d3d_access_try_lock (accelerator_view &_Av)
 Attempt to acquire the D3D access lock on an accelerator_view without blocking. More...
 
_AMPIMP void __cdecl Concurrency::direct3d::d3d_access_unlock (accelerator_view &_Av)
 Release the D3D access lock on the given accelerator_view. If the calling thread does not hold the lock on the accelerator_view the results are undefined. More...
 
_Ret_ _View_shapeConcurrency::details::_Create_reinterpreted_shape (const _View_shape *_Source_shape, size_t _Curr_elem_size, size_t _New_elem_size)
 
_Access_mode Concurrency::details::_Get_synchronize_access_mode (access_type cpu_access_type)
 
access_type Concurrency::details::_Get_cpu_access_type (_Access_mode _Cpu_access_mode)
 
_AMPIMP _Event __cdecl Concurrency::details::_Copy_impl (_In_ _Buffer *_Src, size_t _Src_offset, _Out_ _Buffer *_Dst, size_t _Dest_offset, size_t _Num_elems, size_t _Preferred_copy_chunk_num_elems=0)
 
_AMPIMP _Event __cdecl Concurrency::details::_Copy_async_impl (_In_ _Texture *_Src_tex, const size_t *_Src_offset, unsigned int _Src_mipmap_level, _Out_ _Texture *_Dst_tex, const size_t *_Dst_offset, unsigned int _Dst_mipmap_level, const size_t *_Copy_extent, const size_t *_Preferred_copy_chunk_extent=NULL)
 
bool Concurrency::details::_Get_chunked_staging_texture (_In_ _Texture *_Tex, const size_t *_Copy_chunk_extent, _Inout_ size_t *_Remaining_copy_extent, _Out_ size_t *_Curr_copy_extent, _Out_ _Texture_ptr *_Staging_texture)
 
template<typename _Input_iterator , typename _Value_type >
void Concurrency::details::_Copy_data_on_host_src_iter (int _Rank, _Input_iterator _Src, _Out_ _Value_type *_Dst, size_t _Width, size_t _Height, size_t _Depth, size_t _Dst_row_pitch_in_bytes, size_t _Dst_depth_pitch_in_bytes, size_t _Src_row_pitch, size_t _Src_depth_pitch)
 
template<typename _Output_iterator , typename _Value_type >
void Concurrency::details::_Copy_data_on_host_dst_iter (int _Rank, const _Value_type *_Src, _Output_iterator _Dst, size_t _Width, size_t _Height, size_t _Depth, size_t _Src_row_pitch_in_bytes, size_t _Src_depth_pitch_in_bytes, size_t _Dst_row_pitch, size_t _Dst_depth_pitch)
 
_AMPIMP size_t __cdecl Concurrency::details::_Get_preferred_copy_chunk_size (size_t _Total_copy_size_in_bytes)
 
size_t Concurrency::details::_Get_preferred_copy_chunk_num_elems (size_t _Total_num_elems, size_t _Elem_size)
 
void Concurrency::details::_Get_preferred_copy_chunk_extent (unsigned int _Rank, size_t _Width, size_t _Height, size_t _Depth, size_t _Bits_per_element, _Out_writes_(3) size_t *_Preferred_copy_chunk_extent)
 
template<typename _T >
_T Concurrency::details::_Greatest_common_divisor (_T _M, _T _N)
 
template<typename _T >
_T Concurrency::details::_Least_common_multiple (_T _M, _T _N)
 
template<typename InputIterator , typename _Value_type >
_Event Concurrency::details::_Copy_impl (InputIterator _SrcFirst, InputIterator _SrcLast, size_t _NumElemsToCopy, _Out_ _Buffer *_Dst, size_t _Dest_offset, size_t _Preferred_copy_chunk_num_elems=0)
 
template<typename _InputIterator , typename _Distance >
std::enable_if< std::is_base_of< std::input_iterator_tag, typename std::iterator_traits< _InputIterator >::iterator_category >::value >::type Concurrency::details::_Advance_output_iterator (_InputIterator &_Iter, _Distance _N)
 
template<typename _OutputIterator , typename _Distance >
std::enable_if<!std::is_base_of< std::input_iterator_tag, typename std::iterator_traits< _OutputIterator >::iterator_category >::value >::type Concurrency::details::_Advance_output_iterator (_OutputIterator &_Iter, size_t _N)
 
template<typename OutputIterator , typename _Value_type >
_Event Concurrency::details::_Copy_impl (_In_ _Buffer *_Src, size_t _Src_offset, size_t _Num_elems, OutputIterator _DestIter, size_t _Preferred_copy_chunk_num_elems=0)
 
_AMPIMP _Event __cdecl Concurrency::details::_Copy_impl (_In_ _Buffer *_Src, _View_shape_ptr _Src_shape, _Out_ _Buffer *_Dst, _View_shape_ptr _Dst_shape)
 
_AMPIMP HRESULT __cdecl Concurrency::details::_Recursive_array_copy (const _Array_copy_desc &_Desc, unsigned int _Native_copy_rank, std::function< HRESULT(const _Array_copy_desc &_Reduced)> _Native_copy_func)
 
_AMPIMP std::pair< accelerator_view, accelerator_view > __cdecl Concurrency::details::_Get_src_dest_accelerator_view (_In_opt_ const _Buffer_descriptor *_SrcBuffDescPtr, _In_opt_ const _Buffer_descriptor *_DestBuffDescPtr)
 
template<typename _InputInterator , typename _OutputIterator >
_Event Concurrency::details::_Copy_impl_iter (_InputInterator _SrcFirst, _InputInterator _SrcLast, _OutputIterator _DstFirst)
 
template<typename InputIterator , typename _Value_type >
_Event Concurrency::details::_Copy_impl (InputIterator _SrcFirst, _View_shape_ptr _Src_shape, _Inout_ _Buffer *_Dst, _View_shape_ptr _Dst_shape)
 
template<typename OutputIterator , typename _Value_type >
_Event Concurrency::details::_Copy_impl (_In_ _Buffer *_Src, _View_shape_ptr _Src_shape, OutputIterator _DestIter, _View_shape_ptr _Dst_shape)
 
template<typename _InputInterator , typename _OutputIterator >
_Event Concurrency::details::_Copy_impl_iter (_InputInterator _SrcIter, _View_shape_ptr _Src_shape, _OutputIterator _DstIter, _View_shape_ptr _Dst_shape)
 
_Ret_ _View_shapeConcurrency::details::_Get_buffer_view_shape (const _Buffer_descriptor &_Descriptor)
 
bool Concurrency::details::_Is_cpu_accelerator (const accelerator &_Accl)
 
_AMPIMP void __cdecl Concurrency::amp_uninitialize ()
 Uninitializes the C++ AMP runtime. It is legal to call this function multiple times during an applications lifetime. Calling any C++ AMP API afer calling this function will reinitialize the C++ AMP runtime. Note that it is illegal to use C++ AMP objects across calls to this function and doing so will result in undefined behavior. Also, concurrently calling this function and any other AMP APIs is illegal and would result in undefined behavior. More...
 
_AMPIMP _Ret_ _DPC_call_handle *HELPERAPI __dpc_create_call_handle (_In_ _Host_Scheduling_info *_Sch_info) throw (...)
 
_AMPIMP void HELPERAPI __dpc_release_call_handle (_In_ _DPC_call_handle *_Handle) throw (...)
 
_AMPIMP void HELPERAPI __dpc_set_device_resource_info (_In_ _DPC_call_handle *_Handle, _In_ _Device_resource_info *_DeviceResourceInfo, size_t _NumResources) throw (...)
 
_AMPIMP void HELPERAPI __dpc_set_const_buffer_info (_In_ _DPC_call_handle *_Handle, _In_ _Device_const_buffer_info *_DeviceConstBufferInfo, size_t _NumConstBuffers) throw (...)
 
_AMPIMP void HELPERAPI __dpc_set_kernel_shader_info (_In_ _DPC_call_handle *_Handle, _Inout_ void *_ShaderBlobs) throw (...)
 
_AMPIMP void HELPERAPI __dpc_set_kernel_dispatch_info (_In_ _DPC_call_handle *_Handle, unsigned int _ComputeRank, _In_ int *_Extents, unsigned int _GroupRank, const unsigned int *_GroupExtents, unsigned int &_GroupCountX, unsigned int &_GroupCountY, unsigned int &_GroupCountZ) throw (...)
 
_AMPIMP void HELPERAPI __dpc_dispatch_kernel (_In_ _DPC_call_handle *_Handle) throw (...)
 
_AMPIMP _Ret_ _Amp_runtime_trace *__cdecl Concurrency::details::_Get_amp_trace ()
 

Variables

const size_t Concurrency::details::ERROR_MSG_BUFFER_SIZE = 1024
 

Macro Definition Documentation

#define __CPU_ONLY   restrict(cpu)
#define __GPU   restrict(amp,cpu)
#define __GPU_ONLY   restrict(amp)
#define HELPERAPI   __cdecl

Enumeration Type Documentation

Enumerator
_No_access 
_Read_access 
_Write_access 
_Is_array_mode 
_Read_write_access 
89  {
90  _No_access = 0,
91  _Read_access = (1 << 0),
92  _Write_access = (1 << 1),
93  _Is_array_mode = (1 << 30),
95  };
Definition: amprt.h:91
Definition: amprt.h:93
Definition: amprt.h:94
Definition: amprt.h:90
Definition: amprt.h:92
Enumerator
RESOURCE_BUFFER 
RESOURCE_TEXTURE 
RESOURCE_SAMPLER 
3424  {
3425  RESOURCE_BUFFER = 0,
3426  RESOURCE_TEXTURE = 1,
3427  RESOURCE_SAMPLER = 2,
3428  };
Definition: amprt.h:3426
Definition: amprt.h:3425
Definition: amprt.h:3427

Function Documentation

_AMPIMP _Ret_ _DPC_call_handle* HELPERAPI __dpc_create_call_handle ( _In_ _Host_Scheduling_info _Sch_info)
throw (...
)
_AMPIMP void HELPERAPI __dpc_dispatch_kernel ( _In_ _DPC_call_handle _Handle)
throw (...
)
_AMPIMP void HELPERAPI __dpc_release_call_handle ( _In_ _DPC_call_handle _Handle)
throw (...
)
_AMPIMP void HELPERAPI __dpc_set_const_buffer_info ( _In_ _DPC_call_handle _Handle,
_In_ _Device_const_buffer_info _DeviceConstBufferInfo,
size_t  _NumConstBuffers 
)
throw (...
)
_AMPIMP void HELPERAPI __dpc_set_device_resource_info ( _In_ _DPC_call_handle _Handle,
_In_ _Device_resource_info _DeviceResourceInfo,
size_t  _NumResources 
)
throw (...
)
_AMPIMP void HELPERAPI __dpc_set_kernel_dispatch_info ( _In_ _DPC_call_handle _Handle,
unsigned int  _ComputeRank,
_In_ int *  _Extents,
unsigned int  _GroupRank,
const unsigned int *  _GroupExtents,
unsigned int &  _GroupCountX,
unsigned int &  _GroupCountY,
unsigned int &  _GroupCountZ 
)
throw (...
)
_AMPIMP void HELPERAPI __dpc_set_kernel_shader_info ( _In_ _DPC_call_handle _Handle,
_Inout_ void _ShaderBlobs 
)
throw (...
)