forked from mgowanlock/gpu_self_join
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGPU.h
More file actions
47 lines (30 loc) · 3.39 KB
/
Copy pathGPU.h
File metadata and controls
47 lines (30 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "structs.h"
#include "params.h"
void makeDistanceTableGPUBruteForce(std::vector<std::vector <DTYPE> > * NDdataPoints, DTYPE* epsilon, struct table * neighborTable, unsigned long long int * totalNeighbors);
void distanceTableNDGridBatches(std::vector<std::vector<DTYPE> > * NDdataPoints, const DTYPE epsilon, unsigned int * whichIndexPoints, struct grid * allIndex,
struct gridCellLookup * allGridCellLookupArr, unsigned int * allNNonEmptyCells, DTYPE* allMinArr, unsigned int * allNCells,
unsigned int * allIndexLookupArr, struct neighborTableLookup * neighborTable, std::vector<struct neighborDataPtrs> * pointersToNeighbors,
uint64_t * totalNeighbors, CTYPE* workCounts, unsigned int * orderedQueryPntIDs);
unsigned long long callGPUBatchEst(unsigned int DBSIZE, DTYPE* dev_database, DTYPE epsilon, struct grid * dev_grid,
unsigned int * dev_indexLookupArr, struct gridCellLookup * dev_gridCellLookupArr, DTYPE* dev_minArr,
unsigned int * dev_nCells, unsigned int * dev_nNonEmptyCells, unsigned int * dev_gridCellNDMask,
unsigned int * dev_gridCellNDMaskOffsets, unsigned int * dev_nNDMaskElems, unsigned int * dev_orderedQueryPntIDs, unsigned int * retNumBatches, unsigned int * retGPUBufferSize);
void constructNeighborTableKeyValueWithPtrs(int * pointIDKey, int * pointInDistValue, struct neighborTableLookup * neighborTable, int * pointersToNeighbors, unsigned int * cnt);
void warmUpGPU();
void populateNDGridIndexAndLookupArrayGPU(std::vector<std::vector <DTYPE> > *NDdataPoints, DTYPE *epsilon, DTYPE* minArr, uint64_t totalCells, unsigned int * nCells, struct gridCellLookup ** gridCellLookupArr, struct grid ** index, unsigned int * indexLookupArr, unsigned int *nNonEmptyCells, std::vector<std::vector<int>> *incrementorVects, std::vector<workArrayPnt> *totalPointsWork);
//for the brute force version without batches
void constructNeighborTableKeyValue(int * pointIDKey, int * pointInDistValue, struct table * neighborTable, unsigned int * cnt);
//Unicomp requires multiple updates to the neighbortable for a given point
//This allows updating the neighbortable for the same point
void constructNeighborTableKeyValueWithPtrsWithMultipleUpdates(int * pointIDKey, int * pointInDistValue, struct neighborTableLookup * neighborTable, int * pointersToNeighbors, unsigned int * cnt, pthread_mutex_t * pointLocks);
//Unicomp requires multiple updates to the neighbortable for a given point
//This allows updating the neighbortable for the same point
//WITHOUT VECTORS FOR DATA
void constructNeighborTableKeyValueWithPtrsWithMultipleUpdatesMultipleDataArrays(int * pointIDKey, int * pointInDistValue, struct neighborTableLookup * neighborTable, int * pointersToNeighbors, unsigned int * cnt, int * uniqueKeys, int * uniqueKeyPosition, unsigned int numUniqueKeys);
//Unicomp requires multiple updates to the neighbortable for a given point
//This allows updating the neighbortable for the same point
//Without locks
void constructNeighborTableKeyValueWithPtrsBatchMaskArray(int * pointIDKey, int * pointInDistValue, struct neighborTableLookup * neighborTable, int * pointersToNeighbors, unsigned int * cnt, int batchNum);
//Sort the queries by their workload based on the number of points in the cell
//From hybrid KNN paper in GPGPU'19
void computeWorkDifficulty(unsigned int * outputOrderedQueryPntIDs, struct gridCellLookup * gridCellLookupArr, unsigned int * nNonEmptyCells, unsigned int * indexLookupArr, struct grid * index);