HCC
HCC is a single-source, C/C++ compiler for heterogeneous computing. It's optimized with HSA (http://www.hsafoundation.com/).
Public Member Functions | Friends | List of all members
Concurrency::accelerator_view Class Reference

Represents a logical (isolated) accelerator view of a compute accelerator. More...

#include <amp.h>

Collaboration diagram for Concurrency::accelerator_view:
Collaboration graph

Public Member Functions

 accelerator_view (const accelerator_view &other)
 Copy-constructs an accelerator_view object. More...
 
accelerator_viewoperator= (const accelerator_view &other)
 Assigns an accelerator_view object to "this" accelerator_view object and returns a reference to "this" object. More...
 
queuing_mode get_queuing_mode () const
 Returns the queuing mode that this accelerator_view was created with. More...
 
bool get_is_auto_selection ()
 Returns a boolean value indicating whether the accelerator view when passed to a parallel_for_each would result in automatic selection of an appropriate execution target by the runtime. More...
 
unsigned int get_version () const
 Returns a 32-bit unsigned integer representing the version number of this accelerator view. More...
 
accelerator get_accelerator () const
 Returns the accelerator that this accelerator_view has been created on.
 
bool get_is_debug () const
 Returns a boolean value indicating whether the accelerator_view supports debugging through extensive error reporting. More...
 
void wait ()
 Performs a blocking wait for completion of all commands submitted to the accelerator view prior to calling wait().
 
void flush ()
 Sends the queued up commands in the accelerator_view to the device for execution. More...
 
completion_future create_marker ()
 This command inserts a marker event into the accelerator_view's command queue. More...
 
bool operator== (const accelerator_view &other) const
 Compares "this" accelerator_view with the passed accelerator_view object to determine if they represent the same underlying object. More...
 
bool operator!= (const accelerator_view &other) const
 Compares "this" accelerator_view with the passed accelerator_view object to determine if they represent different underlying objects. More...
 

Friends

class accelerator
 
template<typename Q , int K>
class array
 
template<typename Q , int K>
class array_view
 
template<typename Kernel , int dim_ext>
void Kalmar::mcw_cxxamp_launch_kernel (const std::shared_ptr< Kalmar::KalmarQueue > &, size_t *, size_t *, const Kernel &)
 
template<typename Kernel , int dim_ext>
std::shared_future< void > * Kalmar::mcw_cxxamp_launch_kernel_async (const std::shared_ptr< Kalmar::KalmarQueue > &, size_t *, size_t *, const Kernel &)
 
template<int N, typename Kernel >
void parallel_for_each (Concurrency::extent< N >, const Kernel &)
 
template<int N, typename Kernel >
void parallel_for_each (const accelerator_view &, Concurrency::extent< N >, const Kernel &)
 
template<typename Kernel >
void parallel_for_each (const accelerator_view &, Concurrency::extent< 1 >, const Kernel &)
 
template<typename Kernel >
void parallel_for_each (const accelerator_view &, Concurrency::extent< 2 >, const Kernel &)
 
template<typename Kernel >
void parallel_for_each (const accelerator_view &, Concurrency::extent< 3 >, const Kernel &)
 
template<int D0, typename Kernel >
void parallel_for_each (tiled_extent< D0 >, const Kernel &)
 
template<int D0, typename Kernel >
void parallel_for_each (const accelerator_view &, tiled_extent< D0 >, const Kernel &)
 
template<int D0, int D1, typename Kernel >
void parallel_for_each (tiled_extent< D0, D1 >, const Kernel &)
 
template<int D0, int D1, typename Kernel >
void parallel_for_each (const accelerator_view &, tiled_extent< D0, D1 >, const Kernel &)
 
template<int D0, int D1, int D2, typename Kernel >
void parallel_for_each (tiled_extent< D0, D1, D2 >, const Kernel &)
 
template<int D0, int D1, int D2, typename Kernel >
void parallel_for_each (const accelerator_view &, tiled_extent< D0, D1, D2 >, const Kernel &)
 

Detailed Description

Represents a logical (isolated) accelerator view of a compute accelerator.

An object of this type can be obtained by calling the default_view property or create_view member functions on an accelerator object.

Constructor & Destructor Documentation

Concurrency::accelerator_view::accelerator_view ( const accelerator_view other)
inline

Copy-constructs an accelerator_view object.

This function does a shallow copy with the newly created accelerator_view object pointing to the same underlying view as the "other" parameter.

Parameters
[in]otherThe accelerator_view object to be copied.

Member Function Documentation

completion_future Concurrency::accelerator_view::create_marker ( )
inline

This command inserts a marker event into the accelerator_view's command queue.

This marker is returned as a completion_future object. When all commands that were submitted prior to the marker event creation have completed, the future is ready.

Returns
A future which can be waited on, and will block until the current batch of commands has completed.
void Concurrency::accelerator_view::flush ( )
inline

Sends the queued up commands in the accelerator_view to the device for execution.

An accelerator_view internally maintains a buffer of commands such as data transfers between the host memory and device buffers, and kernel invocations (parallel_for_each calls). This member function sends the commands to the device for processing. Normally, these commands are sent to the GPU automatically whenever the runtime determines that they need to be, such as when the command buffer is full or when waiting for transfer of data from the device buffers to host memory. The flush member function will send the commands manually to the device.

Calling this member function incurs an overhead and must be used with discretion. A typical use of this member function would be when the CPU waits for an arbitrary amount of time and would like to force the execution of queued device commands in the meantime. It can also be used to ensure that resources on the accelerator are reclaimed after all references to them have been removed.

Because flush operates asynchronously, it can return either before or after the device finishes executing the buffered commands. However, the commands will eventually always complete.

If the queuing_mode is queuing_mode_immediate, this function does nothing.

Returns
None
bool Concurrency::accelerator_view::get_is_auto_selection ( )
inline

Returns a boolean value indicating whether the accelerator view when passed to a parallel_for_each would result in automatic selection of an appropriate execution target by the runtime.

In other words, this is the accelerator view that will be automatically selected if parallel_for_each is invoked without explicitly specifying an accelerator view.

Returns
A boolean value indicating if the accelerator_view is the auto selection accelerator_view.
bool Concurrency::accelerator_view::get_is_debug ( ) const
inline

Returns a boolean value indicating whether the accelerator_view supports debugging through extensive error reporting.

The is_debug property of the accelerator view is usually same as that of the parent accelerator.

queuing_mode Concurrency::accelerator_view::get_queuing_mode ( ) const
inline

Returns the queuing mode that this accelerator_view was created with.

See "Queuing Mode".

Returns
The queuing mode.
unsigned int Concurrency::accelerator_view::get_version ( ) const
inline

Returns a 32-bit unsigned integer representing the version number of this accelerator view.

The format of the integer is major.minor, where the major version number is in the high-order 16 bits, and the minor version number is in the low-order bits.

The version of the accelerator view is usually the same as that of the parent accelerator.

bool Concurrency::accelerator_view::operator!= ( const accelerator_view other) const
inline

Compares "this" accelerator_view with the passed accelerator_view object to determine if they represent different underlying objects.

Parameters
[in]otherThe accelerator_view object to be compared against.
Returns
A boolean value indicating whether the passed accelerator_view object is different from "this" accelerator_view.
accelerator_view& Concurrency::accelerator_view::operator= ( const accelerator_view other)
inline

Assigns an accelerator_view object to "this" accelerator_view object and returns a reference to "this" object.

This function does a shallow assignment with the newly created accelerator_view object pointing to the same underlying view as the passed accelerator_view parameter.

Parameters
[in]otherThe accelerator_view object to be assigned from.
Returns
A reference to "this" accelerator_view object.
bool Concurrency::accelerator_view::operator== ( const accelerator_view other) const
inline

Compares "this" accelerator_view with the passed accelerator_view object to determine if they represent the same underlying object.

Parameters
[in]otherThe accelerator_view object to be compared against.
Returns
A boolean value indicating whether the passed accelerator_view object is same as "this" accelerator_view.

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