Supported Features

Currently the C++ AMP Algorithms Library is split up into two headers and namespaces, one containing the C++ AMP equivalents of many common Standard Library (STL) algorithms, the other more C++ AMP specific features. This split may be removed in a later release.

Functions in bold are implemented in the current 0.9.3 Release. Functions that are crossed out are currently not on the proposed roadmap, this may change in the future. For details of new features added to the upcoming 0.9.4 release see the release notes.

amp_stl_algorithms.h

The algorithms library uses an array_view_iterator (defined in amp_iterators.h) to implement the containers and algorithms design used by the Standard Library.

<algorithm>      
adjacent_difference adjacent_find all_of any_of
binary_search copy copy_backward copy_if
copy_n count count_if equal
equal_range fill fill_n find
find_end find_first_of find_if find_if_not
for_each generate generate_n includes
inplace_merge is_heap is_heap_until is_partitioned
is_sorted is_sorted_until iter_swap lexiographical_compare
lower_bound make_heap max max_element
merge min min_element minmax_element
minmax mismatch next_permutation none_of
nth_element partial_sort partial_sort_copy partition
pop_heap prev_permutation push_heap random_shuffle
remove remove_copy remove_copy_if remove_if
replace replace_copy replace_copy_if replace_if
reverse reverse_copy rotate rotate_copy
search search_n set_difference set_intersection
set_symmetric_difference set_union sort sort_heap
stable_partition stable_sort swap swap_ranges
transform unique unique_copy upper_bound
<numeric>      
accumulate * adjacent_difference inner_product iota
partial_sum **      

If you are not familiar with the Standard Library further details can be found on MSDN’s STL Header Files page.

* The accumulate algorithm was intentionally removed from the set of C++ AMP STL algorithms due to its semantics. It has been replaced with reduce. A parallel reduce implementation requires associativity of the reduction operation while the accumulate method's semantics do not have this requirement. Hence we chose to not provide accumulate and instead provide a reduce method that imposes the associativity requirement.

** The partial_sum algorithm was intentionally removed from the set of C++ AMP STL algorithms due to its semantics. It has been replaced with scan_inclusive.

amp_algorithms.h

This header contains declarations for many common functions from the STL functional header.

<functional>     binary_negate 
divides equal_to greater greater_equal
less less_equal logical_and logical_not
logical_or minus modulus multiplies
negate not1 not2 not_equal_to
plus unary_negate    

In addition it also contains C++ AMP specific implementations—using array_view<> or array<> containers as parameters, rather than iterators—for the following functions:

  • fill – Fill each element of a an array_view with the same value.
  • generate - Assigns the values generated by a function object to each element in an array_view.
  • padded_read – Safely read from a padded array_view.
  • padded_write – Safely write to a padded array_view.
  • radix_sort – Implementation of radix sort on the elements of an array_view.
  • reduce – Implementation of reduce (also called fold) on the elements of an array_view. The replaces the STL accumulate functionality.
  • map_reduce – Implementation of map-reduce on the elements of an array_view. This replaces the STL inner_product functionality.
  • scan – Implementation of prefix sum (also called cumulative sum) on the elements in an array. Both Direct3D and C++ AMP standard implementations are supported. This replaces the STL partial_sum functionality.
  • transform - Applies a specified function object to each element in a source array_view or to a pair of elements from two source array_views and copies the return values of the function object into a destination array_view.

Last edited Dec 21, 2014 at 1:27 AM by AdeMiller, version 25

Comments

No comments yet.