bufferkdtree (C sources)
C source code for the Python bufferkdtree implementation
|
#include "include/opencl.h"
Functions | |
void | init_opencl (cl_uint platform_number, cl_platform_id *platform, cl_uint device_number, cl_device_id *device, cl_context *context, cl_command_queue *command_queue, int verbose) |
void | init_command_queue (cl_command_queue *command_queue, cl_device_id *device, cl_context *context) |
void | print_build_information (cl_program program, cl_device_id device) |
int | get_device_infos (cl_uint platform_number, cl_uint device_number, DEVICE_INFOS *device_infos) |
void | check_cl_error (cl_int err, const char *file, int line) |
cl_kernel | make_kernel_from_file (cl_context context, cl_device_id device, char *kernel_constants, char *kernel_filename, const char *kernel_name) |
void | readfile (char *filename, char **text, unsigned long *size) |
void check_cl_error | ( | cl_int | err, |
const char * | file, | ||
int | line | ||
) |
Helper function that checks for an OpenCL error
err | The OpenCL error code (int) |
*file | The source code file |
line | The associated line |
int get_device_infos | ( | cl_uint | platform_number, |
cl_uint | device_number, | ||
DEVICE_INFOS * | device_infos | ||
) |
Returns information about a given OpenCL device/platform
platform_number | The OpenCL platform number |
*device_number | The OpenCL device |
void init_command_queue | ( | cl_command_queue * | command_queue, |
cl_device_id * | device, | ||
cl_context * | context | ||
) |
Initializes a command queue
*command_queue | The OpenCL command queue |
*device | The OpenCL device |
*context | The OpenCL context |
void init_opencl | ( | cl_uint | platform_number, |
cl_platform_id * | platform, | ||
cl_uint | device_number, | ||
cl_device_id * | device, | ||
cl_context * | context, | ||
cl_command_queue * | command_queue, | ||
int | verbose | ||
) |
Initializes the OpenCL context, command_queue, platform, and device.
platform_number | The OpenCL platform number |
*platform | Pointer to platform that shall be initialized |
device_number | The OpenCL device id/number that shall be used |
*device | Pointer to corresponding device |
*context | The OpenCL context |
*command_queue | The OpenCL command queue |
verbose | The verbosity level (0==no output, 1==more output, ...) |
cl_kernel make_kernel_from_file | ( | cl_context | context, |
cl_device_id | device, | ||
char * | kernel_constants, | ||
char * | kernel_filename, | ||
const char * | kernel_name | ||
) |
Generates an OpenCL kernel from a source string.
context | The OpenCL context |
device | The OpenCL device |
*kernel_constants | Pointer to string that contains kernel constants that shall be added to the compiled kernel |
*kernel_filename | Pointer to string containing the kernel code |
*kernel_name | Pointer to string containing the kernel name |
void print_build_information | ( | cl_program | program, |
cl_device_id | device | ||
) |
Prints the build information that stems from a kernel.
program | The OpenCL program to be built |
device | The OpenCL device |
void readfile | ( | char * | filename, |
char ** | text, | ||
unsigned long * | size | ||
) |
Helper function that can read text from a file and stores everything in a char array.
*filename | Pointer to string containing the filename |
**text | Pointer to char* that shall contain the parsed text |
*size | Number of bytes that shall be parsed |