bufferkdtree (C sources)
C source code for the Python bufferkdtree implementation
 All Classes Files Functions Variables Typedefs Macros
Macros | Functions
gpu_opencl.h File Reference
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <time.h>
#include <pthread.h>
#include <string.h>
#include <sched.h>
#include <omp.h>
#include "util.h"
#include "global.h"
#include "../../../include/opencl.h"
#include "../../../include/util.h"
#include "../../../include/float.h"
Include dependency graph for gpu_opencl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STR_HELPER(x)   #x
 
#define STR(x)   STR_HELPER(x)
 
#define WORKGROUP_SIZE   256
 

Functions

void init_gpu (BRUTE_RECORD *brute_record, BRUTE_PARAMETERS *params)
 
void fit_gpu (FLOAT_TYPE *X, int nX, int dX, BRUTE_RECORD *brute_record, BRUTE_PARAMETERS *params)
 
void free_resources_gpu (BRUTE_RECORD *brute_record, BRUTE_PARAMETERS *params)
 
void neighbors_gpu (FLOAT_TYPE *Xtest, int nXtest, int dXtest, FLOAT_TYPE *d_mins, int *idx_mins, BRUTE_RECORD *brute_record, BRUTE_PARAMETERS *params)
 

Macro Definition Documentation

#define STR (   x)    STR_HELPER(x)
#define STR_HELPER (   x)    #x
#define WORKGROUP_SIZE   256

Function Documentation

void fit_gpu ( FLOAT_TYPE X,
int  nX,
int  dX,
BRUTE_RECORD brute_record,
BRUTE_PARAMETERS params 
)

Fits a model given the training data (and parameters)

Parameters
*XArray containing the training patterns
nXNumber of patterns
dXDimensionality of patterns
*brute_recordPointer to struct containing the model
*paramsPointer to struct containing the parameters
void free_resources_gpu ( BRUTE_RECORD brute_record,
BRUTE_PARAMETERS params 
)

Does some clean up (before exiting the program).

Parameters
*brute_recordPointer to struct containing the model
*paramsPointer to struct containing the parameters
void init_gpu ( BRUTE_RECORD brute_record,
BRUTE_PARAMETERS params 
)

Initializes components if needed.

Parameters
*brute_recordPointer to struct containing the model
*paramsPointer to struct containing the parameters
void neighbors_gpu ( FLOAT_TYPE Xtest,
int  nXtest,
int  dXtest,
FLOAT_TYPE d_mins,
int *  idx_mins,
BRUTE_RECORD brute_record,
BRUTE_PARAMETERS params 
)

Computes the predictions (for test patterns)

Parameters
*XtestArray of test patterns
nXestNumber of test patterns
dXtestDimensionality of test patterns
*d_minsArray to store all distances
*idx_minsArray for storing all indices
*brute_recordPointer to struct containing the model
*paramsPointer to struct containing the parameters