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

Class represents a accelerator abstraction for C++ AMP data-parallel devices More...

#include <amprt.h>

Public Member Functions

_AMPIMP accelerator ()
 Construct a accelerator representing the default accelerator More...
 
 accelerator (const std::wstring &_Device_path)
 Construct a accelerator representing the accelerator with the specified device instance path More...
 
_AMPIMP ~accelerator ()
 Destructor More...
 
_AMPIMP accelerator (const accelerator &_Other)
 Copy constructor More...
 
_AMPIMP acceleratoroperator= (const accelerator &_Other)
 Assignment operator More...
 
std::wstring get_device_path () const
 Returns the system-wide unique device instance path as a std::wstring More...
 
__declspec(property(get=get_device_path)) std _AMPIMP unsigned int get_version () const
 Get the version for this accelerator More...
 
 __declspec (property(get=get_version)) unsigned int version
 
std::wstring get_description () const
 Returns the device description as a std::wstring More...
 
__declspec(property(get=get_description)) std _AMPIMP bool get_is_debug () const
 Returns a boolean value indicating whether the accelerator was created with DEBUG layer enabled for extensive error reporting More...
 
 __declspec (property(get=get_is_debug)) bool is_debug
 
_AMPIMP bool get_is_emulated () const
 Returns a boolean value indicating whether the accelerator is emulated. This is true, for example, with the direct3d reference and WARP accelerators. More...
 
 __declspec (property(get=get_is_emulated)) bool is_emulated
 
_AMPIMP bool get_has_display () const
 Returns a boolean value indicating whether the accelerator is attached to a display More...
 
 __declspec (property(get=get_has_display)) bool has_display
 
_AMPIMP bool get_supports_double_precision () const
 Returns a boolean value indicating whether the accelerator supports full double precision (including double division, precise_math functions, int to double, double to int conversions) in a parallel_for_each kernel. More...
 
 __declspec (property(get=get_supports_double_precision)) bool supports_double_precision
 
_AMPIMP bool get_supports_limited_double_precision () const
 Returns a boolean value indicating whether the accelerator has limited double precision support (excludes double division, precise_math functions, int to double, double to int conversions) for a parallel_for_each kernel. More...
 
 __declspec (property(get=get_supports_limited_double_precision)) bool supports_limited_double_precision
 
_AMPIMP bool get_supports_cpu_shared_memory () const
 Returns a boolean value indicating whether the accelerator supports memory accessible both by the accelerator and the CPU. More...
 
 __declspec (property(get=get_supports_cpu_shared_memory)) bool supports_cpu_shared_memory
 
_AMPIMP accelerator_view get_default_view () const
 Return the default accelerator view associated with this accelerator More...
 
 __declspec (property(get=get_default_view)) accelerator_view default_view
 
_AMPIMP size_t get_dedicated_memory () const
 Get the dedicated memory for this accelerator in KB More...
 
 __declspec (property(get=get_dedicated_memory)) size_t dedicated_memory
 
_AMPIMP access_type get_default_cpu_access_type () const
 Get the default cpu access_type for buffers created on this accelerator More...
 
 __declspec (property(get=get_default_cpu_access_type)) access_type default_cpu_access_type
 
_AMPIMP bool set_default_cpu_access_type (access_type _Default_cpu_access_type)
 Set the default cpu access_type for arrays created on this accelerator or for implicit memory allocations as part of array_views accessed on this accelerator. This method only succeeds if the default_cpu_access_type for the accelerator has not already been overridden by a previous call to this method and the runtime selected default_cpu_access_type for this accelerator has not yet been used for allocating an array or for an implicit memory allocation backing an array_view accessed on this accelerator. More...
 
_AMPIMP accelerator_view create_view (queuing_mode qmode=queuing_mode_automatic)
 Create and return a new accelerator view on this accelerator with the specified queuing mode. When unspecified the accelerator_view is created with queuing_mode_automatic queuing mode. More...
 
_AMPIMP bool operator== (const accelerator &_Other) const
 Return true if the other accelerator is same as this accelerator; false otherwise More...
 
_AMPIMP bool operator!= (const accelerator &_Other) const
 Return false if the other accelerator is same as this accelerator; true otherwise More...
 

Static Public Member Functions

static std::vector< acceleratorget_all ()
 Returns the vector of accelerator objects representing all available accelerators More...
 
static bool set_default (const std::wstring &_Path)
 Sets the default accelerator to be used for any operation that implicitly uses the default accelerator. This method only succeeds if the runtime selected default accelerator has not already been used in an operation that implicitly uses the default accelerator More...
 
static _AMPIMP accelerator_view __cdecl get_auto_selection_view ()
 Returns the auto selection accelerator_view which when specified as the parallel_for_each target results in the target accelerator_view for executing the parallel_for_each kernel to be automatically selected by the runtime. For all other purposes, the accelerator_view returned by this method is the same as the default accelerator_view of the default accelerator More...
 

Static Public Attributes

static _AMPIMP const wchar_t default_accelerator []
 String constant for default accelerator More...
 
static _AMPIMP const wchar_t cpu_accelerator []
 String constant for cpu accelerator More...
 
static _AMPIMP const wchar_t direct3d_warp []
 String constant for direct3d WARP accelerator More...
 
static _AMPIMP const wchar_t direct3d_ref []
 String constant for direct3d reference accelerator More...
 

Private Member Functions

_AMPIMP accelerator (_Accelerator_impl_ptr _Impl)
 
_AMPIMP const wchar_t_Get_device_path () const
 
_AMPIMP const wchar_t_Get_description () const
 
_AMPIMP void _Init (const wchar_t *_Path)
 

Private Attributes

_Accelerator_impl_ptr _M_impl
 

Friends

class accelerator_view
 
class details::_Ubiquitous_buffer
 
_AMPIMP accelerator details::_Select_default_accelerator ()
 
_AMPIMP friend accelerator_view __cdecl direct3d::create_accelerator_view (accelerator &_Accelerator, bool _Disable_timeout, queuing_mode _Qmode)
 
_Ret_ details::_Accelerator_impl * details::_Get_accelerator_impl_ptr (const accelerator &_Accl)
 

Detailed Description

Class represents a accelerator abstraction for C++ AMP data-parallel devices

Constructor & Destructor Documentation

_AMPIMP Concurrency::accelerator::accelerator ( )

Construct a accelerator representing the default accelerator

Concurrency::accelerator::accelerator ( const std::wstring _Device_path)
inlineexplicit

Construct a accelerator representing the accelerator with the specified device instance path

1056  : _M_impl(NULL)
1057  {
1058  _Init(_Device_path.c_str());
1059  }
_Accelerator_impl_ptr _M_impl
Definition: amprt.h:1260
_AMPIMP void _Init(const wchar_t *_Path)
#define NULL
Definition: corecrt.h:158
_AMPIMP Concurrency::accelerator::~accelerator ( )

Destructor

_AMPIMP Concurrency::accelerator::accelerator ( const accelerator _Other)

Copy constructor

_AMPIMP Concurrency::accelerator::accelerator ( _Accelerator_impl_ptr  _Impl)
private

Member Function Documentation

Concurrency::accelerator::__declspec ( property(get=get_version )
Concurrency::accelerator::__declspec ( property(get=get_is_debug )
Concurrency::accelerator::__declspec ( property(get=get_is_emulated )
Concurrency::accelerator::__declspec ( property(get=get_has_display )
Concurrency::accelerator::__declspec ( property(get=get_supports_double_precision )
Concurrency::accelerator::__declspec ( property(get=get_supports_limited_double_precision )
Concurrency::accelerator::__declspec ( property(get=get_supports_cpu_shared_memory )
Concurrency::accelerator::__declspec ( property(get=get_default_view )
Concurrency::accelerator::__declspec ( property(get=get_dedicated_memory )
Concurrency::accelerator::__declspec ( property(get=get_default_cpu_access_type )
_AMPIMP const wchar_t* Concurrency::accelerator::_Get_description ( ) const
private
_AMPIMP const wchar_t* Concurrency::accelerator::_Get_device_path ( ) const
private
_AMPIMP void Concurrency::accelerator::_Init ( const wchar_t _Path)
private
_AMPIMP accelerator_view Concurrency::accelerator::create_view ( queuing_mode  qmode = queuing_mode_automatic)

Create and return a new accelerator view on this accelerator with the specified queuing mode. When unspecified the accelerator_view is created with queuing_mode_automatic queuing mode.

static std::vector<accelerator> Concurrency::accelerator::get_all ( )
inlinestatic

Returns the vector of accelerator objects representing all available accelerators

Returns
The vector of available accelerators
1083  {
1084  std::vector<accelerator> _AcceleratorVector;
1085  size_t _NumDevices = details::_Get_num_devices();
1086  for (size_t _I = 0; (_I < _NumDevices); ++_I)
1087  {
1088  _AcceleratorVector.push_back(details::_Get_devices()[_I]);
1089  }
1090 
1091  return _AcceleratorVector;
1092  }
_AMPIMP _Ret_ _Accelerator_impl_ptr *__cdecl _Get_devices()
_AMPIMP size_t __cdecl _Get_num_devices()
static _AMPIMP accelerator_view __cdecl Concurrency::accelerator::get_auto_selection_view ( )
static

Returns the auto selection accelerator_view which when specified as the parallel_for_each target results in the target accelerator_view for executing the parallel_for_each kernel to be automatically selected by the runtime. For all other purposes, the accelerator_view returned by this method is the same as the default accelerator_view of the default accelerator

_AMPIMP size_t Concurrency::accelerator::get_dedicated_memory ( ) const

Get the dedicated memory for this accelerator in KB

_AMPIMP access_type Concurrency::accelerator::get_default_cpu_access_type ( ) const

Get the default cpu access_type for buffers created on this accelerator

_AMPIMP accelerator_view Concurrency::accelerator::get_default_view ( ) const

Return the default accelerator view associated with this accelerator

std::wstring Concurrency::accelerator::get_description ( ) const
inline

Returns the device description as a std::wstring

1141  {
1142  return _Get_description();
1143  }
_AMPIMP const wchar_t * _Get_description() const
std::wstring Concurrency::accelerator::get_device_path ( ) const
inline

Returns the system-wide unique device instance path as a std::wstring

1125  {
1126  return _Get_device_path();
1127  }
_AMPIMP const wchar_t * _Get_device_path() const
_AMPIMP bool Concurrency::accelerator::get_has_display ( ) const

Returns a boolean value indicating whether the accelerator is attached to a display

__declspec (property(get=get_description)) std _AMPIMP bool Concurrency::accelerator::get_is_debug ( ) const

Returns a boolean value indicating whether the accelerator was created with DEBUG layer enabled for extensive error reporting

_AMPIMP bool Concurrency::accelerator::get_is_emulated ( ) const

Returns a boolean value indicating whether the accelerator is emulated. This is true, for example, with the direct3d reference and WARP accelerators.

_AMPIMP bool Concurrency::accelerator::get_supports_cpu_shared_memory ( ) const

Returns a boolean value indicating whether the accelerator supports memory accessible both by the accelerator and the CPU.

_AMPIMP bool Concurrency::accelerator::get_supports_double_precision ( ) const

Returns a boolean value indicating whether the accelerator supports full double precision (including double division, precise_math functions, int to double, double to int conversions) in a parallel_for_each kernel.

_AMPIMP bool Concurrency::accelerator::get_supports_limited_double_precision ( ) const

Returns a boolean value indicating whether the accelerator has limited double precision support (excludes double division, precise_math functions, int to double, double to int conversions) for a parallel_for_each kernel.

__declspec (property(get=get_device_path)) std _AMPIMP unsigned int Concurrency::accelerator::get_version ( ) const

Get the version for this accelerator

_AMPIMP bool Concurrency::accelerator::operator!= ( const accelerator _Other) const

Return false if the other accelerator is same as this accelerator; true otherwise

_AMPIMP accelerator& Concurrency::accelerator::operator= ( const accelerator _Other)

Assignment operator

_AMPIMP bool Concurrency::accelerator::operator== ( const accelerator _Other) const

Return true if the other accelerator is same as this accelerator; false otherwise

static bool Concurrency::accelerator::set_default ( const std::wstring _Path)
inlinestatic

Sets the default accelerator to be used for any operation that implicitly uses the default accelerator. This method only succeeds if the runtime selected default accelerator has not already been used in an operation that implicitly uses the default accelerator

Returns
A boolean value indicating if the call succeeds in setting the default accelerator
1106  {
1107  accelerator _Accl(_Path);
1108  return details::_Set_default_accelerator(_Accl._M_impl);
1109  }
_AMPIMP accelerator()
Construct a accelerator representing the default accelerator
_In_z_ wchar_t const * _Path
Definition: corecrt_wstdlib.h:337
_AMPIMP bool __cdecl _Set_default_accelerator(_Accelerator_impl_ptr _Accl)
_AMPIMP bool Concurrency::accelerator::set_default_cpu_access_type ( access_type  _Default_cpu_access_type)

Set the default cpu access_type for arrays created on this accelerator or for implicit memory allocations as part of array_views accessed on this accelerator. This method only succeeds if the default_cpu_access_type for the accelerator has not already been overridden by a previous call to this method and the runtime selected default_cpu_access_type for this accelerator has not yet been used for allocating an array or for an implicit memory allocation backing an array_view accessed on this accelerator.

Parameters
_Default_cpu_access_typeThe default cpu access_type to be used for array/array_view memory allocations on this accelerator.
Returns
A boolean value indicating if the default cpu access_type for the accelerator was successfully set.

Friends And Related Function Documentation

friend class accelerator_view
friend
_Ret_ details::_Accelerator_impl* details::_Get_accelerator_impl_ptr ( const accelerator _Accl)
friend
friend class details::_Ubiquitous_buffer
friend
_AMPIMP friend accelerator_view __cdecl direct3d::create_accelerator_view ( accelerator _Accelerator,
bool  _Disable_timeout,
queuing_mode  _Qmode 
)
friend

Member Data Documentation

_Accelerator_impl_ptr Concurrency::accelerator::_M_impl
private
_AMPIMP const wchar_t Concurrency::accelerator::cpu_accelerator[]
static

String constant for cpu accelerator

_AMPIMP const wchar_t Concurrency::accelerator::default_accelerator[]
static

String constant for default accelerator

_AMPIMP const wchar_t Concurrency::accelerator::direct3d_ref[]
static

String constant for direct3d reference accelerator

_AMPIMP const wchar_t Concurrency::accelerator::direct3d_warp[]
static

String constant for direct3d WARP accelerator


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