Skip to content

Commit d3f5b74

Browse files
author
David Farrell
committed
Fixed typos in gpu_hashtable_delete() and lookup_hashtable()
1 parent db964c8 commit d3f5b74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/linearprobing.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void insert_hashtable(KeyValue* pHashTable, const KeyValue* kvs, uint32_t num_kv
9292
__global__ void gpu_hashtable_lookup(KeyValue* hashtable, KeyValue* kvs, unsigned int numkvs)
9393
{
9494
unsigned int threadid = blockIdx.x * blockDim.x + threadIdx.x;
95-
if (threadid < kHashTableCapacity)
95+
if (threadid < numkvs)
9696
{
9797
uint32_t key = kvs[threadid].key;
9898
uint32_t slot = hash(key);
@@ -135,7 +135,7 @@ void lookup_hashtable(KeyValue* pHashTable, KeyValue* kvs, uint32_t num_kvs)
135135

136136
// Insert all the keys into the hash table
137137
int gridsize = ((uint32_t)num_kvs + threadblocksize - 1) / threadblocksize;
138-
gpu_hashtable_insert << <gridsize, threadblocksize >> > (pHashTable, device_kvs, (uint32_t)num_kvs);
138+
gpu_hashtable_lookup << <gridsize, threadblocksize >> > (pHashTable, device_kvs, (uint32_t)num_kvs);
139139

140140
cudaEventRecord(stop);
141141

@@ -156,7 +156,7 @@ void lookup_hashtable(KeyValue* pHashTable, KeyValue* kvs, uint32_t num_kvs)
156156
__global__ void gpu_hashtable_delete(KeyValue* hashtable, const KeyValue* kvs, unsigned int numkvs)
157157
{
158158
unsigned int threadid = blockIdx.x * blockDim.x + threadIdx.x;
159-
if (threadid < kHashTableCapacity)
159+
if (threadid < numkvs)
160160
{
161161
uint32_t key = kvs[threadid].key;
162162
uint32_t slot = hash(key);

0 commit comments

Comments
 (0)