From 8126602f094fa6644ee109d7f8b49fa0a02b5451 Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Mon, 29 Nov 2021 10:09:43 +0800 Subject: dump: 20211129 Signed-off-by: KunoiSayami --- db/skiplist_test.cu | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'db') diff --git a/db/skiplist_test.cu b/db/skiplist_test.cu index 9b7ec7e..e83af79 100644 --- a/db/skiplist_test.cu +++ b/db/skiplist_test.cu @@ -288,30 +288,36 @@ __device__ void update_list(SkipList * l, Key key) { } __global__ void insert_skiplist(int random_seed) { - Arena arena; + //unsigned row = threadIdx.x + blockIdx.x * blockDim.x; + /*for (int i = 0; i < 1000; i++ ) { + update_list(&skipList, device_rnd->Next()); + }*/ +} + +__global__ void init(Arena ** pArena, SkipList ** pSkipList) { Comparator cmp; - auto * skipList = new SkipList(cmp, &arena); - auto * device_rnd = new Random(random_seed); - unsigned row = threadIdx.x + blockIdx.x * blockDim.x; - for (int i = 0; i < 1000; i++ ) { - update_list(skipList, device_rnd->Next()); - } + *pArena = new Arena(); + *pSkipList = new SkipList(cmp, reinterpret_cast(&*pArena)); } __host__ void host_insert_test() { - Key * keys; + //Key * keys; //SkipList list(cmp, &arena); /* for (int i = 0; i < 1000; i++) { keys[i] = .Next(); }*/ + Arena * pArena; + SkipList * skipList; + auto * device_rnd = new Random(test::RandomSeed()); - dim3 blockSize(32, 1); + dim3 blockSize(1, 1); - dim3 gridSize(32, 1); + dim3 gridSize(1, 1); + init<<>>(&pArena, &skipList); insert_skiplist<<>>(test::RandomSeed()); cudaDeviceSynchronize(); -- cgit v1.3.1