accelerator Class
An accelerator is a hardware capability that is optimized for data-parallel computing. An accelerator may be a device attached to a PCIe bus (such as a GPU), or it might be an extended instruction set on the main CPU.
class accelerator;
Name | Description |
---|---|
accelerator Constructor | Initializes a new instance of the accelerator class. |
~accelerator Destructor | Destroys the accelerator object. |
Name | Description |
---|---|
create_view | Creates and returns an accelerator_view object on this accelerator. |
get_all | Returns a vector of accelerator objects that represent all the available accelerators. |
get_auto_selection_view | Returns the auto-selection accelerator_view . |
get_dedicated_memory | Returns the dedicated memory for the accelerator , in kilobytes. |
get_default_cpu_access_type | Returns the default access_type for buffers created on this accelerator. |
get_default_view | Returns the default accelerator_view object that is associated with the accelerator . |
get_description | Returns a short description of the accelerator device. |
get_device_path | Returns the path of the device. |
get_has_display | Determines whether the accelerator is attached to a display. |
get_is_debug | Determines whether the accelerator has the DEBUG layer enabled for extensive error reporting. |
get_is_emulated | Determines whether the accelerator is emulated. |
get_supports_cpu_shared_memory | Determines whether the accelerator supports shared memory |
get_supports_double_precision | Determines whether the accelerator is attached to a display. |
get_supports_limited_double_precision | Determines whether the accelerator has limited support for double-precision math. |
get_version | Returns the version of the accelerator . |
set_default | Returns the path of the default accelerator. |
set_default_cpu_access_type | Sets the default CPU access_typefor arrays and implicit memory allocations made on this accelerator . |
Name | Description |
---|---|
operator!= | Compares this accelerator object with another and returns false if they are the same; otherwise, returns true . |
operator= | Copies the contents of the specified accelerator object to this one. |
operator== | Compares this accelerator object with another and returns true if they are the same; otherwise, returns false . |
Name | Description |
---|---|
cpu_accelerator | Gets a string constant for the CPU accelerator . |
dedicated_memory | Gets the dedicated memory for the accelerator , in kilobytes. |
default_accelerator | Gets a string constant for the default accelerator . |
default_cpu_access_type | Gets or sets the default CPU access_typefor arrays and implicit memory allocations made on this accelerator . |
default_view | Gets the default accelerator_view object that is associated with the accelerator . |
description | Gets a short description of the accelerator device. |
device_path | Gets the path of the device. |
direct3d_ref | Gets a string constant for a Direct3D reference accelerator . |
direct3d_warp | Gets the string constant for an accelerator object that you can use for executing C++ AMP code on multi-core CPUs that use Streaming SIMD Extensions (SSE). |
has_display | Gets a Boolean value that indicates whether the accelerator is attached to a display. |
is_debug | Indicates whether the accelerator has the DEBUG layer enabled for extensive error reporting. |
is_emulated | Indicates whether the accelerator is emulated. |
supports_cpu_shared_memory | Indicates whether the accelerator supports shared memory. |
supports_double_precision | Indicates whether the accelerator supports double-precision math. |
supports_limited_double_precision | Indicates whether the accelerator has limited support for double-precision math. |
version | Gets the version of the accelerator . |
accelerator
An accelerator is a hardware capability that is optimized for data-parallel computing. An accelerator is often a discrete GPU, but it can also be a virtual host-side entity such as a DirectX REF device, a WARP (a CPU-side device that is accelerated by means of SSE instructions), or the CPU itself.
You can construct an accelerator
object by enumerating the available devices, or by getting the default device, the reference device, or the WARP device.
Header: amprt.h
Namespace: Concurrency
Destroys the accelerator
object.
~accelerator();
Initializes a new instance of the accelerator class.
accelerator();
explicit accelerator(const std::wstring& _Device_path);
accelerator(const accelerator& _Other);
_Device_path
The path of the physical device.
_Other
The accelerator to copy.
Gets a string constant for the CPU accelerator.
static const wchar_t cpu_accelerator[];
Creates and returns an accelerator_view
object on this accelerator, using the specified queuing mode. When the queuing mode is not specified, the new accelerator_view
uses the queuing_mode::immediate queuing mode.
accelerator_view create_view(queuing_mode qmode = queuing_mode_automatic);
qmode
The queuing mode.
A new accelerator_view
object on this accelerator, using the specified queuing mode.
Gets the dedicated memory for the accelerator
, in kilobytes.
__declspec(property(get= get_dedicated_memory)) size_t dedicated_memory;
Gets a string constant for the default accelerator
.
static const wchar_t default_accelerator[];
The default cpu access_typefor arrays and implicit memory allocations made on this accelerator
.
__declspec(property(get= get_default_cpu_access_type)) access_type default_cpu_access_type;
Gets the default accelerator view that is associated with the accelerator
.
__declspec(property(get= get_default_view)) accelerator_view default_view;
Gets a short description of the accelerator
device.
__declspec(property(get= get_description)) std::wstring description;
Gets the path of the accelerator. The path is unique on the system.
__declspec(property(get= get_device_path)) std::wstring device_path;
Gets a string constant for a Direct3D reference accelerator.
static const wchar_t direct3d_ref[];
Gets the string constant for an accelerator
object that you can use for executing your C++ AMP code on multi-core CPUs using Streaming SIMD Extensions (SSE).
static const wchar_t direct3d_warp[];
Returns a vector of accelerator
objects that represent all the available accelerators.
static inline std::vector<accelerator> get_all();
The vector of available accelerators
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
static accelerator_view __cdecl get_auto_selection_view();
The auto selection accelerator_view.
Returns the dedicated memory for the accelerator
, in kilobytes.
size_t get_dedicated_memory() const;
The dedicated memory for the accelerator
, in kilobytes.
Gets the default cpu access_type for buffers created on this accelerator
access_type get_default_cpu_access_type() const;
The default cpu access_type for buffers created on this accelerator.
Returns the default accelerator_view
object that is associated with the accelerator
.
accelerator_view get_default_view() const;
The default accelerator_view
object that is associated with the accelerator
.
Returns a short description of the accelerator
device.
std::wstring get_description() const;
A short description of the accelerator
device.
Returns the path of the accelerator. The path is unique on the system.
std::wstring get_device_path() const;
The system-wide unique device instance path.
Returns a Boolean value that indicates whether the accelerator
can output to a display.
bool get_has_display() const;
true
if the accelerator
can output to a display; otherwise, false
.
Determines whether the accelerator
has the DEBUG layer enabled for extensive error reporting.
bool get_is_debug() const;
true
if the accelerator
has the DEBUG layer enabled for extensive error reporting. Otherwise, false
.
Determines whether the accelerator
is emulated.
bool get_is_emulated() const;
true
if the accelerator
is emulated. Otherwise, false
.
Returns a boolean value indicating whether the accelerator supports memory accessible both by the accelerator and the CPU.
bool get_supports_cpu_shared_memory() const;
true
if the accelerator supports CPU shared memory; otherwise, false
.
Returns a Boolean value that indicates whether the accelerator supports double precision math, including fused multiply add (FMA), division, reciprocal, and casting between int
and double
bool get_supports_double_precision() const;
true
if the accelerator supports double precision math; otherwise, false
.
Returns a Boolean value that indicates whether the accelerator has limited support for double precision math. If the accelerator has only limited support, then fused multiply add (FMA), division, reciprocal, and casting between int
and double
are not supported.
bool get_supports_limited_double_precision() const;
true
if the accelerator has limited support for double precision math; otherwise, false
.
Returns the version of the accelerator
.
unsigned int get_version() const;
The version of the accelerator
.
Gets a Boolean value that indicates whether the accelerator
can output to a display.
__declspec(property(get= get_has_display)) bool has_display;
Gets a Boolean value that indicates whether the accelerator
has the DEBUG layer enabled for extensive error reporting.
__declspec(property(get= get_is_debug)) bool is_debug;
Gets a Boolean value that indicates whether the accelerator
is emulated.
__declspec(property(get= get_is_emulated)) bool is_emulated;
Compares this accelerator
object with another and returns false
if they are the same; otherwise, returns true
.
bool operator!= (const accelerator& _Other) const;
_Other
The accelerator
object to compare with this one.
false
if the two accelerator
objects are the same; otherwise, true
.
Copies the contents of the specified accelerator
object to this one.
accelerator& operator= (const accelerator& _Other);
_Other
The accelerator
object to copy from.
A reference to this accelerator
object.
Compares this accelerator
object with another and returns true
if they are the same; otherwise, returns false
.
bool operator== (const accelerator& _Other) const;
_Other
The accelerator
object to compare with this one.
true
if the other accelerator
object is same as this accelerator
object; otherwise, false
.
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
static inline bool set_default(std::wstring _Path);
_Path
The path to the accelerator.
true
if the call succeeds at setting the default accelerator. Otherwise, false
.
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.
bool set_default_cpu_access_type(access_type _Default_cpu_access_type);
_Default_cpu_access_type
The default cpu access_type to be used for array/array_view memory allocations on this accelerator.
A boolean value indicating if the default cpu access_type for the accelerator was successfully set.
Gets a Boolean value indicating whether the accelerator
supports shared memory.
__declspec(property(get= get_supports_cpu_shared_memory)) bool supports_cpu_shared_memory;
Gets a Boolean value that indicates whether the accelerator supports double precision math.
__declspec(property(get= get_supports_double_precision)) bool supports_double_precision;
Gets a Boolean value that indicates whether the accelerator has limited support for double precision math. If the accelerator has only limited support, then fused multiply add (FMA), division, reciprocal, and casting between int
and double
are not supported.
__declspec(property(get= get_supports_limited_double_precision)) bool supports_limited_double_precision;
Gets the version of the accelerator
.
__declspec(property(get= get_version)) unsigned int version;