… | |
… | |
35 | |
35 | |
36 | /* up to two temporary buffers */ |
36 | /* up to two temporary buffers */ |
37 | static void * |
37 | static void * |
38 | tmpbuf (size_t size) |
38 | tmpbuf (size_t size) |
39 | { |
39 | { |
|
|
40 | enum { buffers = 3 }; |
40 | static int idx; |
41 | static int idx; |
41 | static void *buf [2]; |
42 | static void *buf [buffers]; |
42 | static size_t len [2]; |
43 | static size_t len [buffers]; |
43 | |
44 | |
44 | idx ^= 1; |
45 | idx = ++idx % buffers; |
45 | |
46 | |
46 | if (len [idx] < size) |
47 | if (len [idx] < size) |
47 | { |
48 | { |
48 | free (buf [idx]); |
49 | free (buf [idx]); |
49 | len [idx] = ((size + 31) & ~4095) + 4096 - 32; |
50 | len [idx] = ((size + 31) & ~4095) + 4096 - 32; |
… | |
… | |
127 | { |
128 | { |
128 | if (SvROK (sv) && sv_derived_from (sv, pkg)) |
129 | if (SvROK (sv) && sv_derived_from (sv, pkg)) |
129 | return (void *)SvIV (SvRV (sv)); |
130 | return (void *)SvIV (SvRV (sv)); |
130 | |
131 | |
131 | croak ("%s: %s is not of type %s", func, svname, pkg); |
132 | croak ("%s: %s is not of type %s", func, svname, pkg); |
|
|
133 | } |
|
|
134 | |
|
|
135 | /*****************************************************************************/ |
|
|
136 | |
|
|
137 | static cl_context_properties * |
|
|
138 | SvCONTEXTPROPERTIES (const char *func, const char *svname, SV *sv, cl_context_properties *extra, int extracount) |
|
|
139 | { |
|
|
140 | if (!sv || !SvOK (sv)) |
|
|
141 | if (extra) |
|
|
142 | sv = sv_2mortal (newRV_noinc ((SV *)newAV ())); // slow, but rarely used hopefully |
|
|
143 | else |
|
|
144 | return 0; |
|
|
145 | |
|
|
146 | if (SvROK (sv) && SvTYPE (SvRV (sv)) == SVt_PVAV) |
|
|
147 | { |
|
|
148 | AV *av = (AV *)SvRV (sv); |
|
|
149 | int i, len = av_len (av) + 1; |
|
|
150 | cl_context_properties *p = tmpbuf (sizeof (cl_context_properties) * (len + extracount + 1)); |
|
|
151 | cl_context_properties *l = p; |
|
|
152 | |
|
|
153 | if (len & 1) |
|
|
154 | croak ("%s: %s is not a property list (must be even number of elements)", func, svname); |
|
|
155 | |
|
|
156 | while (extracount--) |
|
|
157 | *l++ = *extra++; |
|
|
158 | |
|
|
159 | for (i = 0; i < len; i += 2) |
|
|
160 | { |
|
|
161 | cl_context_properties t = SvIV (*av_fetch (av, i , 0)); |
|
|
162 | SV *p_sv = *av_fetch (av, i + 1, 0); |
|
|
163 | cl_context_properties v; |
|
|
164 | |
|
|
165 | switch (t) |
|
|
166 | { |
|
|
167 | default: |
|
|
168 | /* unknown property, treat as int */ |
|
|
169 | v = SvIV (p_sv); |
|
|
170 | break; |
|
|
171 | } |
|
|
172 | |
|
|
173 | *l++ = t; |
|
|
174 | *l++ = v; |
|
|
175 | } |
|
|
176 | |
|
|
177 | *l = 0; |
|
|
178 | |
|
|
179 | return p; |
|
|
180 | } |
|
|
181 | |
|
|
182 | croak ("%s: %s is not a property list (either undef or [type => value, ...])", func, svname); |
132 | } |
183 | } |
133 | |
184 | |
134 | /*****************************************************************************/ |
185 | /*****************************************************************************/ |
135 | |
186 | |
136 | static size_t |
187 | static size_t |
… | |
… | |
175 | |
226 | |
176 | PROTOTYPES: ENABLE |
227 | PROTOTYPES: ENABLE |
177 | |
228 | |
178 | BOOT: |
229 | BOOT: |
179 | { |
230 | { |
180 | HV *stash = gv_stashpv ("OpenCL", 1); |
231 | HV *stash = gv_stashpv ("OpenCL", 1); |
181 | static const ivstr *civ, const_iv[] = { |
232 | static const ivstr *civ, const_iv[] = { |
182 | { sizeof (cl_char ), "SIZEOF_CHAR" }, |
233 | { sizeof (cl_char ), "SIZEOF_CHAR" }, |
183 | { sizeof (cl_uchar ), "SIZEOF_UCHAR" }, |
234 | { sizeof (cl_uchar ), "SIZEOF_UCHAR" }, |
184 | { sizeof (cl_short ), "SIZEOF_SHORT" }, |
235 | { sizeof (cl_short ), "SIZEOF_SHORT" }, |
185 | { sizeof (cl_ushort), "SIZEOF_USHORT" }, |
236 | { sizeof (cl_ushort), "SIZEOF_USHORT" }, |
186 | { sizeof (cl_int ), "SIZEOF_INT" }, |
237 | { sizeof (cl_int ), "SIZEOF_INT" }, |
187 | { sizeof (cl_uint ), "SIZEOF_UINT" }, |
238 | { sizeof (cl_uint ), "SIZEOF_UINT" }, |
188 | { sizeof (cl_long ), "SIZEOF_LONG" }, |
239 | { sizeof (cl_long ), "SIZEOF_LONG" }, |
189 | { sizeof (cl_ulong ), "SIZEOF_ULONG" }, |
240 | { sizeof (cl_ulong ), "SIZEOF_ULONG" }, |
190 | { sizeof (cl_half ), "SIZEOF_HALF" }, |
241 | { sizeof (cl_half ), "SIZEOF_HALF" }, |
191 | { sizeof (cl_float ), "SIZEOF_FLOAT" }, |
242 | { sizeof (cl_float ), "SIZEOF_FLOAT" }, |
192 | { sizeof (cl_double), "SIZEOF_DOUBLE" }, |
243 | { sizeof (cl_double), "SIZEOF_DOUBLE" }, |
193 | #include "constiv.h" |
244 | #include "constiv.h" |
194 | }; |
245 | }; |
195 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) |
246 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) |
196 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
247 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
197 | } |
248 | } |
198 | |
249 | |
199 | cl_int |
250 | cl_int |
200 | errno () |
251 | errno () |
201 | CODE: |
252 | CODE: |
… | |
… | |
221 | EXTEND (SP, count); |
272 | EXTEND (SP, count); |
222 | for (i = 0; i < count; ++i) |
273 | for (i = 0; i < count; ++i) |
223 | PUSHs (NEW_MORTAL_OBJ ("OpenCL::Platform", list [i])); |
274 | PUSHs (NEW_MORTAL_OBJ ("OpenCL::Platform", list [i])); |
224 | |
275 | |
225 | void |
276 | void |
226 | context_from_type (FUTURE properties = 0, cl_device_type type = CL_DEVICE_TYPE_DEFAULT, FUTURE notify = 0) |
277 | context_from_type (cl_context_properties *properties = 0, cl_device_type type = CL_DEVICE_TYPE_DEFAULT, FUTURE notify = 0) |
227 | PPCODE: |
278 | PPCODE: |
228 | NEED_SUCCESS_ARG (cl_context ctx, CreateContextFromType, (0, type, 0, 0, &res)); |
279 | NEED_SUCCESS_ARG (cl_context ctx, CreateContextFromType, (properties, type, 0, 0, &res)); |
229 | XPUSH_NEW_OBJ ("OpenCL::Context", ctx); |
280 | XPUSH_NEW_OBJ ("OpenCL::Context", ctx); |
230 | |
281 | |
231 | void |
282 | void |
232 | context (FUTURE properties, FUTURE devices, FUTURE notify = 0) |
283 | context (cl_context_properties *properties = 0, FUTURE devices, FUTURE notify = 0) |
233 | PPCODE: |
284 | PPCODE: |
234 | /* der Gipfel der Kunst */ |
285 | /* der Gipfel der Kunst */ |
235 | |
286 | |
236 | void |
287 | void |
237 | wait_for_events (...) |
288 | wait_for_events (...) |
… | |
… | |
283 | EXTEND (SP, count); |
334 | EXTEND (SP, count); |
284 | for (i = 0; i < count; ++i) |
335 | for (i = 0; i < count; ++i) |
285 | PUSHs (sv_setref_pv (sv_newmortal (), "OpenCL::Device", list [i])); |
336 | PUSHs (sv_setref_pv (sv_newmortal (), "OpenCL::Device", list [i])); |
286 | |
337 | |
287 | void |
338 | void |
288 | context (OpenCL::Platform self, FUTURE properties, SV *devices, FUTURE notify = 0) |
339 | context (OpenCL::Platform self, cl_context_properties *properties = 0, SV *devices, FUTURE notify = 0) |
289 | PPCODE: |
340 | PPCODE: |
290 | if (!SvROK (devices) || SvTYPE (SvRV (devices)) != SVt_PVAV) |
341 | if (!SvROK (devices) || SvTYPE (SvRV (devices)) != SVt_PVAV) |
291 | croak ("OpenCL::Platform argument 'device' must be an arrayref with device objects, in call"); |
342 | croak ("OpenCL::Platform::context argument 'device' must be an arrayref with device objects, in call"); |
292 | |
343 | |
293 | AV *av = (AV *)SvRV (devices); |
344 | AV *av = (AV *)SvRV (devices); |
294 | cl_uint num_devices = av_len (av) + 1; |
345 | cl_uint num_devices = av_len (av) + 1; |
295 | cl_device_id *device_list = tmpbuf (sizeof (cl_device_id) * num_devices); |
346 | cl_device_id *device_list = tmpbuf (sizeof (cl_device_id) * num_devices); |
296 | int i; |
347 | int i; |
297 | |
348 | |
298 | for (i = num_devices; i--; ) |
349 | for (i = num_devices; i--; ) |
299 | device_list [i] = SvPTROBJ ("clCreateContext", "devices", *av_fetch (av, i, 0), "OpenCL::Device"); |
350 | device_list [i] = SvPTROBJ ("clCreateContext", "devices", *av_fetch (av, i, 0), "OpenCL::Device"); |
300 | |
351 | |
301 | NEED_SUCCESS_ARG (cl_context ctx, CreateContext, (0, num_devices, device_list, 0, 0, &res)); |
352 | NEED_SUCCESS_ARG (cl_context ctx, CreateContext, (properties, num_devices, device_list, 0, 0, &res)); |
302 | XPUSH_NEW_OBJ ("OpenCL::Context", ctx); |
353 | XPUSH_NEW_OBJ ("OpenCL::Context", ctx); |
303 | |
354 | |
304 | void |
355 | void |
305 | context_from_type (OpenCL::Platform self, FUTURE properties = 0, cl_device_type type = CL_DEVICE_TYPE_DEFAULT, FUTURE notify = 0) |
356 | context_from_type (OpenCL::Platform self, SV *properties = 0, cl_device_type type = CL_DEVICE_TYPE_DEFAULT, FUTURE notify = 0) |
306 | PPCODE: |
357 | PPCODE: |
307 | cl_context_properties props[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)self, 0 }; |
358 | cl_context_properties extra[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)self }; |
|
|
359 | cl_context_properties *props = SvCONTEXTPROPERTIES ("OpenCL::Platform::context_from_type", "properties", properties, extra, 2); |
308 | NEED_SUCCESS_ARG (cl_context ctx, CreateContextFromType, (props, type, 0, 0, &res)); |
360 | NEED_SUCCESS_ARG (cl_context ctx, CreateContextFromType, (props, type, 0, 0, &res)); |
309 | XPUSH_NEW_OBJ ("OpenCL::Context", ctx); |
361 | XPUSH_NEW_OBJ ("OpenCL::Context", ctx); |
310 | |
362 | |
311 | MODULE = OpenCL PACKAGE = OpenCL::Device |
363 | MODULE = OpenCL PACKAGE = OpenCL::Device |
312 | |
364 | |
… | |
… | |
565 | |
617 | |
566 | void |
618 | void |
567 | buffer (OpenCL::Context self, cl_mem_flags flags, size_t len) |
619 | buffer (OpenCL::Context self, cl_mem_flags flags, size_t len) |
568 | PPCODE: |
620 | PPCODE: |
569 | if (flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR)) |
621 | if (flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR)) |
570 | croak ("clCreateBuffer: cannot use/copy host ptr when no data is given, use $context->buffer_sv instead?"); |
622 | croak ("OpenCL::Context::buffer: cannot use/copy host ptr when no data is given, use $context->buffer_sv instead?"); |
571 | |
623 | |
572 | NEED_SUCCESS_ARG (cl_mem mem, CreateBuffer, (self, flags, len, 0, &res)); |
624 | NEED_SUCCESS_ARG (cl_mem mem, CreateBuffer, (self, flags, len, 0, &res)); |
573 | XPUSH_NEW_OBJ ("OpenCL::BufferObj", mem); |
625 | XPUSH_NEW_OBJ ("OpenCL::BufferObj", mem); |
574 | |
626 | |
575 | void |
627 | void |
576 | buffer_sv (OpenCL::Context self, cl_mem_flags flags, SV *data) |
628 | buffer_sv (OpenCL::Context self, cl_mem_flags flags, SV *data) |
577 | PPCODE: |
629 | PPCODE: |
578 | STRLEN len; |
630 | STRLEN len; |
579 | char *ptr = SvOK (data) ? SvPVbyte (data, len) : 0; |
631 | char *ptr = SvOK (data) ? SvPVbyte (data, len) : 0; |
580 | if (!(flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR))) |
632 | if (!(flags & (CL_MEM_USE_HOST_PTR | CL_MEM_COPY_HOST_PTR))) |
581 | croak ("clCreateBuffer: have to specify use or copy host ptr when buffer data is given, use $context->buffer instead?"); |
633 | croak ("OpenCL::Context::buffer_sv: you have to specify use or copy host ptr when buffer data is given, use $context->buffer instead?"); |
582 | NEED_SUCCESS_ARG (cl_mem mem, CreateBuffer, (self, flags, len, ptr, &res)); |
634 | NEED_SUCCESS_ARG (cl_mem mem, CreateBuffer, (self, flags, len, ptr, &res)); |
583 | XPUSH_NEW_OBJ ("OpenCL::BufferObj", mem); |
635 | XPUSH_NEW_OBJ ("OpenCL::BufferObj", mem); |
584 | |
636 | |
585 | void |
637 | void |
586 | image2d (OpenCL::Context self, cl_mem_flags flags, cl_channel_order channel_order, cl_channel_type channel_type, size_t width, size_t height, size_t row_pitch = 0, SV *data = &PL_sv_undef) |
638 | image2d (OpenCL::Context self, cl_mem_flags flags, cl_channel_order channel_order, cl_channel_type channel_type, size_t width, size_t height, size_t row_pitch = 0, SV *data = &PL_sv_undef) |
… | |
… | |
597 | STRLEN len; |
649 | STRLEN len; |
598 | char *ptr = SvOK (data) ? SvPVbyte (data, len) : 0; |
650 | char *ptr = SvOK (data) ? SvPVbyte (data, len) : 0; |
599 | const cl_image_format format = { channel_order, channel_type }; |
651 | const cl_image_format format = { channel_order, channel_type }; |
600 | NEED_SUCCESS_ARG (cl_mem mem, CreateImage3D, (self, flags, &format, width, height, depth, row_pitch, slice_pitch, ptr, &res)); |
652 | NEED_SUCCESS_ARG (cl_mem mem, CreateImage3D, (self, flags, &format, width, height, depth, row_pitch, slice_pitch, ptr, &res)); |
601 | XPUSH_NEW_OBJ ("OpenCL::Image3D", mem); |
653 | XPUSH_NEW_OBJ ("OpenCL::Image3D", mem); |
|
|
654 | |
|
|
655 | #if cl_apple_gl_sharing || cl_khr_gl_sharing |
|
|
656 | |
|
|
657 | void |
|
|
658 | gl_buffer (OpenCL::Context self, cl_mem_flags flags, cl_GLuint bufobj) |
|
|
659 | PPCODE: |
|
|
660 | NEED_SUCCESS_ARG (cl_mem mem, CreateFromGLBuffer, (self, flags, bufobj, &res)); |
|
|
661 | XPUSH_NEW_OBJ ("OpenCL::BufferObj", mem); |
|
|
662 | |
|
|
663 | void |
|
|
664 | gl_texture2d (OpenCL::Context self, cl_mem_flags flags, cl_GLenum target, cl_GLint miplevel, cl_GLuint texture) |
|
|
665 | PPCODE: |
|
|
666 | NEED_SUCCESS_ARG (cl_mem mem, CreateFromGLTexture2D, (self, flags, target, miplevel, texture, &res)); |
|
|
667 | XPUSH_NEW_OBJ ("OpenCL::Image2D", mem); |
|
|
668 | |
|
|
669 | void |
|
|
670 | gl_texture3d (OpenCL::Context self, cl_mem_flags flags, cl_GLenum target, cl_GLint miplevel, cl_GLuint texture) |
|
|
671 | PPCODE: |
|
|
672 | NEED_SUCCESS_ARG (cl_mem mem, CreateFromGLTexture3D, (self, flags, target, miplevel, texture, &res)); |
|
|
673 | XPUSH_NEW_OBJ ("OpenCL::Image3D", mem); |
|
|
674 | |
|
|
675 | void |
|
|
676 | gl_renderbuffer (OpenCL::Context self, cl_mem_flags flags, cl_GLuint renderbuffer) |
|
|
677 | PPCODE: |
|
|
678 | NEED_SUCCESS_ARG (cl_mem mem, CreateFromGLRenderbuffer, (self, flags, renderbuffer, &res)); |
|
|
679 | XPUSH_NEW_OBJ ("OpenCL::Image2D", mem); |
|
|
680 | |
|
|
681 | #endif |
602 | |
682 | |
603 | void |
683 | void |
604 | supported_image_formats (OpenCL::Context self, cl_mem_flags flags, cl_mem_object_type image_type) |
684 | supported_image_formats (OpenCL::Context self, cl_mem_flags flags, cl_mem_object_type image_type) |
605 | PPCODE: |
685 | PPCODE: |
606 | { |
686 | { |
… | |
… | |
958 | NEED_SUCCESS (EnqueueNDRangeKernel, (self, kernel, gws_len, gwo, gws, lws, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
1038 | NEED_SUCCESS (EnqueueNDRangeKernel, (self, kernel, gws_len, gwo, gws, lws, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
959 | |
1039 | |
960 | if (ev) |
1040 | if (ev) |
961 | XPUSH_NEW_OBJ ("OpenCL::Event", ev); |
1041 | XPUSH_NEW_OBJ ("OpenCL::Event", ev); |
962 | |
1042 | |
|
|
1043 | #if cl_apple_gl_sharing || cl_khr_gl_sharing |
|
|
1044 | |
|
|
1045 | void |
|
|
1046 | enqueue_acquire_gl_objects (OpenCL::Queue self, SV *objects, ...) |
|
|
1047 | ALIAS: |
|
|
1048 | enqueue_release_gl_objects = 1 |
|
|
1049 | CODE: |
|
|
1050 | if (!SvROK (objects) || SvTYPE (SvRV (objects)) != SVt_PVAV) |
|
|
1051 | croak ("OpenCL::Queue::enqueue_acquire/release_gl_objects argument 'objects' must be an arrayref with memory objects, in call"); |
|
|
1052 | |
|
|
1053 | cl_event ev = 0; |
|
|
1054 | EVENT_LIST (2, items - 2); |
|
|
1055 | AV *av = (AV *)SvRV (objects); |
|
|
1056 | cl_uint num_objects = av_len (av) + 1; |
|
|
1057 | cl_mem *object_list = tmpbuf (sizeof (cl_mem) * num_objects); |
|
|
1058 | int i; |
|
|
1059 | |
|
|
1060 | for (i = num_objects; i--; ) |
|
|
1061 | object_list [i] = SvPTROBJ ("OpenCL::Queue::enqueue_acquire/release_gl_objects", "objects", *av_fetch (av, i, 0), "OpenCL::Memory"); |
|
|
1062 | |
|
|
1063 | if (ix) |
|
|
1064 | NEED_SUCCESS (EnqueueReleaseGLObjects, (self, num_objects, object_list, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
|
|
1065 | else |
|
|
1066 | NEED_SUCCESS (EnqueueAcquireGLObjects, (self, num_objects, object_list, event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0)); |
|
|
1067 | |
|
|
1068 | if (ev) |
|
|
1069 | XPUSH_NEW_OBJ ("OpenCL::Event", ev); |
|
|
1070 | |
|
|
1071 | #endif |
|
|
1072 | |
963 | void |
1073 | void |
964 | enqueue_marker (OpenCL::Queue self) |
1074 | enqueue_marker (OpenCL::Queue self) |
965 | PPCODE: |
1075 | PPCODE: |
966 | cl_event ev; |
1076 | cl_event ev; |
967 | NEED_SUCCESS (EnqueueMarker, (self, &ev)); |
1077 | NEED_SUCCESS (EnqueueMarker, (self, &ev)); |
… | |
… | |
1126 | NEED_SUCCESS (RetainMemObject, (value [i])); |
1236 | NEED_SUCCESS (RetainMemObject, (value [i])); |
1127 | PUSHs (NEW_MORTAL_OBJ ("OpenCL::Memory", value [i])); |
1237 | PUSHs (NEW_MORTAL_OBJ ("OpenCL::Memory", value [i])); |
1128 | } |
1238 | } |
1129 | |
1239 | |
1130 | #END:mem |
1240 | #END:mem |
|
|
1241 | |
|
|
1242 | #if cl_apple_gl_sharing || cl_khr_gl_sharing |
|
|
1243 | |
|
|
1244 | void |
|
|
1245 | gl_object_info (OpenCL::Memory self) |
|
|
1246 | PPCODE: |
|
|
1247 | cl_gl_object_type type; |
|
|
1248 | cl_GLuint name; |
|
|
1249 | NEED_SUCCESS (clGetGLObjectInfo, (self, &type, &name)); |
|
|
1250 | EXTEND (SP, 2); |
|
|
1251 | PUSHs (sv_2mortal (newSVuv (type))); |
|
|
1252 | PUSHs (sv_2mortal (newSVuv (name))); |
|
|
1253 | |
|
|
1254 | #endif |
1131 | |
1255 | |
1132 | MODULE = OpenCL PACKAGE = OpenCL::BufferObj |
1256 | MODULE = OpenCL PACKAGE = OpenCL::BufferObj |
1133 | |
1257 | |
1134 | void |
1258 | void |
1135 | sub_buffer_region (OpenCL::BufferObj self, cl_mem_flags flags, size_t origin, size_t size) |
1259 | sub_buffer_region (OpenCL::BufferObj self, cl_mem_flags flags, size_t origin, size_t size) |
… | |
… | |
1166 | EXTEND (SP, 1); |
1290 | EXTEND (SP, 1); |
1167 | const int i = 0; |
1291 | const int i = 0; |
1168 | PUSHs (sv_2mortal (newSVuv (value [i]))); |
1292 | PUSHs (sv_2mortal (newSVuv (value [i]))); |
1169 | |
1293 | |
1170 | #END:image |
1294 | #END:image |
|
|
1295 | |
|
|
1296 | #if cl_apple_gl_sharing || cl_khr_gl_sharing |
|
|
1297 | |
|
|
1298 | #BEGIN:gl_texture |
|
|
1299 | |
|
|
1300 | void |
|
|
1301 | target (OpenCL::Image self) |
|
|
1302 | PPCODE: |
|
|
1303 | cl_GLenum value [1]; |
|
|
1304 | NEED_SUCCESS (GetGlTextureInfo, (self, CL_GL_TEXTURE_TARGET, sizeof (value), value, 0)); |
|
|
1305 | EXTEND (SP, 1); |
|
|
1306 | const int i = 0; |
|
|
1307 | PUSHs (sv_2mortal (newSVuv (value [i]))); |
|
|
1308 | |
|
|
1309 | void |
|
|
1310 | gl_mipmap_level (OpenCL::Image self) |
|
|
1311 | PPCODE: |
|
|
1312 | cl_GLint value [1]; |
|
|
1313 | NEED_SUCCESS (GetGlTextureInfo, (self, CL_GL_MIPMAP_LEVEL, sizeof (value), value, 0)); |
|
|
1314 | EXTEND (SP, 1); |
|
|
1315 | const int i = 0; |
|
|
1316 | PUSHs (sv_2mortal (newSViv (value [i]))); |
|
|
1317 | |
|
|
1318 | #END:gl_texture |
|
|
1319 | |
|
|
1320 | #endif |
1171 | |
1321 | |
1172 | MODULE = OpenCL PACKAGE = OpenCL::Sampler |
1322 | MODULE = OpenCL PACKAGE = OpenCL::Sampler |
1173 | |
1323 | |
1174 | void |
1324 | void |
1175 | DESTROY (OpenCL::Sampler self) |
1325 | DESTROY (OpenCL::Sampler self) |