00001
00002
00003
00004
00005
00006
00007
00008 #ifndef OCL_H_
00009 #define OCL_H_
00010
00011
00012 #include<CL/cl.h>
00013 #include<stdio.h>
00014 #include<string>
00015 #include<vector>
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00021
00022
00023
00024 typedef struct {
00025 cl_device_type type;
00026 cl_uint num;
00027 cl_int gl_index;
00028 } device_info_t;
00029
00030
00031 typedef struct __host_info_id {
00032
00033
00034 std::string platform;
00035 std::vector<device_info_t> devices;
00036
00037 void clear() {
00038
00039 platform.clear();
00040 devices.clear();
00041 }
00042 } host_info, * host_info_id;
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 extern cl_int initOpenCL(host_info_id host,cl_device_type devType,cl_bool supportGL);
00055
00056
00057 extern cl_int loadDataCL();
00058 extern cl_int displayCL();
00059 extern cl_int runCL();
00060 extern cl_int loadField(void *Ptr);
00061 extern cl_int bindOpenCL(cl_uint GLpbo,cl_int w,cl_int h);
00062 extern cl_int setDevice();
00063
00064
00065
00066
00067 extern void shutdownOpenCL(void);
00068
00069 #ifdef __cplusplus
00070 }
00071 #endif
00072
00073 namespace FemViewer {
00074
00075
00076 }
00077
00078
00079 #endif