aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aberth/Makefile7
-rw-r--r--aberth/aberth.cpp6
2 files changed, 10 insertions, 3 deletions
diff --git a/aberth/Makefile b/aberth/Makefile
index 10f36b8..82e3260 100644
--- a/aberth/Makefile
+++ b/aberth/Makefile
@@ -1,7 +1,12 @@
CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++17 -fwrapv $(OPTFLAGS)
OPTFLAGS = -O3 -ffast-math -march=native -mtune=native
-LDFLAGS = -pthread -framework OpenCL
+LDFLAGS = -pthread
+ifeq ($(uname),Darwin)
+ LDFLAGS += -framework OpenCL
+else
+ LDFLAGS += -lOpenCL
+endif
TARGETS = aberth
diff --git a/aberth/aberth.cpp b/aberth/aberth.cpp
index 8f65ef1..295e99c 100644
--- a/aberth/aberth.cpp
+++ b/aberth/aberth.cpp
@@ -8,7 +8,6 @@
#include <utility>
#include <tuple>
#include <algorithm>
-#include <numeric>
#include <thread>
#include <mutex>
#include <cstdlib>
@@ -312,7 +311,10 @@ static tuple<int, int, vector<int>> readCounts(const char *fname) {
}
static int rankCounts(vector<int> &counts) {
- int maxcount = reduce(counts.begin(), counts.end(), 0, [](int a, int b) -> int { return max(a, b); });
+ int maxcount = 0;
+ for (int i = 0; i < (int)counts.size(); i++) {
+ maxcount = max(maxcount, counts[i]);
+ }
vector<int> cumul(maxcount + 1, 0);
for (int v : counts) cumul[v]++;