HCC
HCC is a single-source, C/C++ compiler for heterogeneous computing. It's optimized with HSA (http://www.hsafoundation.com/).
Classes | Namespaces | Typedefs | Functions | Variables
amp.h File Reference

C++ AMP API. More...

#include "hc_defines.h"
#include "kalmar_exception.h"
#include "kalmar_index.h"
#include "kalmar_runtime.h"
#include "kalmar_buffer.h"
#include "kalmar_serialize.h"
#include "kalmar_launch.h"
#include "kalmar_cpu_launch.h"
Include dependency graph for amp.h:

Go to the source code of this file.

Classes

class  Concurrency::array_view< T, N >
 The array_view<T,N> type represents a possibly cached view into the data held in an array<T,N>, or a section thereof. More...
 
class  Concurrency::array< T, N >
 Represents an N-dimensional region of memory (with type T) located on an accelerator. More...
 
class  Concurrency::extent< N >
 Represents a unique position in N-dimensional space. More...
 
class  Concurrency::tiled_extent< D0, D1, D2 >
 Represents an extent subdivided into 1-, 2-, or 3-dimensional tiles. More...
 
class  Concurrency::accelerator_view
 Represents a logical (isolated) accelerator view of a compute accelerator. More...
 
class  Concurrency::accelerator
 Represents a physical accelerated computing device. More...
 
class  Concurrency::completion_future
 This class is the return type of all C++ AMP asynchronous APIs and has an interface analogous to std::shared_future<void>. More...
 
class  Concurrency::extent< N >
 Represents a unique position in N-dimensional space. More...
 
class  Concurrency::tile_barrier
 The tile_barrier class is a capability class that is only creatable by the system, and passed to a tiled parallel_for_each function object as part of the tiled_index parameter. More...
 
class  Concurrency::tiled_index< D0, D1, D2 >
 Represents a set of related indices subdivided into 1-, 2-, or 3-dimensional tiles. More...
 
class  Concurrency::tiled_index< D0, 0, 0 >
 Represents a set of related indices subdivided into 1-, 2-, or 3-dimensional tiles. More...
 
class  Concurrency::tiled_index< D0, D1, 0 >
 Represents a set of related indices subdivided into 1-, 2-, or 3-dimensional tiles. More...
 
class  Concurrency::tiled_extent< D0, D1, D2 >
 Represents an extent subdivided into 1-, 2-, or 3-dimensional tiles. More...
 
class  Concurrency::tiled_extent< D0, D1, 0 >
 Represents an extent subdivided into 1-, 2-, or 3-dimensional tiles. More...
 
class  Concurrency::tiled_extent< D0, 0, 0 >
 Represents an extent subdivided into 1-, 2-, or 3-dimensional tiles. More...
 
struct  Concurrency::projection_helper< T, N >
 
struct  Concurrency::projection_helper< T, 1 >
 
struct  Concurrency::projection_helper< const T, N >
 
struct  Concurrency::projection_helper< const T, 1 >
 
struct  Concurrency::array_projection_helper< T, N >
 
struct  Concurrency::array_projection_helper< T, 1 >
 
class  Concurrency::array< T, N >
 Represents an N-dimensional region of memory (with type T) located on an accelerator. More...
 
struct  Concurrency::__has_data< T >
 
struct  Concurrency::__has_size< T >
 
struct  Concurrency::__is_container< T >
 
class  Concurrency::array_view< T, N >
 The array_view<T,N> type represents a possibly cached view into the data held in an array<T,N>, or a section thereof. More...
 
class  Concurrency::array_view< const T, N >
 The partial specialization array_view<const T,N> represents a view over elements of type const T with rank N. More...
 
struct  Concurrency::copy_input< InputIter, T, N, dim >
 
struct  Concurrency::copy_input< InputIter, T, N, N >
 
struct  Concurrency::copy_output< OutputIter, T, N, dim >
 
struct  Concurrency::copy_output< OutputIter, T, N, N >
 
struct  Concurrency::copy_bidir< T, N, dim >
 
struct  Concurrency::copy_bidir< T, N, N >
 
struct  Concurrency::do_copy< Iter, T, N >
 
struct  Concurrency::do_copy< Iter, T, 1 >
 
struct  Concurrency::do_copy< T *, T, N >
 
struct  Concurrency::do_copy< T *, T, 1 >
 
struct  Concurrency::pfe_helper< N, Kernel, _Tp >
 
struct  Concurrency::pfe_helper< 0, Kernel, _Tp >
 
class  Concurrency::pfe_wrapper< N, Kernel >
 

Namespaces

 Concurrency
 C++ AMP namespace.
 

Typedefs

template<int N>
using Concurrency::index = Kalmar::index< N >
 Represents a unique position in N-dimensional space.
 
using Concurrency::runtime_exception = Kalmar::runtime_exception
 
using Concurrency::invalid_compute_domain = Kalmar::invalid_compute_domain
 
using Concurrency::accelerator_view_removed = Kalmar::accelerator_view_removed
 

Functions

void Concurrency::all_memory_fence (const tile_barrier &)
 Establishes a thread-tile scoped memory fence for both global and tile-static memory operations. More...
 
void Concurrency::global_memory_fence (const tile_barrier &)
 Establishes a thread-tile scoped memory fence for global (but not tile-static) memory operations. More...
 
void Concurrency::tile_static_memory_fence (const tile_barrier &)
 Establishes a thread-tile scoped memory fence for tile-static (but not global) memory operations. More...
 
template<int N>
const Concurrency::extent< N > & Concurrency::check (const Concurrency::extent< N > &ext)
 
template<typename T , int N>
void Concurrency::copy (const array< T, N > &src, array< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename OutputIter , typename T , int N>
void Concurrency::copy (const array_view< T, N > &src, OutputIter destBegin)
 The contents of a source array are copied into "dest" starting with iterator destBegin. More...
 
template<typename OutputIter , typename T , int N>
void Concurrency::copy (const array< T, N > &src, OutputIter destBegin)
 The contents of a source array are copied into "dest" starting with iterator destBegin. More...
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array< T, N > &src, array< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array< T, N > &src, const array_view< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename OutputIter , typename T , int N>
completion_future Concurrency::copy_async (const array< T, N > &src, OutputIter destBegin)
 The contents of a source array are copied into "dest" starting with iterator destBegin. More...
 
template<typename OutputIter , typename T , int N>
completion_future Concurrency::copy_async (const array_view< T, N > &src, OutputIter destBegin)
 The contents of a source array are copied into "dest" starting with iterator destBegin. More...
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array< T, N > &src, const array< T, N > &dest)
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array_view< const T, N > &src, const array< T, N > &dest)
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array_view< T, N > &src, const array< T, N > &dest)
 
template<int N, typename Kernel >
void Concurrency::parallel_for_each (const accelerator_view &, extent< N > compute_domain, const Kernel &f)
 
template<int D0, int D1, int D2, typename Kernel >
void Concurrency::parallel_for_each (const accelerator_view &accl_view, tiled_extent< D0, D1, D2 > compute_domain, const Kernel &f)
 
template<int D0, int D1, typename Kernel >
void Concurrency::parallel_for_each (const accelerator_view &accl_view, tiled_extent< D0, D1 > compute_domain, const Kernel &f)
 
template<int D0, typename Kernel >
void Concurrency::parallel_for_each (const accelerator_view &accl_view, tiled_extent< D0 > compute_domain, const Kernel &f)
 
template<int N, typename Kernel >
void Concurrency::parallel_for_each (extent< N > compute_domain, const Kernel &f)
 
template<int D0, int D1, int D2, typename Kernel >
void Concurrency::parallel_for_each (tiled_extent< D0, D1, D2 > compute_domain, const Kernel &f)
 
template<int D0, int D1, typename Kernel >
void Concurrency::parallel_for_each (tiled_extent< D0, D1 > compute_domain, const Kernel &f)
 
template<int D0, typename Kernel >
void Concurrency::parallel_for_each (tiled_extent< D0 > compute_domain, const Kernel &f)
 
template<int N, typename Kernel >
 Concurrency::__attribute__ ((noinline, used)) void parallel_for_each(const accelerator_view &av
 
 Concurrency::for (int i=0;i< N;i++)
 
 Concurrency::if (av.get_accelerator().get_device_path()==L"cpu")
 
const pfe_wrapper< N, Kernel > Concurrency::_pf (compute_domain, f)
 
template<typename Kernel >
 Concurrency::__attribute__ ((noinline, used)) void parallel_for_each(const accelerator_view &av
 
 Concurrency::if (static_cast< size_t >(compute_domain[1])*static_cast< size_t >(compute_domain[2]) > 4294967295L) throw invalid_compute_domain("Extent size too large.")
 
 Concurrency::if (static_cast< size_t >(compute_domain[0])*static_cast< size_t >(compute_domain[2]) > 4294967295L) throw invalid_compute_domain("Extent size too large.")
 
 Concurrency::if (static_cast< size_t >(compute_domain[0])*static_cast< size_t >(compute_domain[1])*static_cast< size_t >(compute_domain[2]) > 4294967295L) throw invalid_compute_domain("Extent size too large.")
 
 Concurrency::if (ext%tile!=0)
 
template<int D0, int D1, typename Kernel >
 Concurrency::__attribute__ ((noinline, used)) void parallel_for_each(const accelerator_view &av
 
 Concurrency::if ((ext[0]%tile[0]!=0)||(ext[1]%tile[1]!=0))
 
template<int D0, int D1, int D2, typename Kernel >
 Concurrency::__attribute__ ((noinline, used)) void parallel_for_each(const accelerator_view &av
 
 Concurrency::if ((ext[0]%tile[0]!=0)||(ext[1]%tile[1]!=0)||(ext[2]%tile[2]!=0))
 
template<typename T , int N>
void Concurrency::copy (const array_view< const T, N > &src, const array_view< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
void Concurrency::copy (const array_view< T, N > &src, const array_view< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T >
void Concurrency::copy (const array_view< const T, 1 > &src, const array_view< T, 1 > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
void Concurrency::copy (const array< T, N > &src, const array_view< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T >
void Concurrency::copy (const array< T, 1 > &src, const array_view< T, 1 > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
void Concurrency::copy (const array_view< const T, N > &src, array< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
void Concurrency::copy (const array_view< T, N > &src, array< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T >
void Concurrency::copy (const array_view< const T, 1 > &src, array< T, 1 > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
void Concurrency::copy (InputIter srcBegin, InputIter srcEnd, const array_view< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
void Concurrency::copy (InputIter srcBegin, const array_view< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
void Concurrency::copy (InputIter srcBegin, InputIter srcEnd, array< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
void Concurrency::copy (InputIter srcBegin, array< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
template<int N>
extent< N > Concurrency::operator+ (const extent< N > &lhs, const extent< N > &rhs)
 Adds (or subtracts) two objects of extent<N> to form a new extent. More...
 
template<int N>
extent< N > Concurrency::operator- (const extent< N > &lhs, const extent< N > &rhs)
 Adds (or subtracts) two objects of extent<N> to form a new extent. More...
 
template<int N>
extent< N > Concurrency::operator+ (const extent< N > &ext, int value)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator+ (int value, const extent< N > &ext)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator- (const extent< N > &ext, int value)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator- (int value, const extent< N > &ext)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator* (const extent< N > &ext, int value)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator* (int value, const extent< N > &ext)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator/ (const extent< N > &ext, int value)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator/ (int value, const extent< N > &ext)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator% (const extent< N > &ext, int value)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<int N>
extent< N > Concurrency::operator% (int value, const extent< N > &ext)
 Binary arithmetic operations that produce a new extent<N> that is the result of performing the corresponding binary arithmetic operation on the elements of the extent operands. More...
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array_view< const T, N > &src, array< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array_view< T, N > &src, array< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array_view< const T, N > &src, const array_view< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename T , int N>
completion_future Concurrency::copy_async (const array_view< T, N > &src, const array_view< T, N > &dest)
 The contents of "src" are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
completion_future Concurrency::copy_async (InputIter srcBegin, InputIter srcEnd, array< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
completion_future Concurrency::copy_async (InputIter srcBegin, array< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
completion_future Concurrency::copy_async (InputIter srcBegin, InputIter srcEnd, const array_view< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
template<typename InputIter , typename T , int N>
completion_future Concurrency::copy_async (InputIter srcBegin, const array_view< T, N > &dest)
 The contents of a source container from the iterator range [srcBegin,srcEnd) are copied into "dest". More...
 
unsigned int Concurrency::atomic_exchange (unsigned int *dest, unsigned int val)
 Atomically read the value stored in dest , replace it with the value given in val and return the old value to the caller. More...
 
int Concurrency::atomic_exchange (int *dest, int val)
 Atomically read the value stored in dest , replace it with the value given in val and return the old value to the caller. More...
 
float Concurrency::atomic_exchange (float *dest, float val)
 Atomically read the value stored in dest , replace it with the value given in val and return the old value to the caller. More...
 
unsigned int Concurrency::atomic_compare_exchange (unsigned int *dest, unsigned int *expected_val, unsigned int val)
 These functions attempt to perform these three steps atomically: More...
 
int Concurrency::atomic_compare_exchange (int *dest, int *expected_val, int val)
 These functions attempt to perform these three steps atomically: More...
 
unsigned Concurrency::atomic_fetch_add (unsigned *x, unsigned y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_add (int *x, int y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
float Concurrency::atomic_fetch_add (float *x, float y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
unsigned Concurrency::atomic_fetch_sub (unsigned *x, unsigned y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_sub (int *x, int y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
float Concurrency::atomic_fetch_sub (float *x, float y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
unsigned Concurrency::atomic_fetch_and (unsigned *x, unsigned y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_and (int *x, int y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
unsigned Concurrency::atomic_fetch_or (unsigned *x, unsigned y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_or (int *x, int y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
unsigned Concurrency::atomic_fetch_xor (unsigned *x, unsigned y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_xor (int *x, int y)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_max (int *dest, int val)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
unsigned int Concurrency::atomic_fetch_max (unsigned int *dest, unsigned int val)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_min (int *dest, int val)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
unsigned int Concurrency::atomic_fetch_min (unsigned int *dest, unsigned int val)
 Atomically read the value stored in dest, apply the binary numerical operation specific to the function with the read value and val serving as input operands, and store the result back to the location pointed by dest. More...
 
int Concurrency::atomic_fetch_inc (int *_Dest)
 Atomically increment or decrement the value stored at the location point to by dest. More...
 
unsigned int Concurrency::atomic_fetch_inc (unsigned int *_Dest)
 Atomically increment or decrement the value stored at the location point to by dest. More...
 
int Concurrency::atomic_fetch_dec (int *_Dest)
 Atomically increment or decrement the value stored at the location point to by dest. More...
 
unsigned int Concurrency::atomic_fetch_dec (unsigned int *_Dest)
 Atomically increment or decrement the value stored at the location point to by dest. More...
 

Variables

extent< N > Concurrency::compute_domain
 
extent< N > const Kernel & Concurrency::f
 
size_t Concurrency::ext [3]
 
size_t Concurrency::tile = compute_domain.tile_dim0
 

Detailed Description

C++ AMP API.