From 86ee8db7781ffe1ec75c96b157338430930cad57 Mon Sep 17 00:00:00 2001 From: Tomasz Koziara Date: Tue, 25 Jun 2013 12:45:51 +0100 Subject: [PATCH] Parallel prefix sum added + minor amendements. --- examples/sort/sort.cpp | 17 +++++++------- examples/sort/sort.ispc | 49 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 13 deletions(-) diff --git a/examples/sort/sort.cpp b/examples/sort/sort.cpp index 083bafa6..21c7eb01 100644 --- a/examples/sort/sort.cpp +++ b/examples/sort/sort.cpp @@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -55,10 +56,9 @@ static inline void progressbar (unsigned int x, unsigned int n, unsigned int w = if ((x != n) && (x % (n/100) != 0)) return; using namespace std; - float ratio = x/(float)n; int c = ratio * w; - + cout << setw(3) << (int)(ratio*100) << "% ["; for (int x=0; x