Muokkaa

Jaa


accelerator_view Class

Represents a virtual device abstraction on a C++ AMP data-parallel accelerator.

Syntax

class accelerator_view;

Members

Public Constructors

Name Description
accelerator_view Constructor Initializes a new instance of the accelerator_view class.
~accelerator_view Destructor Destroys the accelerator_view object.

Public Methods

Name Description
create_marker Returns a future to track the completion of all commands submitted so far to this accelerator_view object.
flush Submits all pending commands queued to the accelerator_view object to the accelerator for execution.
get_accelerator Returns the accelerator object for the accelerator_view object.
get_is_auto_selection Returns a Boolean value that indicates whether the runtime will automatically select an appropriate accelerator when the accelerator_view object is passed to a parallel_for_each.
get_is_debug Returns a Boolean value that indicates whether the accelerator_view object has the DEBUG layer enabled for extensive error reporting.
get_queuing_mode Returns the queuing mode for the accelerator_view object.
get_version Returns the version of the accelerator_view.
wait Waits for all commands submitted to the accelerator_view object to finish.

Public Operators

Name Description
operator!= Compares this accelerator_view object with another and returns false if they are the same; otherwise, returns true.
operator= Copies the contents of the specified accelerator_view object into this one.
operator== Compares this accelerator_view object with another and returns true if they are the same; otherwise, returns false.

Public Data Members

Name Description
accelerator Gets the accelerator object for the accelerator_view object.
is_auto_selection Gets a Boolean value that indicates whether the runtime will automatically select an appropriate accelerator when the accelerator_view object is passed to a parallel_for_each.
is_debug Gets a Boolean value that indicates whether the accelerator_view object has the DEBUG layer enabled for extensive error reporting.
queuing_mode Gets the queuing mode for the accelerator_view object.
version Gets the version of the accelerator.

Inheritance Hierarchy

accelerator_view

Remarks

An accelerator_view object represents a logical, isolated view of an accelerator. A single physical compute device can have many logical, isolated accelerator_view objects. Each accelerator has a default accelerator_view object. Additional accelerator_view objects can be created.

Physical devices can be shared among many client threads. Client threads can cooperatively use the same accelerator_view object of an accelerator, or each client can communicate with a compute device via an independent accelerator_view object for isolation from other client threads.

An accelerator_view object can have one of two queuing_mode Enumeration states. If the queuing mode is immediate, commands like copy and parallel_for_each are sent to the corresponding accelerator device as soon as they return to the caller. If the queuing mode is deferred, such commands are queued up on a command queue that corresponds to the accelerator_view object. Commands are not actually sent to the device until flush() is called.

Requirements

Header: amprt.h

Namespace: Concurrency

accelerator

Gets the accelerator object for the accelerator_view object.

Syntax

__declspec(property(get= get_accelerator)) Concurrency::accelerator accelerator;

accelerator_view

Initializes a new instance of the accelerator_view class by copying an existing accelerator_view object.

Syntax

accelerator_view( const accelerator_view & other );

Parameters

other
The accelerator_view object to copy.

create_marker

Returns a future to track the completion of all commands submitted so far to this accelerator_view object.

Syntax

concurrency::completion_future create_marker();

Return Value

A future to track the completion of all commands submitted so far to this accelerator_view object.

flush

Submits all pending commands queued to the accelerator_view object to the accelerator for execution.

Syntax

void flush();

Return Value

Returns void.

get_accelerator

Returns the accelerator object for the accelerator_view object.

Syntax

accelerator get_accelerator() const;

Return Value

The accelerator object for the accelerator_view object.

get_is_auto_selection

Returns a Boolean value that indicates whether the runtime will automatically select an appropriate accelerator when the accelerator_view is passed to a parallel_for_each.

Syntax

bool get_is_auto_selection() const;

Return Value

true if the runtime will automatically select an appropriate accelerator; otherwise, false.

get_is_debug

Returns a Boolean value that indicates whether the accelerator_view object has the DEBUG layer enabled for extensive error reporting.

Syntax

bool get_is_debug() const;

Return Value

A Boolean value that indicates whether the accelerator_view object has the DEBUG layer enabled for extensive error reporting.

get_queuing_mode

Returns the queuing mode for the accelerator_view object.

Syntax

queuing_mode get_queuing_mode() const;

Return Value

The queuing mode for the accelerator_view object.

get_version

Returns the version of the accelerator_view.

Syntax

unsigned int get_version() const;

Return Value

The version of the accelerator_view.

is_auto_selection

Gets a Boolean value that indicates whether the runtime will automatically select an appropriate accelerator when the accelerator_view is passed to a parallel_for_each.

Syntax

__declspec(property(get= get_is_auto_selection)) bool is_auto_selection;

is_debug

Gets a Boolean value that indicates whether the accelerator_view object has the DEBUG layer enabled for extensive error reporting.

Syntax

__declspec(property(get= get_is_debug)) bool is_debug;

operator!=

Compares this accelerator_view object with another and returns false if they are the same; otherwise, returns true.

Syntax

bool operator!= ( const accelerator_view & other ) const;

Parameters

other
The accelerator_view object to compare with this one.

Return Value

false if the two objects are the same; otherwise, true.

operator=

Copies the contents of the specified accelerator_view object into this one.

Syntax

accelerator_view & operator= ( const accelerator_view & other );

Parameters

other
The accelerator_view object to copy from.

Return Value

A reference to the modified accelerator_view object.

operator==

Compares this accelerator_view object with another and returns true if they are the same; otherwise, returns false.

Syntax

bool operator== ( const accelerator_view & other ) const;

Parameters

other
The accelerator_view object to compare with this one.

Return Value

true if the two objects are the same; otherwise, false.

queuing_mode

Gets the queuing mode for the accelerator_view object.

Syntax

__declspec(property(get= get_queuing_mode)) Concurrency::queuing_mode queuing_mode;

version

Gets the version of the accelerator_view.

Syntax

__declspec(property(get= get_version)) unsigned int version;

wait

Waits for all commands submitted to the accelerator_view object to finish.

Syntax

void wait();

Return Value

Returns void.

Remarks

If the queuing_mode is immediate, this method returns immediately without blocking.

~accelerator_view

Destroys the accelerator_view object.

Syntax

~accelerator_view();

See also

Concurrency Namespace (C++ AMP)