diff options
| author | KunoiSayami <[email protected]> | 2022-01-26 02:29:32 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2022-01-26 02:29:32 +0800 |
| commit | 1e4c8faa097c5423604e343bf20745f57c81f2a9 (patch) | |
| tree | a53e5ea771e7cf47af139b841b3ec5f3dec974bb /db/skiplist_test.cu | |
| parent | 543b7460adb9d76d3f6160fe7946e974ad9d4950 (diff) | |
test(skiplist): Use atomic arena
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'db/skiplist_test.cu')
| -rw-r--r-- | db/skiplist_test.cu | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/db/skiplist_test.cu b/db/skiplist_test.cu index fc295d7..06675cd 100644 --- a/db/skiplist_test.cu +++ b/db/skiplist_test.cu @@ -404,7 +404,8 @@ constexpr size_t SKIPLIST_TEST_SIZE = BLOCK_COUNT_X * BLOCK_COUNT_Y * TEST_STEP; __global__ void testParallel(SkipList<Key, Comparator> * skipList, Key * keys, CudaSpinLock * lock) { unsigned int start = blockIdx.x * blockDim.x + threadIdx.x; - //printf("start: %u %d %d %d\n", start, blockIdx.x ,blockDim.x, threadIdx.x); + printf("%u\t%d\t%d\t%d\n", start, blockIdx.x, blockDim.x, threadIdx.x); + //printf("%u\n", start); //lock->lock(); //printf("start insert: %u\n", start); /*for (unsigned i = start * TEST_STEP; i < (start + 1) * TEST_STEP; i++) { @@ -430,10 +431,17 @@ __global__ void testKeysIsEqualLists(SkipList<Key, Comparator> * skiplist, const SkipList<Key, Comparator>::Iterator iter(skiplist); iter.SeekToFirst(); + bool need_break = false; + int break_after = 20; for (unsigned i = 0; i < SKIPLIST_TEST_SIZE ; i++ ) { assert(iter.Valid()); //printf("%d %lu %lu\n", i, iter.key(), sorted_keys[i]); + if (iter.key() != sorted_keys[i]) { + need_break = true; + } + if (need_break && !--break_after) + break; assert(iter.key() == sorted_keys[i]); iter.Next(); } @@ -541,7 +549,7 @@ TEST(SkipTest, TestSingleCudaInsert) { #endif testSingle<<<1, 1>>>(*skipList, device_keys); cudaDeviceSynchronize(); - printf("%d\n", cudaGetLastError()); + //printf("%d\n", cudaGetLastError() == cudaSuccess); showTimeSpan(start_time); std::sort(sorted_keys, sorted_keys + SKIPLIST_TEST_SIZE); |
