diff options
| -rw-r--r-- | CMakeLists.txt | 10 | ||||
| -rw-r--r-- | expt_0722.cpp | 23 | ||||
| -rw-r--r-- | expt_0726.cpp | 22 | ||||
| -rw-r--r-- | expt_0729.cu | 14 | ||||
| -rw-r--r-- | expt_0802.cpp | 1 | ||||
| -rw-r--r-- | expt_0804.cu | 1 | ||||
| -rw-r--r-- | expt_0809.cu | 11 | ||||
| -rw-r--r-- | expt_0821.cpp | 1 | ||||
| -rw-r--r-- | expt_0830.cu | 44 | ||||
| -rw-r--r-- | sortlib.cuh | 2 |
10 files changed, 123 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ac6bf41..6e9a8af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,4 +142,12 @@ set_target_properties(expt_0830 PROPERTIES CUDA_ARCHITECTURES "75") set_target_properties(expt_0830 PROPERTIES LINKER_LANGUAGE CUDA) add_executable(normal_skiplist normal_skiplist.cpp) -target_link_libraries(normal_skiplist m stdc++)
\ No newline at end of file +target_link_libraries(normal_skiplist m stdc++) + +add_executable(expt_0406 expt_0406.cu) +target_link_libraries(expt_0406 m stdc++) + +set_target_properties(expt_0406 PROPERTIES + CUDA_SEPARABLE_COMPILATION ON) +set_target_properties(expt_0406 PROPERTIES CUDA_ARCHITECTURES "75") +set_target_properties(expt_0406 PROPERTIES LINKER_LANGUAGE CUDA)
\ No newline at end of file diff --git a/expt_0722.cpp b/expt_0722.cpp index eb1ffed..db4b833 100644 --- a/expt_0722.cpp +++ b/expt_0722.cpp @@ -1,3 +1,22 @@ +// Experimental content: test scale for element cell +/* +Sample output: +scale: 2, max: 7 2: 339 3: 86 4: 27 5: 13 6: 2 7: 2 +scale: 3, max: 6 2: 287 3: 70 4: 18 5: 2 6: 1 +scale: 4, max: 5 2: 257 3: 43 4: 14 5: 3 +scale: 5, max: 5 2: 241 3: 46 4: 6 5: 1 +scale: 6, max: 4 2: 226 3: 26 4: 3 +scale: 7, max: 4 2: 188 3: 26 4: 1 +scale: 8, max: 4 2: 182 3: 20 4: 3 +scale: 9, max: 4 2: 165 3: 17 4: 3 +scale: 10, max: 4 2: 154 3: 16 4: 1 +scale: 11, max: 4 2: 153 3: 9 4: 1 +scale: 12, max: 4 2: 127 3: 11 4: 1 +scale: 13, max: 3 2: 135 3: 5 +scale: 14, max: 3 2: 118 3: 7 +scale: 15, max: 3 2: 129 3: 4 +scale: 16, max: 4 2: 108 3: 5 4: 1 + */ #include <algorithm> #include <cassert> #include <cmath> @@ -5,7 +24,7 @@ #include <iostream> #include <vector> -constexpr size_t length = 1048576; +constexpr size_t length = 2097152; std::vector<unsigned long long> population_vector, sample_vector, original_vector; // std::vector<std::vector<unsigned long long>> result_storage; @@ -91,6 +110,8 @@ int main(int _argc, char const *_argv[]) { ; fclose(file); + // printf("%zu %zu\n", population_vector.size(), length); + assert(population_vector.size() == length); original_vector = population_vector; diff --git a/expt_0726.cpp b/expt_0726.cpp index 1043044..397bc90 100644 --- a/expt_0726.cpp +++ b/expt_0726.cpp @@ -6,7 +6,7 @@ #include <iostream> #include <vector> -constexpr size_t length = 1048576; +constexpr size_t length = 2097152; std::vector<unsigned long long> population_vector, sample_vector, original_vector; // std::vector<std::vector<unsigned long long>> result_storage; @@ -105,4 +105,22 @@ int main(int _argc, char const *_argv[]) { std::chrono::duration_cast<std::chrono::microseconds>(end - start) .count()); } -}
\ No newline at end of file +} +/* + * Sample output: +scale: 2, time spend: 6749258ms +scale: 3, time spend: 1721671ms +scale: 4, time spend: 611112ms +scale: 5, time spend: 353036ms +scale: 6, time spend: 266654ms +scale: 7, time spend: 267346ms +scale: 8, time spend: 267377ms +scale: 9, time spend: 260396ms +scale: 10, time spend: 267724ms +scale: 11, time spend: 263023ms +scale: 12, time spend: 270249ms +scale: 13, time spend: 265440ms +scale: 14, time spend: 266876ms +scale: 15, time spend: 270683ms +scale: 16, time spend: 273216ms + */
\ No newline at end of file diff --git a/expt_0729.cu b/expt_0729.cu index 8ba6aae..2efa575 100644 --- a/expt_0729.cu +++ b/expt_0729.cu @@ -1,3 +1,4 @@ +// Experimental content: test default data layout and scale performance #include <algorithm> #include <cassert> #include <cstdio> @@ -204,4 +205,15 @@ int main(int argc, char const *argv[]) { cudaDeviceSynchronize(); } return 0; -}
\ No newline at end of file +} +/* + * Sample output: +step: 1024 +scale: 2 time: 95.163521 +scale: 3 time: 98.489342 +scale: 4 time: 71.021828 +scale: 5 time: 69.743874 +scale: 6 time: 68.885506 +scale: 7 time: 68.294655 +scale: 8 time: 68.837410 + */
\ No newline at end of file diff --git a/expt_0802.cpp b/expt_0802.cpp index 7d520e2..094da65 100644 --- a/expt_0802.cpp +++ b/expt_0802.cpp @@ -1,3 +1,4 @@ +// Experimental content: Test sort algorithm #include <algorithm> #include <cassert> #include <cmath> diff --git a/expt_0804.cu b/expt_0804.cu index efb32f5..a94dd2b 100644 --- a/expt_0804.cu +++ b/expt_0804.cu @@ -1,3 +1,4 @@ +// Experimental content: Test cdf performance (Deprecated) #include <algorithm> #include <cassert> #include <cstdio> diff --git a/expt_0809.cu b/expt_0809.cu index adc9d36..3f16a9a 100644 --- a/expt_0809.cu +++ b/expt_0809.cu @@ -1,3 +1,14 @@ +// Experimental content: test scale performance +/* + * Sample output: +scale: 2 time: 97.101822 +scale: 3 time: 80.391197 +scale: 4 time: 66.238525 +scale: 5 time: 70.442848 +scale: 6 time: 69.601219 +scale: 7 time: 69.934914 +scale: 8 time: 68.154366 + */ #include <algorithm> #include <cassert> #include <cstdio> diff --git a/expt_0821.cpp b/expt_0821.cpp index cd0fd07..6bbcef0 100644 --- a/expt_0821.cpp +++ b/expt_0821.cpp @@ -1,3 +1,4 @@ +// Experimental content: reliability test #include "sortlib.h" #include <algorithm> #include <cassert> diff --git a/expt_0830.cu b/expt_0830.cu index e48d543..6f7e14a 100644 --- a/expt_0830.cu +++ b/expt_0830.cu @@ -244,4 +244,46 @@ int main() { run_kernel(test_size, true); freeStorage<<<1, 1>>>(); cudaDeviceSynchronize(); -}
\ No newline at end of file +} + +/* + * Sample output: +test size: 32768 +current dim: 16 64 32 +scale: 2 time: 0.100352 +scale: 4 time: 0.102176 +scale: 6 time: 0.104448 +scale: 8 time: 0.100352 +scale: 10 time: 0.100512 +scale: 12 time: 0.104384 +scale: 14 time: 0.101152 +scale: 16 time: 0.099232 +current dim: 32 32 32 +scale: 2 time: 0.099168 +scale: 4 time: 0.101376 +scale: 6 time: 0.106496 +scale: 8 time: 0.099584 +scale: 10 time: 0.111616 +scale: 12 time: 0.106464 +scale: 14 time: 0.100352 +scale: 16 time: 0.108544 +custom current dim: 16 64 32 +scale: 2 time: 0.113664 +scale: 4 time: 0.112512 +scale: 6 time: 0.115712 +scale: 8 time: 0.114720 +scale: 10 time: 0.107232 +scale: 12 time: 0.109568 +scale: 14 time: 0.107328 +scale: 16 time: 0.107520 +custom current dim: 32 32 32 +scale: 2 time: 0.106496 +scale: 4 time: 0.106368 +scale: 6 time: 0.108384 +scale: 8 time: 0.108384 +scale: 10 time: 0.109792 +scale: 12 time: 0.112704 +scale: 14 time: 0.108672 +scale: 16 time: 0.122848 + + */
\ No newline at end of file diff --git a/sortlib.cuh b/sortlib.cuh index 0aba73b..db6c949 100644 --- a/sortlib.cuh +++ b/sortlib.cuh @@ -112,6 +112,7 @@ public: // printf("tmp: %llu %lf %lu\n", *it - *it_prev, tmp, prev_real_location); } + // First version __device__ __host__ key_type * original_binary_search(key_type *start, const key_type *end, key_type &val) { auto begin = start; @@ -138,6 +139,7 @@ public: return last_known_point; } + // CDF original version (should only work on default data layout) __device__ __host__ double sample_cdf(key_type *start, key_type *end, key_type x) { auto it = this->original_binary_search(start, end, x); |
