ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/OpenCL/OpenCL.xs
(Generate patch)

Comparing OpenCL/OpenCL.xs (file contents):
Revision 1.29 by root, Thu Apr 19 13:51:36 2012 UTC vs.
Revision 1.31 by root, Thu Apr 19 14:36:46 2012 UTC

1#include "EXTERN.h" 1#include "EXTERN.h"
2#include "perl.h" 2#include "perl.h"
3#include "XSUB.h" 3#include "XSUB.h"
4
5#ifdef I_DLFCN
6 #include <dlfcn.h>
7#endif
4 8
5#ifdef __APPLE__ 9#ifdef __APPLE__
6 #include <OpenCL/opencl.h> 10 #include <OpenCL/opencl.h>
7#else 11#else
8 #include <CL/opencl.h> 12 #include <CL/opencl.h>
28typedef cl_kernel OpenCL__Kernel; 32typedef cl_kernel OpenCL__Kernel;
29typedef cl_event OpenCL__Event; 33typedef cl_event OpenCL__Event;
30typedef cl_event OpenCL__UserEvent; 34typedef cl_event OpenCL__UserEvent;
31 35
32typedef SV *FUTURE; 36typedef SV *FUTURE;
37
38/*****************************************************************************/
39
40// name must include a leading underscore
41static void *
42getsym (const char *name)
43{
44 #if defined I_DLFCN && defined RTLD_DEFAULT
45 #if !DLSYM_NEEDS_UNDERSCORE
46 ++name; // skip _
47 #endif
48 return dlsym (RTLD_DEFAULT, name);
49 #else
50 return 0;
51 #endif
52}
33 53
34/*****************************************************************************/ 54/*****************************************************************************/
35 55
36/* up to two temporary buffers */ 56/* up to two temporary buffers */
37static void * 57static void *
1244void 1264void
1245gl_object_info (OpenCL::Memory self) 1265gl_object_info (OpenCL::Memory self)
1246 PPCODE: 1266 PPCODE:
1247 cl_gl_object_type type; 1267 cl_gl_object_type type;
1248 cl_GLuint name; 1268 cl_GLuint name;
1249 NEED_SUCCESS (clGetGLObjectInfo, (self, &type, &name)); 1269 NEED_SUCCESS (GetGLObjectInfo, (self, &type, &name));
1250 EXTEND (SP, 2); 1270 EXTEND (SP, 2);
1251 PUSHs (sv_2mortal (newSVuv (type))); 1271 PUSHs (sv_2mortal (newSVuv (type)));
1252 PUSHs (sv_2mortal (newSVuv (name))); 1272 PUSHs (sv_2mortal (newSVuv (name)));
1253 1273
1254#endif 1274#endif
1299 1319
1300void 1320void
1301target (OpenCL::Image self) 1321target (OpenCL::Image self)
1302 PPCODE: 1322 PPCODE:
1303 cl_GLenum value [1]; 1323 cl_GLenum value [1];
1304 NEED_SUCCESS (GetGlTextureInfo, (self, CL_GL_TEXTURE_TARGET, sizeof (value), value, 0)); 1324 NEED_SUCCESS (GetGLTextureInfo, (self, CL_GL_TEXTURE_TARGET, sizeof (value), value, 0));
1305 EXTEND (SP, 1); 1325 EXTEND (SP, 1);
1306 const int i = 0; 1326 const int i = 0;
1307 PUSHs (sv_2mortal (newSVuv (value [i]))); 1327 PUSHs (sv_2mortal (newSVuv (value [i])));
1308 1328
1309void 1329void
1310gl_mipmap_level (OpenCL::Image self) 1330gl_mipmap_level (OpenCL::Image self)
1311 PPCODE: 1331 PPCODE:
1312 cl_GLint value [1]; 1332 cl_GLint value [1];
1313 NEED_SUCCESS (GetGlTextureInfo, (self, CL_GL_MIPMAP_LEVEL, sizeof (value), value, 0)); 1333 NEED_SUCCESS (GetGLTextureInfo, (self, CL_GL_MIPMAP_LEVEL, sizeof (value), value, 0));
1314 EXTEND (SP, 1); 1334 EXTEND (SP, 1);
1315 const int i = 0; 1335 const int i = 0;
1316 PUSHs (sv_2mortal (newSViv (value [i]))); 1336 PUSHs (sv_2mortal (newSViv (value [i])));
1317 1337
1318#END:gl_texture 1338#END:gl_texture

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines