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