summaryrefslogtreecommitdiff
path: root/sortlib.cuh
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2023-05-18 03:40:26 +0800
committerKunoiSayami <[email protected]>2023-05-18 03:40:26 +0800
commitd38b99aba596b1a4edbc7e296f826d5ad936d357 (patch)
treed74a7d00c223f11b25adeed4db05e7f8345839e6 /sortlib.cuh
parent1ad1e0ebf58da30ee7f65a3a1f2a8f62900c47d5 (diff)
fix(exp): Add missing function in expt_0516_2
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'sortlib.cuh')
-rw-r--r--sortlib.cuh8
1 files changed, 4 insertions, 4 deletions
diff --git a/sortlib.cuh b/sortlib.cuh
index 5d32e4b..5bacc11 100644
--- a/sortlib.cuh
+++ b/sortlib.cuh
@@ -19,9 +19,9 @@ public:
__device__ __host__ static size_t fast_log(size_t a) {
#ifdef __CUDA_ARCH__
- return log2((double)a);
+ return (size_t)log2((double)a);
#else
- return std::log2(a);
+ return (size_t)std::log2(a);
#endif
}
@@ -40,11 +40,11 @@ public:
for (size_t i = 0; i < LENGTH; i++) {
auto left = calculate_index(i);
auto right = calculate_rank(left - 1);
- if (i + 1 == LENGTH || i + 1 != right) {
+ /*if (i + 1 == LENGTH || i + 1 != right) {
printf("%lu %lu %lu\n", i, left, right);
printf("%lu %lu %lu\n", LENGTH, fast_log(i + 1),
(LENGTH + 1) >> fast_log(i + 1) >> 1);
- }
+ }*/
assert(i + 1 == right);
}
}