summaryrefslogtreecommitdiff
path: root/expt_0525.cu
diff options
context:
space:
mode:
Diffstat (limited to 'expt_0525.cu')
-rw-r--r--expt_0525.cu48
1 files changed, 1 insertions, 47 deletions
diff --git a/expt_0525.cu b/expt_0525.cu
index 5af1fc0..8e7cd10 100644
--- a/expt_0525.cu
+++ b/expt_0525.cu
@@ -204,52 +204,6 @@ public:
}
};
-/*struct MapNode {
- LL key;
- // Node *point[MAX_LEVEL + 1];
- Node *point;
-};
-
-class MemMap {
-public:
- size_t size;
- size_t real_size;
- MapNode *store;
-
- MemMap() : size(0), store(nullptr), real_size(0) {}
-
- __device__ bool insert(MapNode node) {
- bool need_extend = this->size + 1 > this->real_size;
- if (need_extend) {
- bool need_copy = this->real_size == 0;
- if (!need_copy) {
- this->real_size += 1;
- }
- this->real_size *= 2;
- MapNode *old = this->store;
- this->store = new MapNode[this->real_size];
- if (need_copy) {
- memcpy(this->store, old, this->real_size * sizeof(MapNode *));
- }
- delete[] old;
- }
- // need sort after insert
- this->store[size] = node;
- this->size += 1;
- }
-
- __device__ Node *search(LL key) {
- for (int offset = 0; offset < this->size; offset++) {
- if (this->store[offset].key >= key) {
- return this->store[offset].point;
- }
- }
- return nullptr;
- }
-
- __device__ ~MemMap() { delete[] store; }
-};*/
-
// Definition of lock-free skip list
class LockFreeSkipList {
@@ -736,13 +690,13 @@ int main(int argc, char **argv) {
sizeof(key_type) * search_length, cudaMemcpyHostToDevice);
// Launch main kernel
+ blocks = calcBlocks(search_length);
cudaEvent_t start, stop;
cudaEventCreate(&start);
cudaEventCreate(&stop);
cudaEventRecord(start, nullptr);
- blocks = calcBlocks(search_length);
kernel<<<blocks, NUM_THREADS>>>(cudaOperatorItems, search_length, cudaResult);
CudaCheckError();
cudaDeviceSynchronize();