Comments (5)
@droccom has raised in comments at issue #290 if we should provide reduce either with an identity value or an initial value. Rationale is being aligned with std::reduce
We need to discuss this in detail to make a decision.
from grppi.
If the target is strict consistency with std::reduce
, there should be no way to both avoiding the initial value and using a custom binary operator (only std::plus<>
is supported).
I think this case is very specific, so I suggest to either:
a. avoid adding it to the GrPPI API;
b. extend it to support generic binary operators (relaxing consistency with std::reduce
)
from grppi.
New proposed resolution:
Do not take initial value or identity for reduction operations and apply the following semantics:
- reduce(ex, b, e, binop) -> if (distance(b,e) = 1) return *b
- reduce(ex, b, e, binop) -> Apply reduction over range [b,e)
- reduce(ex, b, e, binop) -> if (distance(b,e) <1) return default constructed value
Requirements:
- value type must be default constructible
- The result is indeterminate if either binop is not associative or not commutative.
from grppi.
This solution makes great sense to me.
from grppi.
We keep the requirement of having to provide identity_value.
Rationale: This is in-line with new reduction objects of parallelism TS in C++. Fastflow also requires an identity value.
from grppi.
Related Issues (20)
- Homogeneous reductions HOT 1
- Study and support heterogeneous reductions HOT 2
- Make all sequential data patterns constexpr HOT 2
- Deprecate access to thread ids HOT 1
- Stream Pool into Master branch HOT 2
- Support LLVM Clang 7.0 and C++17 HOT 1
- Include installation issues HOT 1
- Compile with C++20 HOT 1
- OMP mode is not working HOT 10
- OMP and THR mode has poor performance HOT 7
- Code for the paper "Supporting MPI-distributed stream parallel patterns in GrPPI" HOT 1
- Unable to access loop iterator's value in grppi
- Cannot have multiple maps in a single grppi expression
- Unused lambda captures in stream-pool/TSP sample
- Compilation error in stream-filter/print_primes sample
- Unable to compile unit tests for incomplete backends
- Failed to compile with C++20 due to the removal of std::result_of.
- Remove fastflow back-end HOT 1
- Update oneTBB version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grppi.