File: ocl_utilities.h

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (32 lines) | stat: -rw-r--r-- 974 bytes parent folder | download | duplicates (19)
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
#ifndef OCL_UTILITIES_H
#define OCL_UTILITIES_H

#if defined(__APPLE__)
#include <OpenCL/opencl.h>
#else
#include <CL/opencl.h>
#endif

/* Return the OpenCL error string for a given error number.
 */
const char *opencl_error_string(cl_int error);

/* Find a GPU or a CPU associated with the first available platform.
 * If use_gpu is set, then this function first tries to look for a GPU
 * in the first available platform.
 * If this fails or if use_gpu is not set, then it tries to use the CPU.
 */
cl_device_id opencl_create_device(int use_gpu);

/* Create an OpenCL program from a string and compile it.
 */
cl_program opencl_build_program_from_string(cl_context ctx, cl_device_id dev,
	const char *program_source, size_t program_size,
	const char *opencl_options);

/* Create an OpenCL program from a source file and compile it.
 */
cl_program opencl_build_program_from_file(cl_context ctx, cl_device_id dev,
	const char* filename, const char* opencl_options);

#endif