Skip to content

Commit f4fe412

Browse files
committed
fix naming
1 parent 3dc9ba9 commit f4fe412

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

benchrunner/cxx/benchmarks.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ template <typename T> void copyArray(T *b, T* a, int n);
1818

1919
// Relating to C++ templatized versions
2020
extern "C" {
21-
extern int64_t *bottom_up_merge_sort_cxx_int(int64_t *pbase, size_t total_elems);
22-
extern int64_t *insertionsort_cxx_int(int64_t *pbase, size_t total_elems);
23-
extern int64_t *quicksort_cxx_int(int64_t *pbase, size_t total_elems);
21+
extern int64_t *bottom_up_merge_sort_cxx_int(int64_t *pbase, size_t total_elems);
22+
extern int64_t *insertionsort_cxx_int(int64_t *pbase, size_t total_elems);
23+
extern int64_t *quicksort_cxx_int(int64_t *pbase, size_t total_elems);
2424
}
2525

2626
// Microbenchmarks.

benchrunner/cxx/helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int64_t* __attribute__ ((noinline)) fill_array_rand_seq(size_t total_elems)
2626
return (int64_t *) nums;
2727
}
2828

29-
static inline void slice_assert_sorted_2(int64_t *arr, int size)
29+
static inline void slice_assert_sorted(int64_t *arr, int size)
3030
{
3131
size_t len = size;
3232
int64_t a, b;

benchrunner/cxx/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main(int argc, char *argv[]) {
2121
printf("itertime: %lf\n", elapsed_seconds.count());
2222
}
2323

24-
slice_assert_sorted_2(out, arr_size);
24+
slice_assert_sorted(out, arr_size);
2525

2626
std::cout << std::endl;
2727
std::cout << "Benchmarking quicksort inplace: " << std::endl;
@@ -34,7 +34,7 @@ int main(int argc, char *argv[]) {
3434
printf("itertime: %lf\n", elapsed_seconds.count());
3535
}
3636

37-
slice_assert_sorted_2(out, arr_size);
37+
slice_assert_sorted(out, arr_size);
3838

3939
std::cout << std::endl;
4040
std::cout << "Benchmarking mergesort sequential: " << std::endl;
@@ -49,7 +49,7 @@ int main(int argc, char *argv[]) {
4949
printf("itertime: %lf\n", elapsed_seconds.count());
5050
}
5151

52-
slice_assert_sorted_2(out, arr_size);
52+
slice_assert_sorted(out, arr_size);
5353

5454
return 0;
5555
}

benchrunner/cxx/quicksort.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ T *quicksort_inplace(T *_a, size_t n){
1212
}
1313

1414
template<typename T>
15-
static inline void SWAP2(T *a, int i, int j)
15+
static inline void SWAP(T *a, int i, int j)
1616
{
1717
T _tmp = a[i];
1818
a[i] = a[j];
@@ -27,16 +27,16 @@ inline void quicksort_inplace_helper(T *_a, size_t n)
2727
int pi, pj, pn;
2828
if (n <= 1) return;
2929
pi = (rand() % n);
30-
SWAP2(a, 0, pi);
30+
SWAP(a, 0, pi);
3131
pi = 0;
3232
pj = pn = n;
3333
for (;;) {
3434
do {pi++;} while (pi < pn && a[pi] < a[0]);
3535
do {pj--;} while (a[pj] > a[0]);
3636
if (pj < pi) break;
37-
SWAP2(a, pi, pj);
37+
SWAP(a, pi, pj);
3838
}
39-
SWAP2(a, 0, pj);
39+
SWAP(a, 0, pj);
4040
j = pj;
4141
quicksort_inplace_helper(a, j);
4242
quicksort_inplace_helper(&a[j+1], n-j-1);

0 commit comments

Comments
 (0)