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

Comparing OpenCL/OpenCL.xs (file contents):
Revision 1.13 by root, Sun Nov 20 01:09:48 2011 UTC vs.
Revision 1.15 by root, Sun Nov 20 22:29:36 2011 UTC

242 242
243#BEGIN:platform 243#BEGIN:platform
244 244
245void 245void
246profile (OpenCL::Platform this) 246profile (OpenCL::Platform this)
247 PPCODE: 247 PPCODE:
248 size_t size; 248 size_t size;
249 int i, n;
250 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_PROFILE, 0, 0, &size)); 249 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_PROFILE, 0, 0, &size));
251 char *value = tmpbuf (size); 250 char *value = tmpbuf (size);
252 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_PROFILE, size, value, 0)); 251 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_PROFILE, size, value, 0));
253 n = 1; 252 int i, n = 1;
254 EXTEND (SP, n); 253 EXTEND (SP, n);
255 for (i = 0; i < n; ++i) 254 for (i = 0; i < n; ++i)
256 PUSHs (sv_2mortal (newSVpvn (value, size))); 255 PUSHs (sv_2mortal (newSVpv (value, 0)));
257 256
258void 257void
259version (OpenCL::Platform this) 258version (OpenCL::Platform this)
260 PPCODE: 259 PPCODE:
261 size_t size; 260 size_t size;
262 int i, n;
263 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VERSION, 0, 0, &size)); 261 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VERSION, 0, 0, &size));
264 char *value = tmpbuf (size); 262 char *value = tmpbuf (size);
265 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VERSION, size, value, 0)); 263 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VERSION, size, value, 0));
266 n = 1; 264 int i, n = 1;
267 EXTEND (SP, n); 265 EXTEND (SP, n);
268 for (i = 0; i < n; ++i) 266 for (i = 0; i < n; ++i)
269 PUSHs (sv_2mortal (newSVpvn (value, size))); 267 PUSHs (sv_2mortal (newSVpv (value, 0)));
270 268
271void 269void
272name (OpenCL::Platform this) 270name (OpenCL::Platform this)
273 PPCODE: 271 PPCODE:
274 size_t size; 272 size_t size;
275 int i, n;
276 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_NAME, 0, 0, &size)); 273 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_NAME, 0, 0, &size));
277 char *value = tmpbuf (size); 274 char *value = tmpbuf (size);
278 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_NAME, size, value, 0)); 275 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_NAME, size, value, 0));
279 n = 1; 276 int i, n = 1;
280 EXTEND (SP, n); 277 EXTEND (SP, n);
281 for (i = 0; i < n; ++i) 278 for (i = 0; i < n; ++i)
282 PUSHs (sv_2mortal (newSVpvn (value, size))); 279 PUSHs (sv_2mortal (newSVpv (value, 0)));
283 280
284void 281void
285vendor (OpenCL::Platform this) 282vendor (OpenCL::Platform this)
286 PPCODE: 283 PPCODE:
287 size_t size; 284 size_t size;
288 int i, n;
289 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VENDOR, 0, 0, &size)); 285 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VENDOR, 0, 0, &size));
290 char *value = tmpbuf (size); 286 char *value = tmpbuf (size);
291 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VENDOR, size, value, 0)); 287 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_VENDOR, size, value, 0));
292 n = 1; 288 int i, n = 1;
293 EXTEND (SP, n); 289 EXTEND (SP, n);
294 for (i = 0; i < n; ++i) 290 for (i = 0; i < n; ++i)
295 PUSHs (sv_2mortal (newSVpvn (value, size))); 291 PUSHs (sv_2mortal (newSVpv (value, 0)));
296 292
297void 293void
298extensions (OpenCL::Platform this) 294extensions (OpenCL::Platform this)
299 PPCODE: 295 PPCODE:
300 size_t size; 296 size_t size;
301 int i, n;
302 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_EXTENSIONS, 0, 0, &size)); 297 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_EXTENSIONS, 0, 0, &size));
303 char *value = tmpbuf (size); 298 char *value = tmpbuf (size);
304 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_EXTENSIONS, size, value, 0)); 299 NEED_SUCCESS (GetPlatformInfo, (this, CL_PLATFORM_EXTENSIONS, size, value, 0));
305 n = 1; 300 int i, n = 1;
306 EXTEND (SP, n); 301 EXTEND (SP, n);
307 for (i = 0; i < n; ++i) 302 for (i = 0; i < n; ++i)
308 PUSHs (sv_2mortal (newSVpvn (value, size))); 303 PUSHs (sv_2mortal (newSVpv (value, 0)));
309 304
310#END:platform 305#END:platform
311 306
312void 307void
313devices (OpenCL::Platform this, cl_device_type type = CL_DEVICE_TYPE_ALL) 308devices (OpenCL::Platform this, cl_device_type type = CL_DEVICE_TYPE_ALL)
352 347
353void 348void
354info (OpenCL::Device this, cl_device_info name) 349info (OpenCL::Device this, cl_device_info name)
355 PPCODE: 350 PPCODE:
356 INFO (Device) 351 INFO (Device)
352
353#BEGIN:device
354
355void
356type (OpenCL::Device this)
357 PPCODE:
358 cl_device_type value [1];
359 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_TYPE, sizeof (value), value, 0));
360 EXTEND (SP, 1);
361 const int i = 0;
362 PUSHs (sv_2mortal (newSViv (value [i])));
363
364void
365vendor_id (OpenCL::Device this)
366 PPCODE:
367 cl_uint value [1];
368 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_VENDOR_ID, sizeof (value), value, 0));
369 EXTEND (SP, 1);
370 const int i = 0;
371 PUSHs (sv_2mortal (newSVuv (value [i])));
372
373void
374max_compute_units (OpenCL::Device this)
375 PPCODE:
376 cl_uint value [1];
377 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof (value), value, 0));
378 EXTEND (SP, 1);
379 const int i = 0;
380 PUSHs (sv_2mortal (newSVuv (value [i])));
381
382void
383max_work_item_dimensions (OpenCL::Device this)
384 PPCODE:
385 cl_uint value [1];
386 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof (value), value, 0));
387 EXTEND (SP, 1);
388 const int i = 0;
389 PUSHs (sv_2mortal (newSVuv (value [i])));
390
391void
392max_work_group_size (OpenCL::Device this)
393 PPCODE:
394 size_t value [1];
395 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof (value), value, 0));
396 EXTEND (SP, 1);
397 const int i = 0;
398 PUSHs (sv_2mortal (newSVuv (value [i])));
399
400void
401max_work_item_sizes (OpenCL::Device this)
402 PPCODE:
403 size_t size;
404 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_WORK_ITEM_SIZES, 0, 0, &size));
405 size_t *value = tmpbuf (size);
406 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_WORK_ITEM_SIZES, size, value, 0));
407 int i, n = size / sizeof (*value);
408 EXTEND (SP, n);
409 for (i = 0; i < n; ++i)
410 PUSHs (sv_2mortal (newSVuv (value [i])));
411
412void
413preferred_vector_width_char (OpenCL::Device this)
414 PPCODE:
415 cl_uint value [1];
416 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof (value), value, 0));
417 EXTEND (SP, 1);
418 const int i = 0;
419 PUSHs (sv_2mortal (newSVuv (value [i])));
420
421void
422preferred_vector_width_short (OpenCL::Device this)
423 PPCODE:
424 cl_uint value [1];
425 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, sizeof (value), value, 0));
426 EXTEND (SP, 1);
427 const int i = 0;
428 PUSHs (sv_2mortal (newSVuv (value [i])));
429
430void
431preferred_vector_width_int (OpenCL::Device this)
432 PPCODE:
433 cl_uint value [1];
434 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, sizeof (value), value, 0));
435 EXTEND (SP, 1);
436 const int i = 0;
437 PUSHs (sv_2mortal (newSVuv (value [i])));
438
439void
440preferred_vector_width_long (OpenCL::Device this)
441 PPCODE:
442 cl_uint value [1];
443 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, sizeof (value), value, 0));
444 EXTEND (SP, 1);
445 const int i = 0;
446 PUSHs (sv_2mortal (newSVuv (value [i])));
447
448void
449preferred_vector_width_float (OpenCL::Device this)
450 PPCODE:
451 cl_uint value [1];
452 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, sizeof (value), value, 0));
453 EXTEND (SP, 1);
454 const int i = 0;
455 PUSHs (sv_2mortal (newSVuv (value [i])));
456
457void
458preferred_vector_width_double (OpenCL::Device this)
459 PPCODE:
460 cl_uint value [1];
461 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, sizeof (value), value, 0));
462 EXTEND (SP, 1);
463 const int i = 0;
464 PUSHs (sv_2mortal (newSVuv (value [i])));
465
466void
467max_clock_frequency (OpenCL::Device this)
468 PPCODE:
469 cl_uint value [1];
470 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_CLOCK_FREQUENCY, sizeof (value), value, 0));
471 EXTEND (SP, 1);
472 const int i = 0;
473 PUSHs (sv_2mortal (newSVuv (value [i])));
474
475void
476address_bits (OpenCL::Device this)
477 PPCODE:
478 cl_bitfield value [1];
479 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_ADDRESS_BITS, sizeof (value), value, 0));
480 EXTEND (SP, 1);
481 const int i = 0;
482 PUSHs (sv_2mortal (newSVuv (value [i])));
483
484void
485max_read_image_args (OpenCL::Device this)
486 PPCODE:
487 cl_uint value [1];
488 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_READ_IMAGE_ARGS, sizeof (value), value, 0));
489 EXTEND (SP, 1);
490 const int i = 0;
491 PUSHs (sv_2mortal (newSVuv (value [i])));
492
493void
494max_write_image_args (OpenCL::Device this)
495 PPCODE:
496 cl_uint value [1];
497 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_WRITE_IMAGE_ARGS, sizeof (value), value, 0));
498 EXTEND (SP, 1);
499 const int i = 0;
500 PUSHs (sv_2mortal (newSVuv (value [i])));
501
502void
503max_mem_alloc_size (OpenCL::Device this)
504 PPCODE:
505 cl_ulong value [1];
506 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof (value), value, 0));
507 EXTEND (SP, 1);
508 const int i = 0;
509 PUSHs (sv_2mortal (newSVuv (value [i])));
510
511void
512image2d_max_width (OpenCL::Device this)
513 PPCODE:
514 size_t value [1];
515 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof (value), value, 0));
516 EXTEND (SP, 1);
517 const int i = 0;
518 PUSHs (sv_2mortal (newSVuv (value [i])));
519
520void
521image2d_max_height (OpenCL::Device this)
522 PPCODE:
523 size_t value [1];
524 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof (value), value, 0));
525 EXTEND (SP, 1);
526 const int i = 0;
527 PUSHs (sv_2mortal (newSVuv (value [i])));
528
529void
530image3d_max_width (OpenCL::Device this)
531 PPCODE:
532 size_t value [1];
533 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof (value), value, 0));
534 EXTEND (SP, 1);
535 const int i = 0;
536 PUSHs (sv_2mortal (newSVuv (value [i])));
537
538void
539image3d_max_height (OpenCL::Device this)
540 PPCODE:
541 size_t value [1];
542 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof (value), value, 0));
543 EXTEND (SP, 1);
544 const int i = 0;
545 PUSHs (sv_2mortal (newSVuv (value [i])));
546
547void
548image3d_max_depth (OpenCL::Device this)
549 PPCODE:
550 size_t value [1];
551 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof (value), value, 0));
552 EXTEND (SP, 1);
553 const int i = 0;
554 PUSHs (sv_2mortal (newSVuv (value [i])));
555
556void
557image_support (OpenCL::Device this)
558 PPCODE:
559 cl_uint value [1];
560 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_IMAGE_SUPPORT, sizeof (value), value, 0));
561 EXTEND (SP, 1);
562 const int i = 0;
563 PUSHs (sv_2mortal (newSVuv (value [i])));
564
565void
566max_parameter_size (OpenCL::Device this)
567 PPCODE:
568 size_t value [1];
569 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof (value), value, 0));
570 EXTEND (SP, 1);
571 const int i = 0;
572 PUSHs (sv_2mortal (newSVuv (value [i])));
573
574void
575max_samplers (OpenCL::Device this)
576 PPCODE:
577 cl_uint value [1];
578 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_SAMPLERS, sizeof (value), value, 0));
579 EXTEND (SP, 1);
580 const int i = 0;
581 PUSHs (sv_2mortal (newSVuv (value [i])));
582
583void
584mem_base_addr_align (OpenCL::Device this)
585 PPCODE:
586 cl_uint value [1];
587 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof (value), value, 0));
588 EXTEND (SP, 1);
589 const int i = 0;
590 PUSHs (sv_2mortal (newSVuv (value [i])));
591
592void
593min_data_type_align_size (OpenCL::Device this)
594 PPCODE:
595 cl_uint value [1];
596 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, sizeof (value), value, 0));
597 EXTEND (SP, 1);
598 const int i = 0;
599 PUSHs (sv_2mortal (newSVuv (value [i])));
600
601void
602single_fp_config (OpenCL::Device this)
603 PPCODE:
604 cl_device_fp_config value [1];
605 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_SINGLE_FP_CONFIG, sizeof (value), value, 0));
606 EXTEND (SP, 1);
607 const int i = 0;
608 PUSHs (sv_2mortal (newSVuv (value [i])));
609
610void
611global_mem_cache_type (OpenCL::Device this)
612 PPCODE:
613 cl_device_mem_cache_type value [1];
614 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, sizeof (value), value, 0));
615 EXTEND (SP, 1);
616 const int i = 0;
617 PUSHs (sv_2mortal (newSVuv (value [i])));
618
619void
620global_mem_cacheline_size (OpenCL::Device this)
621 PPCODE:
622 cl_uint value [1];
623 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, sizeof (value), value, 0));
624 EXTEND (SP, 1);
625 const int i = 0;
626 PUSHs (sv_2mortal (newSVuv (value [i])));
627
628void
629global_mem_cache_size (OpenCL::Device this)
630 PPCODE:
631 cl_ulong value [1];
632 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, sizeof (value), value, 0));
633 EXTEND (SP, 1);
634 const int i = 0;
635 PUSHs (sv_2mortal (newSVuv (value [i])));
636
637void
638global_mem_size (OpenCL::Device this)
639 PPCODE:
640 cl_ulong value [1];
641 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof (value), value, 0));
642 EXTEND (SP, 1);
643 const int i = 0;
644 PUSHs (sv_2mortal (newSVuv (value [i])));
645
646void
647max_constant_buffer_size (OpenCL::Device this)
648 PPCODE:
649 cl_ulong value [1];
650 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof (value), value, 0));
651 EXTEND (SP, 1);
652 const int i = 0;
653 PUSHs (sv_2mortal (newSVuv (value [i])));
654
655void
656max_constant_args (OpenCL::Device this)
657 PPCODE:
658 cl_uint value [1];
659 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_MAX_CONSTANT_ARGS, sizeof (value), value, 0));
660 EXTEND (SP, 1);
661 const int i = 0;
662 PUSHs (sv_2mortal (newSVuv (value [i])));
663
664void
665local_mem_type (OpenCL::Device this)
666 PPCODE:
667 cl_device_local_mem_type value [1];
668 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_LOCAL_MEM_TYPE, sizeof (value), value, 0));
669 EXTEND (SP, 1);
670 const int i = 0;
671 PUSHs (sv_2mortal (newSVuv (value [i])));
672
673void
674local_mem_size (OpenCL::Device this)
675 PPCODE:
676 cl_ulong value [1];
677 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_LOCAL_MEM_SIZE, sizeof (value), value, 0));
678 EXTEND (SP, 1);
679 const int i = 0;
680 PUSHs (sv_2mortal (newSVuv (value [i])));
681
682void
683error_correction_support (OpenCL::Device this)
684 PPCODE:
685 cl_bool value [1];
686 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_ERROR_CORRECTION_SUPPORT, sizeof (value), value, 0));
687 EXTEND (SP, 1);
688 const int i = 0;
689 PUSHs (sv_2mortal (value [i] ? &PL_sv_yes : &PL_sv_no));
690
691void
692profiling_timer_resolution (OpenCL::Device this)
693 PPCODE:
694 size_t value [1];
695 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PROFILING_TIMER_RESOLUTION, sizeof (value), value, 0));
696 EXTEND (SP, 1);
697 const int i = 0;
698 PUSHs (sv_2mortal (newSVuv (value [i])));
699
700void
701endian_little (OpenCL::Device this)
702 PPCODE:
703 cl_bool value [1];
704 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_ENDIAN_LITTLE, sizeof (value), value, 0));
705 EXTEND (SP, 1);
706 const int i = 0;
707 PUSHs (sv_2mortal (value [i] ? &PL_sv_yes : &PL_sv_no));
708
709void
710available (OpenCL::Device this)
711 PPCODE:
712 cl_bool value [1];
713 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_AVAILABLE, sizeof (value), value, 0));
714 EXTEND (SP, 1);
715 const int i = 0;
716 PUSHs (sv_2mortal (value [i] ? &PL_sv_yes : &PL_sv_no));
717
718void
719compiler_available (OpenCL::Device this)
720 PPCODE:
721 cl_bool value [1];
722 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_COMPILER_AVAILABLE, sizeof (value), value, 0));
723 EXTEND (SP, 1);
724 const int i = 0;
725 PUSHs (sv_2mortal (value [i] ? &PL_sv_yes : &PL_sv_no));
726
727void
728execution_capabilities (OpenCL::Device this)
729 PPCODE:
730 cl_device_exec_capabilities value [1];
731 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_EXECUTION_CAPABILITIES, sizeof (value), value, 0));
732 EXTEND (SP, 1);
733 const int i = 0;
734 PUSHs (sv_2mortal (newSVuv (value [i])));
735
736void
737properties (OpenCL::Device this)
738 PPCODE:
739 cl_command_queue_properties value [1];
740 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_QUEUE_PROPERTIES, sizeof (value), value, 0));
741 EXTEND (SP, 1);
742 const int i = 0;
743 PUSHs (sv_2mortal (newSViv (value [i])));
744
745void
746platform (OpenCL::Device this)
747 PPCODE:
748 cl_platform_id value [1];
749 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PLATFORM, sizeof (value), value, 0));
750 EXTEND (SP, 1);
751 const int i = 0;
752 {
753 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Platform", value [i]));
754 }
755
756void
757name (OpenCL::Device this)
758 PPCODE:
759 size_t size;
760 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NAME, 0, 0, &size));
761 char *value = tmpbuf (size);
762 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NAME, size, value, 0));
763 int i, n = 1;
764 EXTEND (SP, n);
765 for (i = 0; i < n; ++i)
766 PUSHs (sv_2mortal (newSVpv (value, 0)));
767
768void
769vendor (OpenCL::Device this)
770 PPCODE:
771 size_t size;
772 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_VENDOR, 0, 0, &size));
773 char *value = tmpbuf (size);
774 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_VENDOR, size, value, 0));
775 int i, n = 1;
776 EXTEND (SP, n);
777 for (i = 0; i < n; ++i)
778 PUSHs (sv_2mortal (newSVpv (value, 0)));
779
780void
781driver_version (OpenCL::Device this)
782 PPCODE:
783 size_t size;
784 NEED_SUCCESS (GetDeviceInfo, (this, CL_DRIVER_VERSION, 0, 0, &size));
785 char *value = tmpbuf (size);
786 NEED_SUCCESS (GetDeviceInfo, (this, CL_DRIVER_VERSION, size, value, 0));
787 int i, n = 1;
788 EXTEND (SP, n);
789 for (i = 0; i < n; ++i)
790 PUSHs (sv_2mortal (newSVpv (value, 0)));
791
792void
793profile (OpenCL::Device this)
794 PPCODE:
795 size_t size;
796 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PROFILE, 0, 0, &size));
797 char *value = tmpbuf (size);
798 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PROFILE, size, value, 0));
799 int i, n = 1;
800 EXTEND (SP, n);
801 for (i = 0; i < n; ++i)
802 PUSHs (sv_2mortal (newSVpv (value, 0)));
803
804void
805version (OpenCL::Device this)
806 PPCODE:
807 size_t size;
808 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_VERSION, 0, 0, &size));
809 char *value = tmpbuf (size);
810 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_VERSION, size, value, 0));
811 int i, n = 1;
812 EXTEND (SP, n);
813 for (i = 0; i < n; ++i)
814 PUSHs (sv_2mortal (newSVpv (value, 0)));
815
816void
817extensions (OpenCL::Device this)
818 PPCODE:
819 size_t size;
820 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_EXTENSIONS, 0, 0, &size));
821 char *value = tmpbuf (size);
822 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_EXTENSIONS, size, value, 0));
823 int i, n = 1;
824 EXTEND (SP, n);
825 for (i = 0; i < n; ++i)
826 PUSHs (sv_2mortal (newSVpv (value, 0)));
827
828void
829preferred_vector_width_half (OpenCL::Device this)
830 PPCODE:
831 cl_uint value [1];
832 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, sizeof (value), value, 0));
833 EXTEND (SP, 1);
834 const int i = 0;
835 PUSHs (sv_2mortal (newSVuv (value [i])));
836
837void
838native_vector_width_char (OpenCL::Device this)
839 PPCODE:
840 cl_uint value [1];
841 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR, sizeof (value), value, 0));
842 EXTEND (SP, 1);
843 const int i = 0;
844 PUSHs (sv_2mortal (newSVuv (value [i])));
845
846void
847native_vector_width_short (OpenCL::Device this)
848 PPCODE:
849 cl_uint value [1];
850 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT, sizeof (value), value, 0));
851 EXTEND (SP, 1);
852 const int i = 0;
853 PUSHs (sv_2mortal (newSVuv (value [i])));
854
855void
856native_vector_width_int (OpenCL::Device this)
857 PPCODE:
858 cl_uint value [1];
859 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, sizeof (value), value, 0));
860 EXTEND (SP, 1);
861 const int i = 0;
862 PUSHs (sv_2mortal (newSVuv (value [i])));
863
864void
865native_vector_width_long (OpenCL::Device this)
866 PPCODE:
867 cl_uint value [1];
868 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, sizeof (value), value, 0));
869 EXTEND (SP, 1);
870 const int i = 0;
871 PUSHs (sv_2mortal (newSVuv (value [i])));
872
873void
874native_vector_width_float (OpenCL::Device this)
875 PPCODE:
876 cl_uint value [1];
877 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, sizeof (value), value, 0));
878 EXTEND (SP, 1);
879 const int i = 0;
880 PUSHs (sv_2mortal (newSVuv (value [i])));
881
882void
883native_vector_width_double (OpenCL::Device this)
884 PPCODE:
885 cl_uint value [1];
886 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, sizeof (value), value, 0));
887 EXTEND (SP, 1);
888 const int i = 0;
889 PUSHs (sv_2mortal (newSVuv (value [i])));
890
891void
892native_vector_width_half (OpenCL::Device this)
893 PPCODE:
894 cl_uint value [1];
895 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, sizeof (value), value, 0));
896 EXTEND (SP, 1);
897 const int i = 0;
898 PUSHs (sv_2mortal (newSVuv (value [i])));
899
900void
901double_fp_config (OpenCL::Device this)
902 PPCODE:
903 cl_device_fp_config value [1];
904 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_DOUBLE_FP_CONFIG, sizeof (value), value, 0));
905 EXTEND (SP, 1);
906 const int i = 0;
907 PUSHs (sv_2mortal (newSVuv (value [i])));
908
909void
910half_fp_config (OpenCL::Device this)
911 PPCODE:
912 cl_device_fp_config value [1];
913 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_HALF_FP_CONFIG, sizeof (value), value, 0));
914 EXTEND (SP, 1);
915 const int i = 0;
916 PUSHs (sv_2mortal (newSVuv (value [i])));
917
918void
919host_unified_memory (OpenCL::Device this)
920 PPCODE:
921 cl_bool value [1];
922 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_HOST_UNIFIED_MEMORY, sizeof (value), value, 0));
923 EXTEND (SP, 1);
924 const int i = 0;
925 PUSHs (sv_2mortal (value [i] ? &PL_sv_yes : &PL_sv_no));
926
927void
928parent_device_ext (OpenCL::Device this)
929 PPCODE:
930 cl_device_id value [1];
931 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PARENT_DEVICE_EXT, sizeof (value), value, 0));
932 EXTEND (SP, 1);
933 const int i = 0;
934 {
935 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Device", value [i]));
936 }
937
938void
939partition_types_ext (OpenCL::Device this)
940 PPCODE:
941 size_t size;
942 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PARTITION_TYPES_EXT, 0, 0, &size));
943 cl_device_partition_property_ext *value = tmpbuf (size);
944 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PARTITION_TYPES_EXT, size, value, 0));
945 int i, n = size / sizeof (*value);
946 EXTEND (SP, n);
947 for (i = 0; i < n; ++i)
948 PUSHs (sv_2mortal (newSVuv (value [i])));
949
950void
951affinity_domains_ext (OpenCL::Device this)
952 PPCODE:
953 size_t size;
954 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_AFFINITY_DOMAINS_EXT, 0, 0, &size));
955 cl_device_partition_property_ext *value = tmpbuf (size);
956 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_AFFINITY_DOMAINS_EXT, size, value, 0));
957 int i, n = size / sizeof (*value);
958 EXTEND (SP, n);
959 for (i = 0; i < n; ++i)
960 PUSHs (sv_2mortal (newSVuv (value [i])));
961
962void
963reference_count_ext (OpenCL::Device this)
964 PPCODE:
965 cl_uint value [1];
966 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_REFERENCE_COUNT_EXT , sizeof (value), value, 0));
967 EXTEND (SP, 1);
968 const int i = 0;
969 PUSHs (sv_2mortal (newSVuv (value [i])));
970
971void
972partition_style_ext (OpenCL::Device this)
973 PPCODE:
974 size_t size;
975 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PARTITION_STYLE_EXT, 0, 0, &size));
976 cl_device_partition_property_ext *value = tmpbuf (size);
977 NEED_SUCCESS (GetDeviceInfo, (this, CL_DEVICE_PARTITION_STYLE_EXT, size, value, 0));
978 int i, n = size / sizeof (*value);
979 EXTEND (SP, n);
980 for (i = 0; i < n; ++i)
981 PUSHs (sv_2mortal (newSVuv (value [i])));
982
983#END:device
357 984
358MODULE = OpenCL PACKAGE = OpenCL::Context 985MODULE = OpenCL PACKAGE = OpenCL::Context
359 986
360void 987void
361DESTROY (OpenCL::Context context) 988DESTROY (OpenCL::Context context)
457 NEED_SUCCESS_ARG (cl_program prog, CreateProgramWithSource, (this, 1, &ptr, &len2, &res)); 1084 NEED_SUCCESS_ARG (cl_program prog, CreateProgramWithSource, (this, 1, &ptr, &len2, &res));
458 XPUSH_NEW_OBJ ("OpenCL::Program", prog); 1085 XPUSH_NEW_OBJ ("OpenCL::Program", prog);
459 1086
460#BEGIN:context 1087#BEGIN:context
461 1088
1089void
1090reference_count (OpenCL::Context this)
1091 PPCODE:
1092 cl_uint value [1];
1093 NEED_SUCCESS (GetContextInfo, (this, CL_CONTEXT_REFERENCE_COUNT, sizeof (value), value, 0));
1094 EXTEND (SP, 1);
1095 const int i = 0;
1096 PUSHs (sv_2mortal (newSVuv (value [i])));
1097
1098void
1099devices (OpenCL::Context this)
1100 PPCODE:
1101 size_t size;
1102 NEED_SUCCESS (GetContextInfo, (this, CL_CONTEXT_DEVICES, 0, 0, &size));
1103 cl_device_id *value = tmpbuf (size);
1104 NEED_SUCCESS (GetContextInfo, (this, CL_CONTEXT_DEVICES, size, value, 0));
1105 int i, n = size / sizeof (*value);
1106 EXTEND (SP, n);
1107 for (i = 0; i < n; ++i)
1108 {
1109 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Device", value [i]));
1110 }
1111
1112void
1113properties (OpenCL::Context this)
1114 PPCODE:
1115 size_t size;
1116 NEED_SUCCESS (GetContextInfo, (this, CL_CONTEXT_PROPERTIES, 0, 0, &size));
1117 cl_context_properties *value = tmpbuf (size);
1118 NEED_SUCCESS (GetContextInfo, (this, CL_CONTEXT_PROPERTIES, size, value, 0));
1119 int i, n = size / sizeof (*value);
1120 EXTEND (SP, n);
1121 for (i = 0; i < n; ++i)
1122 PUSHs (sv_2mortal (newSVuv ((UV)value [i])));
1123
1124void
1125num_devices (OpenCL::Context this)
1126 PPCODE:
1127 cl_uint value [1];
1128 NEED_SUCCESS (GetContextInfo, (this, CL_CONTEXT_NUM_DEVICES, sizeof (value), value, 0));
1129 EXTEND (SP, 1);
1130 const int i = 0;
1131 PUSHs (sv_2mortal (newSVuv (value [i])));
1132
462#END:context 1133#END:context
463 1134
464MODULE = OpenCL PACKAGE = OpenCL::Queue 1135MODULE = OpenCL PACKAGE = OpenCL::Queue
465 1136
466void 1137void
467DESTROY (OpenCL::Queue this) 1138DESTROY (OpenCL::Queue this)
468 CODE: 1139 CODE:
469 clReleaseCommandQueue (this); 1140 clReleaseCommandQueue (this);
470
471void
472info (OpenCL::Queue this, cl_command_queue_info name)
473 PPCODE:
474 INFO (CommandQueue)
475 1141
476void 1142void
477enqueue_read_buffer (OpenCL::Queue this, OpenCL::Buffer mem, cl_bool blocking, size_t offset, size_t len, SV *data, ...) 1143enqueue_read_buffer (OpenCL::Queue this, OpenCL::Buffer mem, cl_bool blocking, size_t offset, size_t len, SV *data, ...)
478 PPCODE: 1144 PPCODE:
479 cl_event ev = 0; 1145 cl_event ev = 0;
706void 1372void
707finish (OpenCL::Queue this) 1373finish (OpenCL::Queue this)
708 CODE: 1374 CODE:
709 NEED_SUCCESS (Finish, (this)); 1375 NEED_SUCCESS (Finish, (this));
710 1376
1377void
1378info (OpenCL::Queue this, cl_command_queue_info name)
1379 PPCODE:
1380 INFO (CommandQueue)
1381
1382#BEGIN:command_queue
1383
1384void
1385context (OpenCL::Queue this)
1386 PPCODE:
1387 cl_context value [1];
1388 NEED_SUCCESS (GetCommandQueueInfo, (this, CL_QUEUE_CONTEXT, sizeof (value), value, 0));
1389 EXTEND (SP, 1);
1390 const int i = 0;
1391 {
1392 NEED_SUCCESS (RetainContext, (value [i]));
1393 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Context", value [i]));
1394 }
1395
1396void
1397device (OpenCL::Queue this)
1398 PPCODE:
1399 cl_device_id value [1];
1400 NEED_SUCCESS (GetCommandQueueInfo, (this, CL_QUEUE_DEVICE, sizeof (value), value, 0));
1401 EXTEND (SP, 1);
1402 const int i = 0;
1403 {
1404 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Device", value [i]));
1405 }
1406
1407void
1408reference_count (OpenCL::Queue this)
1409 PPCODE:
1410 cl_uint value [1];
1411 NEED_SUCCESS (GetCommandQueueInfo, (this, CL_QUEUE_REFERENCE_COUNT, sizeof (value), value, 0));
1412 EXTEND (SP, 1);
1413 const int i = 0;
1414 PUSHs (sv_2mortal (newSVuv (value [i])));
1415
1416void
1417properties (OpenCL::Queue this)
1418 PPCODE:
1419 cl_command_queue_properties value [1];
1420 NEED_SUCCESS (GetCommandQueueInfo, (this, CL_QUEUE_PROPERTIES, sizeof (value), value, 0));
1421 EXTEND (SP, 1);
1422 const int i = 0;
1423 PUSHs (sv_2mortal (newSViv (value [i])));
1424
1425#END:command_queue
1426
711MODULE = OpenCL PACKAGE = OpenCL::Memory 1427MODULE = OpenCL PACKAGE = OpenCL::Memory
712 1428
713void 1429void
714DESTROY (OpenCL::Memory this) 1430DESTROY (OpenCL::Memory this)
715 CODE: 1431 CODE:
718void 1434void
719info (OpenCL::Memory this, cl_mem_info name) 1435info (OpenCL::Memory this, cl_mem_info name)
720 PPCODE: 1436 PPCODE:
721 INFO (MemObject) 1437 INFO (MemObject)
722 1438
1439#BEGIN:mem
1440
1441void
1442type (OpenCL::Memory this)
1443 PPCODE:
1444 cl_mem_object_type value [1];
1445 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_TYPE, sizeof (value), value, 0));
1446 EXTEND (SP, 1);
1447 const int i = 0;
1448 PUSHs (sv_2mortal (newSViv (value [i])));
1449
1450void
1451flags (OpenCL::Memory this)
1452 PPCODE:
1453 cl_mem_flags value [1];
1454 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_FLAGS, sizeof (value), value, 0));
1455 EXTEND (SP, 1);
1456 const int i = 0;
1457 PUSHs (sv_2mortal (newSViv (value [i])));
1458
1459void
1460size (OpenCL::Memory this)
1461 PPCODE:
1462 size_t value [1];
1463 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_SIZE, sizeof (value), value, 0));
1464 EXTEND (SP, 1);
1465 const int i = 0;
1466 PUSHs (sv_2mortal (newSVuv (value [i])));
1467
1468void
1469host_ptr (OpenCL::Memory this)
1470 PPCODE:
1471 void * value [1];
1472 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_HOST_PTR, sizeof (value), value, 0));
1473 EXTEND (SP, 1);
1474 const int i = 0;
1475 PUSHs (sv_2mortal (newSVuv ((IV)(intptr_t)value [i])));
1476
1477void
1478map_count (OpenCL::Memory this)
1479 PPCODE:
1480 cl_uint value [1];
1481 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_MAP_COUNT, sizeof (value), value, 0));
1482 EXTEND (SP, 1);
1483 const int i = 0;
1484 PUSHs (sv_2mortal (newSVuv (value [i])));
1485
1486void
1487reference_count (OpenCL::Memory this)
1488 PPCODE:
1489 cl_uint value [1];
1490 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_REFERENCE_COUNT, sizeof (value), value, 0));
1491 EXTEND (SP, 1);
1492 const int i = 0;
1493 PUSHs (sv_2mortal (newSVuv (value [i])));
1494
1495void
1496context (OpenCL::Memory this)
1497 PPCODE:
1498 cl_context value [1];
1499 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_CONTEXT, sizeof (value), value, 0));
1500 EXTEND (SP, 1);
1501 const int i = 0;
1502 {
1503 NEED_SUCCESS (RetainContext, (value [i]));
1504 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Context", value [i]));
1505 }
1506
1507void
1508associated_memobject (OpenCL::Memory this)
1509 PPCODE:
1510 cl_mem value [1];
1511 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_ASSOCIATED_MEMOBJECT, sizeof (value), value, 0));
1512 EXTEND (SP, 1);
1513 const int i = 0;
1514 {
1515 NEED_SUCCESS (RetainMemObject, (value [i]));
1516 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Memory", value [i]));
1517 }
1518
1519void
1520offset (OpenCL::Memory this)
1521 PPCODE:
1522 size_t value [1];
1523 NEED_SUCCESS (GetMemObjectInfo, (this, CL_MEM_OFFSET, sizeof (value), value, 0));
1524 EXTEND (SP, 1);
1525 const int i = 0;
1526 PUSHs (sv_2mortal (newSVuv (value [i])));
1527
1528#END:mem
1529
723MODULE = OpenCL PACKAGE = OpenCL::Image 1530MODULE = OpenCL PACKAGE = OpenCL::Image
724 1531
725void 1532void
726image_info (OpenCL::Image this, cl_image_info name) 1533image_info (OpenCL::Image this, cl_image_info name)
727 PPCODE: 1534 PPCODE:
728 INFO (Image) 1535 INFO (Image)
729 1536
1537#BEGIN:image
1538
1539void
1540element_size (OpenCL::Image this)
1541 PPCODE:
1542 size_t value [1];
1543 NEED_SUCCESS (GetImageInfo, (this, CL_IMAGE_ELEMENT_SIZE, sizeof (value), value, 0));
1544 EXTEND (SP, 1);
1545 const int i = 0;
1546 PUSHs (sv_2mortal (newSVuv (value [i])));
1547
1548void
1549row_pitch (OpenCL::Image this)
1550 PPCODE:
1551 size_t value [1];
1552 NEED_SUCCESS (GetImageInfo, (this, CL_IMAGE_ROW_PITCH, sizeof (value), value, 0));
1553 EXTEND (SP, 1);
1554 const int i = 0;
1555 PUSHs (sv_2mortal (newSVuv (value [i])));
1556
1557void
1558slice_pitch (OpenCL::Image this)
1559 PPCODE:
1560 size_t value [1];
1561 NEED_SUCCESS (GetImageInfo, (this, CL_IMAGE_SLICE_PITCH, sizeof (value), value, 0));
1562 EXTEND (SP, 1);
1563 const int i = 0;
1564 PUSHs (sv_2mortal (newSVuv (value [i])));
1565
1566void
1567width (OpenCL::Image this)
1568 PPCODE:
1569 size_t value [1];
1570 NEED_SUCCESS (GetImageInfo, (this, CL_IMAGE_WIDTH, sizeof (value), value, 0));
1571 EXTEND (SP, 1);
1572 const int i = 0;
1573 PUSHs (sv_2mortal (newSVuv (value [i])));
1574
1575void
1576height (OpenCL::Image this)
1577 PPCODE:
1578 size_t value [1];
1579 NEED_SUCCESS (GetImageInfo, (this, CL_IMAGE_HEIGHT, sizeof (value), value, 0));
1580 EXTEND (SP, 1);
1581 const int i = 0;
1582 PUSHs (sv_2mortal (newSVuv (value [i])));
1583
1584void
1585depth (OpenCL::Image this)
1586 PPCODE:
1587 size_t value [1];
1588 NEED_SUCCESS (GetImageInfo, (this, CL_IMAGE_DEPTH, sizeof (value), value, 0));
1589 EXTEND (SP, 1);
1590 const int i = 0;
1591 PUSHs (sv_2mortal (newSVuv (value [i])));
1592
1593#END:image
1594
730MODULE = OpenCL PACKAGE = OpenCL::Sampler 1595MODULE = OpenCL PACKAGE = OpenCL::Sampler
731 1596
732void 1597void
733DESTROY (OpenCL::Sampler this) 1598DESTROY (OpenCL::Sampler this)
734 CODE: 1599 CODE:
737void 1602void
738info (OpenCL::Sampler this, cl_sampler_info name) 1603info (OpenCL::Sampler this, cl_sampler_info name)
739 PPCODE: 1604 PPCODE:
740 INFO (Sampler) 1605 INFO (Sampler)
741 1606
1607#BEGIN:sampler
1608
1609void
1610reference_count (OpenCL::Sampler this)
1611 PPCODE:
1612 cl_uint value [1];
1613 NEED_SUCCESS (GetSamplerInfo, (this, CL_SAMPLER_REFERENCE_COUNT, sizeof (value), value, 0));
1614 EXTEND (SP, 1);
1615 const int i = 0;
1616 PUSHs (sv_2mortal (newSVuv (value [i])));
1617
1618void
1619context (OpenCL::Sampler this)
1620 PPCODE:
1621 cl_context value [1];
1622 NEED_SUCCESS (GetSamplerInfo, (this, CL_SAMPLER_CONTEXT, sizeof (value), value, 0));
1623 EXTEND (SP, 1);
1624 const int i = 0;
1625 {
1626 NEED_SUCCESS (RetainContext, (value [i]));
1627 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Context", value [i]));
1628 }
1629
1630void
1631normalized_coords (OpenCL::Sampler this)
1632 PPCODE:
1633 cl_addressing_mode value [1];
1634 NEED_SUCCESS (GetSamplerInfo, (this, CL_SAMPLER_NORMALIZED_COORDS, sizeof (value), value, 0));
1635 EXTEND (SP, 1);
1636 const int i = 0;
1637 PUSHs (sv_2mortal (newSViv (value [i])));
1638
1639void
1640addressing_mode (OpenCL::Sampler this)
1641 PPCODE:
1642 cl_filter_mode value [1];
1643 NEED_SUCCESS (GetSamplerInfo, (this, CL_SAMPLER_ADDRESSING_MODE, sizeof (value), value, 0));
1644 EXTEND (SP, 1);
1645 const int i = 0;
1646 PUSHs (sv_2mortal (newSViv (value [i])));
1647
1648void
1649filter_mode (OpenCL::Sampler this)
1650 PPCODE:
1651 cl_bool value [1];
1652 NEED_SUCCESS (GetSamplerInfo, (this, CL_SAMPLER_FILTER_MODE, sizeof (value), value, 0));
1653 EXTEND (SP, 1);
1654 const int i = 0;
1655 PUSHs (sv_2mortal (value [i] ? &PL_sv_yes : &PL_sv_no));
1656
1657#END:sampler
1658
742MODULE = OpenCL PACKAGE = OpenCL::Program 1659MODULE = OpenCL PACKAGE = OpenCL::Program
743 1660
744void 1661void
745DESTROY (OpenCL::Program this) 1662DESTROY (OpenCL::Program this)
746 CODE: 1663 CODE:
747 clReleaseProgram (this); 1664 clReleaseProgram (this);
748
749void
750info (OpenCL::Program this, cl_program_info name)
751 PPCODE:
752 INFO (Program)
753 1665
754void 1666void
755build (OpenCL::Program this, OpenCL::Device device, SV *options = &PL_sv_undef) 1667build (OpenCL::Program this, OpenCL::Device device, SV *options = &PL_sv_undef)
756 CODE: 1668 CODE:
757 NEED_SUCCESS (BuildProgram, (this, 1, &device, SvPVbyte_nolen (options), 0, 0)); 1669 NEED_SUCCESS (BuildProgram, (this, 1, &device, SvPVbyte_nolen (options), 0, 0));
766 SvPOK_only (sv); 1678 SvPOK_only (sv);
767 SvCUR_set (sv, size); 1679 SvCUR_set (sv, size);
768 NEED_SUCCESS (GetProgramBuildInfo, (this, device, name, size, SvPVX (sv), 0)); 1680 NEED_SUCCESS (GetProgramBuildInfo, (this, device, name, size, SvPVX (sv), 0));
769 XPUSHs (sv); 1681 XPUSHs (sv);
770 1682
1683#BEGIN:program_build
1684
1685void
1686build_status (OpenCL::Program this, OpenCL::Device device)
1687 PPCODE:
1688 cl_build_status value [1];
1689 NEED_SUCCESS (GetProgramBuildInfo, (this, device, CL_PROGRAM_BUILD_STATUS, sizeof (value), value, 0));
1690 EXTEND (SP, 1);
1691 const int i = 0;
1692 PUSHs (sv_2mortal (newSViv (value [i])));
1693
1694void
1695build_options (OpenCL::Program this, OpenCL::Device device)
1696 PPCODE:
1697 size_t size;
1698 NEED_SUCCESS (GetProgramBuildInfo, (this, device, CL_PROGRAM_BUILD_OPTIONS, 0, 0, &size));
1699 char *value = tmpbuf (size);
1700 NEED_SUCCESS (GetProgramBuildInfo, (this, device, CL_PROGRAM_BUILD_OPTIONS, size, value, 0));
1701 int i, n = 1;
1702 EXTEND (SP, n);
1703 for (i = 0; i < n; ++i)
1704 PUSHs (sv_2mortal (newSVpv (value, 0)));
1705
1706void
1707build_log (OpenCL::Program this, OpenCL::Device device)
1708 PPCODE:
1709 size_t size;
1710 NEED_SUCCESS (GetProgramBuildInfo, (this, device, CL_PROGRAM_BUILD_LOG, 0, 0, &size));
1711 char *value = tmpbuf (size);
1712 NEED_SUCCESS (GetProgramBuildInfo, (this, device, CL_PROGRAM_BUILD_LOG, size, value, 0));
1713 int i, n = 1;
1714 EXTEND (SP, n);
1715 for (i = 0; i < n; ++i)
1716 PUSHs (sv_2mortal (newSVpv (value, 0)));
1717
1718#END:program_build
1719
771void 1720void
772kernel (OpenCL::Program program, SV *function) 1721kernel (OpenCL::Program program, SV *function)
773 PPCODE: 1722 PPCODE:
774 NEED_SUCCESS_ARG (cl_kernel kernel, CreateKernel, (program, SvPVbyte_nolen (function), &res)); 1723 NEED_SUCCESS_ARG (cl_kernel kernel, CreateKernel, (program, SvPVbyte_nolen (function), &res));
775 XPUSH_NEW_OBJ ("OpenCL::Kernel", kernel); 1724 XPUSH_NEW_OBJ ("OpenCL::Kernel", kernel);
776 1725
1726void
1727info (OpenCL::Program this, cl_program_info name)
1728 PPCODE:
1729 INFO (Program)
1730
1731void
1732binaries (OpenCL::Program this)
1733 PPCODE:
1734 cl_uint n, i;
1735 size_t size;
1736
1737 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_NUM_DEVICES , sizeof (n) , &n , 0));
1738 if (!n) XSRETURN_EMPTY;
1739
1740 size_t *sizes = tmpbuf (sizeof (*sizes) * n);
1741 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_BINARY_SIZES, sizeof (*sizes) * n, sizes, &size));
1742 if (size != sizeof (*sizes) * n) XSRETURN_EMPTY;
1743 unsigned char **ptrs = tmpbuf (sizeof (*ptrs) * n);
1744
1745 EXTEND (SP, n);
1746 for (i = 0; i < n; ++i)
1747 {
1748 SV *sv = sv_2mortal (newSV (sizes [i]));
1749 SvUPGRADE (sv, SVt_PV);
1750 SvPOK_only (sv);
1751 SvCUR_set (sv, sizes [i]);
1752 ptrs [i] = SvPVX (sv);
1753 PUSHs (sv);
1754 }
1755
1756 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_BINARIES , sizeof (*ptrs ) * n, ptrs , &size));
1757 if (size != sizeof (*ptrs) * n) XSRETURN_EMPTY;
1758
1759#BEGIN:program
1760
1761void
1762reference_count (OpenCL::Program this)
1763 PPCODE:
1764 cl_uint value [1];
1765 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_REFERENCE_COUNT, sizeof (value), value, 0));
1766 EXTEND (SP, 1);
1767 const int i = 0;
1768 PUSHs (sv_2mortal (newSVuv (value [i])));
1769
1770void
1771context (OpenCL::Program this)
1772 PPCODE:
1773 cl_context value [1];
1774 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_CONTEXT, sizeof (value), value, 0));
1775 EXTEND (SP, 1);
1776 const int i = 0;
1777 {
1778 NEED_SUCCESS (RetainContext, (value [i]));
1779 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Context", value [i]));
1780 }
1781
1782void
1783num_devices (OpenCL::Program this)
1784 PPCODE:
1785 cl_uint value [1];
1786 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_NUM_DEVICES, sizeof (value), value, 0));
1787 EXTEND (SP, 1);
1788 const int i = 0;
1789 PUSHs (sv_2mortal (newSVuv (value [i])));
1790
1791void
1792devices (OpenCL::Program this)
1793 PPCODE:
1794 size_t size;
1795 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_DEVICES, 0, 0, &size));
1796 cl_device_id *value = tmpbuf (size);
1797 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_DEVICES, size, value, 0));
1798 int i, n = size / sizeof (*value);
1799 EXTEND (SP, n);
1800 for (i = 0; i < n; ++i)
1801 {
1802 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Device", value [i]));
1803 }
1804
1805void
1806source (OpenCL::Program this)
1807 PPCODE:
1808 size_t size;
1809 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_SOURCE, 0, 0, &size));
1810 char *value = tmpbuf (size);
1811 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_SOURCE, size, value, 0));
1812 int i, n = 1;
1813 EXTEND (SP, n);
1814 for (i = 0; i < n; ++i)
1815 PUSHs (sv_2mortal (newSVpv (value, 0)));
1816
1817void
1818binary_sizes (OpenCL::Program this)
1819 PPCODE:
1820 size_t size;
1821 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_BINARY_SIZES, 0, 0, &size));
1822 size_t *value = tmpbuf (size);
1823 NEED_SUCCESS (GetProgramInfo, (this, CL_PROGRAM_BINARY_SIZES, size, value, 0));
1824 int i, n = size / sizeof (*value);
1825 EXTEND (SP, n);
1826 for (i = 0; i < n; ++i)
1827 PUSHs (sv_2mortal (newSVuv (value [i])));
1828
1829#END:program
1830
777MODULE = OpenCL PACKAGE = OpenCL::Kernel 1831MODULE = OpenCL PACKAGE = OpenCL::Kernel
778 1832
779void 1833void
780DESTROY (OpenCL::Kernel this) 1834DESTROY (OpenCL::Kernel this)
781 CODE: 1835 CODE:
782 clReleaseKernel (this); 1836 clReleaseKernel (this);
783 1837
784void 1838void
1839set_char (OpenCL::Kernel this, cl_uint idx, cl_char value)
1840 CODE:
1841 clSetKernelArg (this, idx, sizeof (value), &value);
1842
1843void
1844set_uchar (OpenCL::Kernel this, cl_uint idx, cl_uchar value)
1845 CODE:
1846 clSetKernelArg (this, idx, sizeof (value), &value);
1847
1848void
1849set_short (OpenCL::Kernel this, cl_uint idx, cl_short value)
1850 CODE:
1851 clSetKernelArg (this, idx, sizeof (value), &value);
1852
1853void
1854set_ushort (OpenCL::Kernel this, cl_uint idx, cl_ushort value)
1855 CODE:
1856 clSetKernelArg (this, idx, sizeof (value), &value);
1857
1858void
1859set_int (OpenCL::Kernel this, cl_uint idx, cl_int value)
1860 CODE:
1861 clSetKernelArg (this, idx, sizeof (value), &value);
1862
1863void
1864set_uint (OpenCL::Kernel this, cl_uint idx, cl_uint value)
1865 CODE:
1866 clSetKernelArg (this, idx, sizeof (value), &value);
1867
1868void
1869set_long (OpenCL::Kernel this, cl_uint idx, cl_long value)
1870 CODE:
1871 clSetKernelArg (this, idx, sizeof (value), &value);
1872
1873void
1874set_ulong (OpenCL::Kernel this, cl_uint idx, cl_ulong value)
1875 CODE:
1876 clSetKernelArg (this, idx, sizeof (value), &value);
1877
1878void
1879set_half (OpenCL::Kernel this, cl_uint idx, cl_half value)
1880 CODE:
1881 clSetKernelArg (this, idx, sizeof (value), &value);
1882
1883void
1884set_float (OpenCL::Kernel this, cl_uint idx, cl_float value)
1885 CODE:
1886 clSetKernelArg (this, idx, sizeof (value), &value);
1887
1888void
1889set_double (OpenCL::Kernel this, cl_uint idx, cl_double value)
1890 CODE:
1891 clSetKernelArg (this, idx, sizeof (value), &value);
1892
1893void
1894set_memory (OpenCL::Kernel this, cl_uint idx, OpenCL::Memory_ornull value)
1895 CODE:
1896 clSetKernelArg (this, idx, sizeof (value), &value);
1897
1898void
1899set_buffer (OpenCL::Kernel this, cl_uint idx, OpenCL::Buffer_ornull value)
1900 CODE:
1901 clSetKernelArg (this, idx, sizeof (value), &value);
1902
1903void
1904set_image2d (OpenCL::Kernel this, cl_uint idx, OpenCL::Image2D_ornull value)
1905 CODE:
1906 clSetKernelArg (this, idx, sizeof (value), &value);
1907
1908void
1909set_image3d (OpenCL::Kernel this, cl_uint idx, OpenCL::Image3D_ornull value)
1910 CODE:
1911 clSetKernelArg (this, idx, sizeof (value), &value);
1912
1913void
1914set_sampler (OpenCL::Kernel this, cl_uint idx, OpenCL::Sampler value)
1915 CODE:
1916 clSetKernelArg (this, idx, sizeof (value), &value);
1917
1918void
1919set_event (OpenCL::Kernel this, cl_uint idx, OpenCL::Event value)
1920 CODE:
1921 clSetKernelArg (this, idx, sizeof (value), &value);
1922
1923void
785info (OpenCL::Kernel this, cl_kernel_info name) 1924info (OpenCL::Kernel this, cl_kernel_info name)
786 PPCODE: 1925 PPCODE:
787 INFO (Kernel) 1926 INFO (Kernel)
1927
1928#BEGIN:kernel
1929
1930void
1931function_name (OpenCL::Kernel this)
1932 PPCODE:
1933 size_t size;
1934 NEED_SUCCESS (GetKernelInfo, (this, CL_KERNEL_FUNCTION_NAME, 0, 0, &size));
1935 char *value = tmpbuf (size);
1936 NEED_SUCCESS (GetKernelInfo, (this, CL_KERNEL_FUNCTION_NAME, size, value, 0));
1937 int i, n = 1;
1938 EXTEND (SP, n);
1939 for (i = 0; i < n; ++i)
1940 PUSHs (sv_2mortal (newSVpv (value, 0)));
1941
1942void
1943num_args (OpenCL::Kernel this)
1944 PPCODE:
1945 cl_uint value [1];
1946 NEED_SUCCESS (GetKernelInfo, (this, CL_KERNEL_NUM_ARGS, sizeof (value), value, 0));
1947 EXTEND (SP, 1);
1948 const int i = 0;
1949 PUSHs (sv_2mortal (newSVuv (value [i])));
1950
1951void
1952reference_count (OpenCL::Kernel this)
1953 PPCODE:
1954 cl_uint value [1];
1955 NEED_SUCCESS (GetKernelInfo, (this, CL_KERNEL_REFERENCE_COUNT, sizeof (value), value, 0));
1956 EXTEND (SP, 1);
1957 const int i = 0;
1958 PUSHs (sv_2mortal (newSVuv (value [i])));
1959
1960void
1961context (OpenCL::Kernel this)
1962 PPCODE:
1963 cl_context value [1];
1964 NEED_SUCCESS (GetKernelInfo, (this, CL_KERNEL_CONTEXT, sizeof (value), value, 0));
1965 EXTEND (SP, 1);
1966 const int i = 0;
1967 {
1968 NEED_SUCCESS (RetainContext, (value [i]));
1969 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Context", value [i]));
1970 }
1971
1972void
1973program (OpenCL::Kernel this)
1974 PPCODE:
1975 cl_program value [1];
1976 NEED_SUCCESS (GetKernelInfo, (this, CL_KERNEL_PROGRAM, sizeof (value), value, 0));
1977 EXTEND (SP, 1);
1978 const int i = 0;
1979 {
1980 NEED_SUCCESS (RetainProgram, (value [i]));
1981 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Program", value [i]));
1982 }
1983
1984#END:kernel
788 1985
789void 1986void
790work_group_info (OpenCL::Kernel this, OpenCL::Device device, cl_kernel_work_group_info name) 1987work_group_info (OpenCL::Kernel this, OpenCL::Device device, cl_kernel_work_group_info name)
791 PPCODE: 1988 PPCODE:
792 size_t size; 1989 size_t size;
796 SvPOK_only (sv); 1993 SvPOK_only (sv);
797 SvCUR_set (sv, size); 1994 SvCUR_set (sv, size);
798 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, name, size, SvPVX (sv), 0)); 1995 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, name, size, SvPVX (sv), 0));
799 XPUSHs (sv); 1996 XPUSHs (sv);
800 1997
801void 1998#BEGIN:kernel_work_group
802set_char (OpenCL::Kernel this, cl_uint idx, cl_char value)
803 CODE:
804 clSetKernelArg (this, idx, sizeof (value), &value);
805 1999
806void 2000void
807set_uchar (OpenCL::Kernel this, cl_uint idx, cl_uchar value) 2001work_group_size (OpenCL::Kernel this, OpenCL::Device device)
808 CODE: 2002 PPCODE:
809 clSetKernelArg (this, idx, sizeof (value), &value); 2003 size_t value [1];
2004 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, CL_KERNEL_WORK_GROUP_SIZE, sizeof (value), value, 0));
2005 EXTEND (SP, 1);
2006 const int i = 0;
2007 PUSHs (sv_2mortal (newSVuv (value [i])));
810 2008
811void 2009void
812set_short (OpenCL::Kernel this, cl_uint idx, cl_short value) 2010compile_work_group_size (OpenCL::Kernel this, OpenCL::Device device)
813 CODE: 2011 PPCODE:
814 clSetKernelArg (this, idx, sizeof (value), &value); 2012 size_t size;
2013 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, CL_KERNEL_COMPILE_WORK_GROUP_SIZE, 0, 0, &size));
2014 size_t *value = tmpbuf (size);
2015 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, CL_KERNEL_COMPILE_WORK_GROUP_SIZE, size, value, 0));
2016 int i, n = size / sizeof (*value);
2017 EXTEND (SP, n);
2018 for (i = 0; i < n; ++i)
2019 PUSHs (sv_2mortal (newSVuv (value [i])));
815 2020
816void 2021void
817set_ushort (OpenCL::Kernel this, cl_uint idx, cl_ushort value) 2022local_mem_size (OpenCL::Kernel this, OpenCL::Device device)
818 CODE: 2023 PPCODE:
819 clSetKernelArg (this, idx, sizeof (value), &value); 2024 cl_ulong value [1];
2025 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, CL_KERNEL_LOCAL_MEM_SIZE, sizeof (value), value, 0));
2026 EXTEND (SP, 1);
2027 const int i = 0;
2028 PUSHs (sv_2mortal (newSVuv (value [i])));
820 2029
821void 2030void
822set_int (OpenCL::Kernel this, cl_uint idx, cl_int value) 2031preferred_work_group_size_multiple (OpenCL::Kernel this, OpenCL::Device device)
823 CODE: 2032 PPCODE:
824 clSetKernelArg (this, idx, sizeof (value), &value); 2033 size_t value [1];
2034 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, sizeof (value), value, 0));
2035 EXTEND (SP, 1);
2036 const int i = 0;
2037 PUSHs (sv_2mortal (newSVuv (value [i])));
825 2038
826void 2039void
827set_uint (OpenCL::Kernel this, cl_uint idx, cl_uint value) 2040private_mem_size (OpenCL::Kernel this, OpenCL::Device device)
828 CODE: 2041 PPCODE:
829 clSetKernelArg (this, idx, sizeof (value), &value); 2042 cl_ulong value [1];
2043 NEED_SUCCESS (GetKernelWorkGroupInfo, (this, device, CL_KERNEL_PRIVATE_MEM_SIZE, sizeof (value), value, 0));
2044 EXTEND (SP, 1);
2045 const int i = 0;
2046 PUSHs (sv_2mortal (newSVuv (value [i])));
830 2047
831void 2048#END:kernel_work_group
832set_long (OpenCL::Kernel this, cl_uint idx, cl_long value)
833 CODE:
834 clSetKernelArg (this, idx, sizeof (value), &value);
835
836void
837set_ulong (OpenCL::Kernel this, cl_uint idx, cl_ulong value)
838 CODE:
839 clSetKernelArg (this, idx, sizeof (value), &value);
840
841void
842set_half (OpenCL::Kernel this, cl_uint idx, cl_half value)
843 CODE:
844 clSetKernelArg (this, idx, sizeof (value), &value);
845
846void
847set_float (OpenCL::Kernel this, cl_uint idx, cl_float value)
848 CODE:
849 clSetKernelArg (this, idx, sizeof (value), &value);
850
851void
852set_double (OpenCL::Kernel this, cl_uint idx, cl_double value)
853 CODE:
854 clSetKernelArg (this, idx, sizeof (value), &value);
855
856void
857set_memory (OpenCL::Kernel this, cl_uint idx, OpenCL::Memory_ornull value)
858 CODE:
859 clSetKernelArg (this, idx, sizeof (value), &value);
860
861void
862set_buffer (OpenCL::Kernel this, cl_uint idx, OpenCL::Buffer_ornull value)
863 CODE:
864 clSetKernelArg (this, idx, sizeof (value), &value);
865
866void
867set_image2d (OpenCL::Kernel this, cl_uint idx, OpenCL::Image2D_ornull value)
868 CODE:
869 clSetKernelArg (this, idx, sizeof (value), &value);
870
871void
872set_image3d (OpenCL::Kernel this, cl_uint idx, OpenCL::Image3D_ornull value)
873 CODE:
874 clSetKernelArg (this, idx, sizeof (value), &value);
875
876void
877set_sampler (OpenCL::Kernel this, cl_uint idx, OpenCL::Sampler value)
878 CODE:
879 clSetKernelArg (this, idx, sizeof (value), &value);
880
881void
882set_event (OpenCL::Kernel this, cl_uint idx, OpenCL::Event value)
883 CODE:
884 clSetKernelArg (this, idx, sizeof (value), &value);
885 2049
886MODULE = OpenCL PACKAGE = OpenCL::Event 2050MODULE = OpenCL PACKAGE = OpenCL::Event
887 2051
888void 2052void
889DESTROY (OpenCL::Event this) 2053DESTROY (OpenCL::Event this)
890 CODE: 2054 CODE:
891 clReleaseEvent (this); 2055 clReleaseEvent (this);
892 2056
893void 2057void
2058wait (OpenCL::Event this)
2059 CODE:
2060 clWaitForEvents (1, &this);
2061
2062void
894info (OpenCL::Event this, cl_event_info name) 2063info (OpenCL::Event this, cl_event_info name)
895 PPCODE: 2064 PPCODE:
896 INFO (Event) 2065 INFO (Event)
897 2066
2067#BEGIN:event
2068
2069void
2070command_queue (OpenCL::Event this)
2071 PPCODE:
2072 cl_command_queue value [1];
2073 NEED_SUCCESS (GetEventInfo, (this, CL_EVENT_COMMAND_QUEUE, sizeof (value), value, 0));
2074 EXTEND (SP, 1);
2075 const int i = 0;
2076 {
2077 NEED_SUCCESS (RetainCommandQueue, (value [i]));
2078 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Queue", value [i]));
2079 }
2080
2081void
2082command_type (OpenCL::Event this)
2083 PPCODE:
2084 cl_command_type value [1];
2085 NEED_SUCCESS (GetEventInfo, (this, CL_EVENT_COMMAND_TYPE, sizeof (value), value, 0));
2086 EXTEND (SP, 1);
2087 const int i = 0;
2088 PUSHs (sv_2mortal (newSVuv (value [i])));
2089
2090void
2091reference_count (OpenCL::Event this)
2092 PPCODE:
2093 cl_uint value [1];
2094 NEED_SUCCESS (GetEventInfo, (this, CL_EVENT_REFERENCE_COUNT, sizeof (value), value, 0));
2095 EXTEND (SP, 1);
2096 const int i = 0;
2097 PUSHs (sv_2mortal (newSVuv (value [i])));
2098
2099void
2100command_execution_status (OpenCL::Event this)
2101 PPCODE:
2102 cl_uint value [1];
2103 NEED_SUCCESS (GetEventInfo, (this, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof (value), value, 0));
2104 EXTEND (SP, 1);
2105 const int i = 0;
2106 PUSHs (sv_2mortal (newSVuv (value [i])));
2107
2108void
2109context (OpenCL::Event this)
2110 PPCODE:
2111 cl_context value [1];
2112 NEED_SUCCESS (GetEventInfo, (this, CL_EVENT_CONTEXT, sizeof (value), value, 0));
2113 EXTEND (SP, 1);
2114 const int i = 0;
2115 {
2116 NEED_SUCCESS (RetainContext, (value [i]));
2117 PUSHs (NEW_MORTAL_OBJ ("OpenCL::Context", value [i]));
2118 }
2119
2120#END:event
2121
898void 2122void
899profiling_info (OpenCL::Event this, cl_profiling_info name) 2123profiling_info (OpenCL::Event this, cl_profiling_info name)
900 PPCODE: 2124 PPCODE:
901 INFO (EventProfiling) 2125 INFO (EventProfiling)
902 2126
2127#BEGIN:profiling
2128
903void 2129void
904wait (OpenCL::Event this) 2130profiling_command_queued (OpenCL::Event this)
905 CODE: 2131 PPCODE:
906 clWaitForEvents (1, &this); 2132 cl_ulong value [1];
2133 NEED_SUCCESS (GetEventProfilingInfo, (this, CL_PROFILING_COMMAND_QUEUED, sizeof (value), value, 0));
2134 EXTEND (SP, 1);
2135 const int i = 0;
2136 PUSHs (sv_2mortal (newSVuv (value [i])));
2137
2138void
2139profiling_command_submit (OpenCL::Event this)
2140 PPCODE:
2141 cl_ulong value [1];
2142 NEED_SUCCESS (GetEventProfilingInfo, (this, CL_PROFILING_COMMAND_SUBMIT, sizeof (value), value, 0));
2143 EXTEND (SP, 1);
2144 const int i = 0;
2145 PUSHs (sv_2mortal (newSVuv (value [i])));
2146
2147void
2148profiling_command_start (OpenCL::Event this)
2149 PPCODE:
2150 cl_ulong value [1];
2151 NEED_SUCCESS (GetEventProfilingInfo, (this, CL_PROFILING_COMMAND_START, sizeof (value), value, 0));
2152 EXTEND (SP, 1);
2153 const int i = 0;
2154 PUSHs (sv_2mortal (newSVuv (value [i])));
2155
2156void
2157profiling_command_end (OpenCL::Event this)
2158 PPCODE:
2159 cl_ulong value [1];
2160 NEED_SUCCESS (GetEventProfilingInfo, (this, CL_PROFILING_COMMAND_END, sizeof (value), value, 0));
2161 EXTEND (SP, 1);
2162 const int i = 0;
2163 PUSHs (sv_2mortal (newSVuv (value [i])));
2164
2165#END:profiling
907 2166
908MODULE = OpenCL PACKAGE = OpenCL::UserEvent 2167MODULE = OpenCL PACKAGE = OpenCL::UserEvent
909 2168
910void 2169void
911set_status (OpenCL::UserEvent this, cl_int execution_status) 2170set_status (OpenCL::UserEvent this, cl_int execution_status)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines