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

Comparing OpenCL/OpenCL.xs (file contents):
Revision 1.71 by root, Sat May 5 02:45:38 2012 UTC vs.
Revision 1.75 by root, Sat May 5 14:18:35 2012 UTC

28#if PREFER_1_1 28#if PREFER_1_1
29 #define CL_USE_DEPRECATED_OPENCL_1_1_APIS 29 #define CL_USE_DEPRECATED_OPENCL_1_1_APIS
30#endif 30#endif
31 31
32#ifdef __APPLE__ 32#ifdef __APPLE__
33 #include <OpenCL/opencl.h> 33 #define CLHDR(name) <OpenCL/name>
34#else 34#else
35 #define CLHDR(name) <CL/name>
36#endif
37
35 #include <CL/opencl.h> 38#include CLHDR(opencl.h)
39
40#ifndef CL_VERSION_1_2
41 #include CLHDR(cl_d3d9.h)
42#endif
43
44#if _WIN32
45 #include CLHDR(cl_d3d10.h)
46 #if CL_VERSION_1_2
47 #include CLHDR<cl_d3d11.h>
48 #endif
49 #include CLHDR<cl_dx9_media_sharing.h.h>
36#endif 50#endif
37 51
38#ifndef CL_VERSION_1_2 52#ifndef CL_VERSION_1_2
39 #undef PREFER_1_1 53 #undef PREFER_1_1
40 #define PREFER_1_1 1 54 #define PREFER_1_1 1
41#endif 55#endif
56
57// make sure all constants we might use are actually defined
58#include "default.h"
42 59
43typedef cl_platform_id OpenCL__Platform; 60typedef cl_platform_id OpenCL__Platform;
44typedef cl_device_id OpenCL__Device; 61typedef cl_device_id OpenCL__Device;
45typedef cl_device_id OpenCL__SubDevice; 62typedef cl_device_id OpenCL__SubDevice;
46typedef cl_context OpenCL__Context; 63typedef cl_context OpenCL__Context;
790 { sizeof (cl_long ), "SIZEOF_LONG" }, 807 { sizeof (cl_long ), "SIZEOF_LONG" },
791 { sizeof (cl_ulong ), "SIZEOF_ULONG" }, 808 { sizeof (cl_ulong ), "SIZEOF_ULONG" },
792 { sizeof (cl_half ), "SIZEOF_HALF" }, 809 { sizeof (cl_half ), "SIZEOF_HALF" },
793 { sizeof (cl_float ), "SIZEOF_FLOAT" }, 810 { sizeof (cl_float ), "SIZEOF_FLOAT" },
794 { sizeof (cl_double), "SIZEOF_DOUBLE" }, 811 { sizeof (cl_double), "SIZEOF_DOUBLE" },
812 { PREFER_1_1 , "PREFER_1_1" },
795#include "constiv.h" 813#include "constiv.h"
796 }; 814 };
797 815
798 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) 816 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--)
799 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); 817 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
2509 NEED_SUCCESS (GetProgramBuildInfo, (self, device, ix, size, value, 0)); 2527 NEED_SUCCESS (GetProgramBuildInfo, (self, device, ix, size, value, 0));
2510 EXTEND (SP, 1); 2528 EXTEND (SP, 1);
2511 const int i = 0; 2529 const int i = 0;
2512 PUSHs (sv_2mortal (newSVpv (value, 0))); 2530 PUSHs (sv_2mortal (newSVpv (value, 0)));
2513 2531
2532void
2533binary_type (OpenCL::Program self, OpenCL::Device device)
2534 PPCODE:
2535 cl_program_binary_type value [1];
2536 NEED_SUCCESS (GetProgramBuildInfo, (self, device, CL_PROGRAM_BINARY_TYPE, sizeof (value), value, 0));
2537 EXTEND (SP, 1);
2538 const int i = 0;
2539 PUSHs (sv_2mortal (newSVuv ((UV)value [i])));
2540
2514#END:program_build 2541#END:program_build
2515 2542
2516void 2543void
2517kernel (OpenCL::Program program, SV *function) 2544kernel (OpenCL::Program program, SV *function)
2518 PPCODE: 2545 PPCODE:
2767 CODE: 2794 CODE:
2768 clSetKernelArg (self, idx, sizeof (value), value ? &value : 0); 2795 clSetKernelArg (self, idx, sizeof (value), value ? &value : 0);
2769 2796
2770void 2797void
2771set_image (OpenCL::Kernel self, cl_uint idx, OpenCL::Image_ornull value) 2798set_image (OpenCL::Kernel self, cl_uint idx, OpenCL::Image_ornull value)
2772 ALIAS:
2773 set_image2d = 0
2774 set_image3d = 0
2775 CODE: 2799 CODE:
2776 clSetKernelArg (self, idx, sizeof (value), value ? &value : 0); 2800 clSetKernelArg (self, idx, sizeof (value), value ? &value : 0);
2777 2801
2778void 2802void
2779set_sampler (OpenCL::Kernel self, cl_uint idx, OpenCL::Sampler value) 2803set_sampler (OpenCL::Kernel self, cl_uint idx, OpenCL::Sampler value)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines