[PATCH] D41844: [libcxx] implement <experimental/simd> mask reductions

Tim Shen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 8 16:46:31 PST 2018


timshen created this revision.
timshen added reviewers: mclow.lists, EricWF.
Herald added a subscriber: sanjoy.

This is not efficiently implemented

  typename V::value_type
  reduce(const const_where_expression<M, V> &x,
         typename V::value_type neutral_element, BinaryOperation binary_op);

as we don't know the "identity value" of binary_op, where "identity
value" id has the following characteristic:

  binary_op(id, x) == binary_op(x, id) == x, for all x.

The best we can do is to compile-time dispatch BinaryOperation for
binary std:: operations.

To make it efficient, users need to provide the identity value for their
binary_op. We can add this library extension in the future.


https://reviews.llvm.org/D41844

Files:
  libcxx/include/experimental/simd
  libcxx/test/std/experimental/simd/simd.horizontal/hmax.pass.cpp
  libcxx/test/std/experimental/simd/simd.horizontal/hmin.pass.cpp
  libcxx/test/std/experimental/simd/simd.horizontal/reduce.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41844.129004.patch
Type: text/x-patch
Size: 12239 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180109/f8db9ddc/attachment.bin>


More information about the cfe-commits mailing list