summaryrefslogtreecommitdiff
path: root/sortlib.cuh
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2023-07-02 21:53:47 +0800
committerKunoiSayami <[email protected]>2023-07-02 21:53:47 +0800
commitc71e687de86691c0149804ef10721ac9c230ab9e (patch)
treec5edef26ed08eeea4c4479016faea2dbcca7430c /sortlib.cuh
parent0b09bc40d295e7b383f2e5c8ddba255f0ac680ca (diff)
refactor: Change basic function name
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'sortlib.cuh')
-rw-r--r--sortlib.cuh15
1 files changed, 7 insertions, 8 deletions
diff --git a/sortlib.cuh b/sortlib.cuh
index 8d6788e..d9e91a2 100644
--- a/sortlib.cuh
+++ b/sortlib.cuh
@@ -97,9 +97,9 @@ public:
}
/// Should be correct version
- __device__ __host__ double sample_cdf_custom_version(key_type *start,
- // const key_type *end,
- key_type x) const {
+ __device__ __host__ double cdf(key_type *start,
+ // const key_type *end,
+ key_type x) const {
// printf("custom version:\n");
auto it = this->binary_search(start, x);
// printf("search result: %ld\n", it - start);
@@ -220,7 +220,7 @@ class FactorySort {
public:
__device__ __host__ static const key_type *
- cudaBinarySearch(key_type *start, const key_type *end, const key_type val) {
+ binarySearch(key_type *start, const key_type *end, const key_type val) {
auto begin = start;
key_type *last_known_point = begin;
assert(begin < end);
@@ -239,12 +239,11 @@ public:
return last_known_point;
}
- __device__ __host__ double static sample_cdf(key_type *begin,
- unsigned long length,
- key_type x) {
+ __device__ __host__ double static cdf(key_type *begin, unsigned long length,
+ key_type x) {
// printf("%f\n", x);
auto end = begin + length;
- auto it = cudaBinarySearch(begin, end, x);
+ auto it = binarySearch(begin, end, x);
if (it == end) {
return 1;
}