Skip to content

Commit 011bf45

Browse files
authored
Fixed benchmark problems 10, 11, 48 (#52)
1 parent dbb9539 commit 011bf45

File tree

3 files changed

+6
-3
lines changed
  • drivers/cpp/benchmarks

3 files changed

+6
-3
lines changed

drivers/cpp/benchmarks/geometry/10_geometry_convex_hull/baseline.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ void NO_INLINE correctConvexHull(std::vector<Point> const& points, std::vector<P
2929
std::vector<Point> lowerHull;
3030
upperHull.push_back(pointsSorted[0]);
3131
upperHull.push_back(pointsSorted[1]);
32+
lowerHull.push_back(pointsSorted[pointsSorted.size() - 1]);
33+
lowerHull.push_back(pointsSorted[pointsSorted.size() - 2]);
3234

3335
for (size_t i = 2; i < pointsSorted.size(); i++) {
3436
while (upperHull.size() > 1
@@ -47,7 +49,7 @@ void NO_INLINE correctConvexHull(std::vector<Point> const& points, std::vector<P
4749
}
4850
lowerHull.push_back(pointsSorted[pointsSorted.size() - i - 1]);
4951
}
50-
upperHull.insert(upperHull.end(), lowerHull.begin(), lowerHull.end());
52+
upperHull.insert(upperHull.end(), lowerHull.begin()+1, lowerHull.end()-1);
5153

5254
hull = upperHull;
5355
return;

drivers/cpp/benchmarks/geometry/11_geometry_convex_hull_perimeter/baseline.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ double NO_INLINE correctConvexHullPerimeter(std::vector<Point> const& points) {
3434
std::vector<Point> lowerHull;
3535
upperHull.push_back(pointsSorted[0]);
3636
upperHull.push_back(pointsSorted[1]);
37+
lowerHull.push_back(pointsSorted[pointsSorted.size() - 1]);
38+
lowerHull.push_back(pointsSorted[pointsSorted.size() - 2]);
3739

3840
for (size_t i = 2; i < pointsSorted.size(); i++) {
3941
while (upperHull.size() > 1
@@ -52,7 +54,7 @@ double NO_INLINE correctConvexHullPerimeter(std::vector<Point> const& points) {
5254
}
5355
lowerHull.push_back(pointsSorted[pointsSorted.size() - i - 1]);
5456
}
55-
upperHull.insert(upperHull.end(), lowerHull.begin(), lowerHull.end());
57+
upperHull.insert(upperHull.end(), lowerHull.begin()+1, lowerHull.end()-1);
5658

5759
double perimeter = 0;
5860
for (size_t i = 0; i < upperHull.size() - 1; i++) {

drivers/cpp/benchmarks/sparse_la/48_sparse_la_sparse_axpy/cpu.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ bool validate(Context *ctx) {
122122
correctSparseAxpy(alpha, x, y, correct);
123123

124124
// compute test result
125-
test.clear();
126125
sparseAxpy(alpha, x, y, test);
127126
SYNC();
128127

0 commit comments

Comments
 (0)