forked from JohanvandeKoppel/clAridlands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Device_Utilities.h
executable file
·45 lines (31 loc) · 1.08 KB
/
Device_Utilities.h
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
//
// Device_Utilities.h
//
// Created by Johan Van de Koppel on 03-09-14.
// Copyright (c) 2014 Johan Van de Koppel. All rights reserved.
//
#ifndef DEVICE_UTILITIES_H
#define DEVICE_UTILITIES_H
#include <string>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
#define ON 1
#define OFF 0
#define Print_All_Devices OFF
// Prints a description of the platform, e.g. an Apple computer
void print_platform_info(cl_platform_id platform);
// Prints the name of the device that is used
void print_device_info(cl_device_id* device, int Device_Nr);
// To prints a detailed description of all processors in the computer
void Query(cl_uint deviceCount, cl_device_id* devices);
// Describes the compile errors occuring while compiling opencl kernel file
void Get_Build_Errors(cl_program program, cl_device_id* device, cl_int ret);
// Builds the kernel file
cl_program BuildKernelFile(std::string filename, cl_context context,
cl_device_id* device, cl_int *err);
// Sets up a device context
cl_context CreateGPUcontext(cl_device_id* &devices);
#endif