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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.21 by root, Sun Nov 20 10:21:27 2011 UTC vs.
Revision 1.33 by root, Thu Apr 19 12:55:30 2012 UTC

101 101
102Best run this once to get a feel for the platforms and devices in your 102Best run this once to get a feel for the platforms and devices in your
103system. 103system.
104 104
105 for my $platform (OpenCL::platforms) { 105 for my $platform (OpenCL::platforms) {
106 printf "platform: %s\n", $platform->info (OpenCL::PLATFORM_NAME); 106 printf "platform: %s\n", $platform->name;
107 printf "extensions: %s\n", $platform->info (OpenCL::PLATFORM_EXTENSIONS); 107 printf "extensions: %s\n", $platform->extensions;
108 for my $device ($platform->devices) { 108 for my $device ($platform->devices) {
109 printf "+ device: %s\n", $device->info (OpenCL::DEVICE_NAME); 109 printf "+ device: %s\n", $device->name;
110 my $ctx = $device->context; 110 my $ctx = $platform->context (undef, [$device]);
111 # do stuff 111 # do stuff
112 } 112 }
113 } 113 }
114 114
115=head2 Get a useful context and a command queue. 115=head2 Get a useful context and a command queue.
149 149
150=head2 Create and build a program, then create a kernel out of one of its 150=head2 Create and build a program, then create a kernel out of one of its
151functions. 151functions.
152 152
153 my $src = ' 153 my $src = '
154 __kernel void 154 kernel void
155 squareit (__global float *input, __global float *output) 155 squareit (global float *input, global float *output)
156 { 156 {
157 $id = get_global_id (0); 157 $id = get_global_id (0);
158 output [id] = input [id] * input [id]; 158 output [id] = input [id] * input [id];
159 } 159 }
160 '; 160 ';
161 161
162 my $prog = $ctx->program_with_source ($src); 162 my $prog = $ctx->program_with_source ($src);
163 163
164 # build croaks on compile errors, so catch it and print the compile errors 164 # build croaks on compile errors, so catch it and print the compile errors
165 eval { $prog->build ($dev); 1 } 165 eval { $prog->build ($dev); 1 }
166 or die $prog->build_info ($dev, OpenCL::PROGRAM_BUILD_LOG); 166 or die $prog->build_log;
167 167
168 my $kernel = $prog->kernel ("squareit"); 168 my $kernel = $prog->kernel ("squareit");
169 169
170=head2 Create some input and output float buffers, then call the 170=head2 Create some input and output float buffers, then call the
171'squareit' kernel on them. 171'squareit' kernel on them.
286 286
287Comverts an error value into a human readable string. 287Comverts an error value into a human readable string.
288 288
289=item $str = OpenCL::enum2str $enum 289=item $str = OpenCL::enum2str $enum
290 290
291Converts most enum values (inof parameter names, image format constants, 291Converts most enum values (of parameter names, image format constants,
292object types, addressing and filter modes, command types etc.) into a 292object types, addressing and filter modes, command types etc.) into a
293human readbale string. When confronted with some random integer it can be 293human readable string. When confronted with some random integer it can be
294very helpful to pass it through this function to maybe get some readable 294very helpful to pass it through this function to maybe get some readable
295string out of it. 295string out of it.
296 296
297=item @platforms = OpenCL::platforms 297=item @platforms = OpenCL::platforms
298 298
322 322
323Returns a list of matching OpenCL::Device objects. 323Returns a list of matching OpenCL::Device objects.
324 324
325=item $ctx = $platform->context_from_type ($properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $notify = undef) 325=item $ctx = $platform->context_from_type ($properties, $type = OpenCL::DEVICE_TYPE_DEFAULT, $notify = undef)
326 326
327Tries to create a context. Never worked for me, and you need devices explitly anyway. 327Tries to create a context. Never worked for me, and you need devices explicitly anyway.
328 328
329L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> 329L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html>
330 330
331=item $ctx = $device->context ($properties = undef, @$devices, $notify = undef) 331=item $ctx = $platform->context ($properties = undef, @$devices, $notify = undef)
332 332
333Create a new OpenCL::Context object using the given device object(s)- a 333Create a new OpenCL::Context object using the given device object(s)- a
334CL_CONTEXT_PLATFORM property is supplied automatically. 334CL_CONTEXT_PLATFORM property is supplied automatically.
335 335
336L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> 336L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html>
337 337
338=item $packed_value = $platform->info ($name) 338=item $packed_value = $platform->info ($name)
339 339
340Calls C<clGetPlatformInfo> and returns the packed, raw value - for 340Calls C<clGetPlatformInfo> and returns the packed, raw value - for
341strings, this will be the string, for other values you probably need to 341strings, this will be the string (possibly including terminating \0), for
342use the correct C<unpack>. 342other values you probably need to use the correct C<unpack>.
343 343
344It's best to avoid this method and use one of the predefined C<get_*> 344It's best to avoid this method and use one of the following convenience
345methods. 345wrappers.
346 346
347L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformInfo.html> 347L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetPlatformInfo.html>
348 348
349=for gengetinfo begin platform 349=for gengetinfo begin platform
350 350
351
352=item $string = $platform->profile 351=item $string = $platform->profile
353 352
354Calls C<clGetPlatformInfo> with C<CL_PLATFORM_PROFILE> and returns the result(s). 353Calls C<clGetPlatformInfo> with C<CL_PLATFORM_PROFILE> and returns the result.
355 354
356=item $string = $platform->version 355=item $string = $platform->version
357 356
358Calls C<clGetPlatformInfo> with C<CL_PLATFORM_VERSION> and returns the result(s). 357Calls C<clGetPlatformInfo> with C<CL_PLATFORM_VERSION> and returns the result.
359 358
360=item $string = $platform->name 359=item $string = $platform->name
361 360
362Calls C<clGetPlatformInfo> with C<CL_PLATFORM_NAME> and returns the result(s). 361Calls C<clGetPlatformInfo> with C<CL_PLATFORM_NAME> and returns the result.
363 362
364=item $string = $platform->vendor 363=item $string = $platform->vendor
365 364
366Calls C<clGetPlatformInfo> with C<CL_PLATFORM_VENDOR> and returns the result(s). 365Calls C<clGetPlatformInfo> with C<CL_PLATFORM_VENDOR> and returns the result.
367 366
368=item $string = $platform->extensions 367=item $string = $platform->extensions
369 368
370Calls C<clGetPlatformInfo> with C<CL_PLATFORM_EXTENSIONS> and returns the result(s). 369Calls C<clGetPlatformInfo> with C<CL_PLATFORM_EXTENSIONS> and returns the result.
371 370
372=for gengetinfo end platform 371=for gengetinfo end platform
373 372
374=back 373=back
375 374
383 382
384L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html> 383L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetDeviceInfo.html>
385 384
386=for gengetinfo begin device 385=for gengetinfo begin device
387 386
388
389=item $device_type = $device->type 387=item $device_type = $device->type
390 388
391Calls C<clGetDeviceInfo> with C<CL_DEVICE_TYPE> and returns the result(s). 389Calls C<clGetDeviceInfo> with C<CL_DEVICE_TYPE> and returns the result.
392 390
393=item $uint = $device->vendor_id 391=item $uint = $device->vendor_id
394 392
395Calls C<clGetDeviceInfo> with C<CL_DEVICE_VENDOR_ID> and returns the result(s). 393Calls C<clGetDeviceInfo> with C<CL_DEVICE_VENDOR_ID> and returns the result.
396 394
397=item $uint = $device->max_compute_units 395=item $uint = $device->max_compute_units
398 396
399Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_COMPUTE_UNITS> and returns the result(s). 397Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_COMPUTE_UNITS> and returns the result.
400 398
401=item $uint = $device->max_work_item_dimensions 399=item $uint = $device->max_work_item_dimensions
402 400
403Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS> and returns the result(s). 401Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS> and returns the result.
404 402
405=item $int = $device->max_work_group_size 403=item $int = $device->max_work_group_size
406 404
407Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WORK_GROUP_SIZE> and returns the result(s). 405Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WORK_GROUP_SIZE> and returns the result.
408 406
409=item @ints = $device->max_work_item_sizes 407=item @ints = $device->max_work_item_sizes
410 408
411Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WORK_ITEM_SIZES> and returns the result(s). 409Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WORK_ITEM_SIZES> and returns the result.
412 410
413=item $uint = $device->preferred_vector_width_char 411=item $uint = $device->preferred_vector_width_char
414 412
415Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR> and returns the result(s). 413Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR> and returns the result.
416 414
417=item $uint = $device->preferred_vector_width_short 415=item $uint = $device->preferred_vector_width_short
418 416
419Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT> and returns the result(s). 417Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT> and returns the result.
420 418
421=item $uint = $device->preferred_vector_width_int 419=item $uint = $device->preferred_vector_width_int
422 420
423Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT> and returns the result(s). 421Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT> and returns the result.
424 422
425=item $uint = $device->preferred_vector_width_long 423=item $uint = $device->preferred_vector_width_long
426 424
427Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG> and returns the result(s). 425Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG> and returns the result.
428 426
429=item $uint = $device->preferred_vector_width_float 427=item $uint = $device->preferred_vector_width_float
430 428
431Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT> and returns the result(s). 429Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT> and returns the result.
432 430
433=item $uint = $device->preferred_vector_width_double 431=item $uint = $device->preferred_vector_width_double
434 432
435Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE> and returns the result(s). 433Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE> and returns the result.
436 434
437=item $uint = $device->max_clock_frequency 435=item $uint = $device->max_clock_frequency
438 436
439Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_CLOCK_FREQUENCY> and returns the result(s). 437Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_CLOCK_FREQUENCY> and returns the result.
440 438
441=item $bitfield = $device->address_bits 439=item $bitfield = $device->address_bits
442 440
443Calls C<clGetDeviceInfo> with C<CL_DEVICE_ADDRESS_BITS> and returns the result(s). 441Calls C<clGetDeviceInfo> with C<CL_DEVICE_ADDRESS_BITS> and returns the result.
444 442
445=item $uint = $device->max_read_image_args 443=item $uint = $device->max_read_image_args
446 444
447Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_READ_IMAGE_ARGS> and returns the result(s). 445Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_READ_IMAGE_ARGS> and returns the result.
448 446
449=item $uint = $device->max_write_image_args 447=item $uint = $device->max_write_image_args
450 448
451Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WRITE_IMAGE_ARGS> and returns the result(s). 449Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_WRITE_IMAGE_ARGS> and returns the result.
452 450
453=item $ulong = $device->max_mem_alloc_size 451=item $ulong = $device->max_mem_alloc_size
454 452
455Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_MEM_ALLOC_SIZE> and returns the result(s). 453Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_MEM_ALLOC_SIZE> and returns the result.
456 454
457=item $int = $device->image2d_max_width 455=item $int = $device->image2d_max_width
458 456
459Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE2D_MAX_WIDTH> and returns the result(s). 457Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE2D_MAX_WIDTH> and returns the result.
460 458
461=item $int = $device->image2d_max_height 459=item $int = $device->image2d_max_height
462 460
463Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE2D_MAX_HEIGHT> and returns the result(s). 461Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE2D_MAX_HEIGHT> and returns the result.
464 462
465=item $int = $device->image3d_max_width 463=item $int = $device->image3d_max_width
466 464
467Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE3D_MAX_WIDTH> and returns the result(s). 465Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE3D_MAX_WIDTH> and returns the result.
468 466
469=item $int = $device->image3d_max_height 467=item $int = $device->image3d_max_height
470 468
471Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE3D_MAX_HEIGHT> and returns the result(s). 469Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE3D_MAX_HEIGHT> and returns the result.
472 470
473=item $int = $device->image3d_max_depth 471=item $int = $device->image3d_max_depth
474 472
475Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE3D_MAX_DEPTH> and returns the result(s). 473Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE3D_MAX_DEPTH> and returns the result.
476 474
477=item $uint = $device->image_support 475=item $uint = $device->image_support
478 476
479Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE_SUPPORT> and returns the result(s). 477Calls C<clGetDeviceInfo> with C<CL_DEVICE_IMAGE_SUPPORT> and returns the result.
480 478
481=item $int = $device->max_parameter_size 479=item $int = $device->max_parameter_size
482 480
483Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_PARAMETER_SIZE> and returns the result(s). 481Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_PARAMETER_SIZE> and returns the result.
484 482
485=item $uint = $device->max_samplers 483=item $uint = $device->max_samplers
486 484
487Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_SAMPLERS> and returns the result(s). 485Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_SAMPLERS> and returns the result.
488 486
489=item $uint = $device->mem_base_addr_align 487=item $uint = $device->mem_base_addr_align
490 488
491Calls C<clGetDeviceInfo> with C<CL_DEVICE_MEM_BASE_ADDR_ALIGN> and returns the result(s). 489Calls C<clGetDeviceInfo> with C<CL_DEVICE_MEM_BASE_ADDR_ALIGN> and returns the result.
492 490
493=item $uint = $device->min_data_type_align_size 491=item $uint = $device->min_data_type_align_size
494 492
495Calls C<clGetDeviceInfo> with C<CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE> and returns the result(s). 493Calls C<clGetDeviceInfo> with C<CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE> and returns the result.
496 494
497=item $device_fp_config = $device->single_fp_config 495=item $device_fp_config = $device->single_fp_config
498 496
499Calls C<clGetDeviceInfo> with C<CL_DEVICE_SINGLE_FP_CONFIG> and returns the result(s). 497Calls C<clGetDeviceInfo> with C<CL_DEVICE_SINGLE_FP_CONFIG> and returns the result.
500 498
501=item $device_mem_cache_type = $device->global_mem_cache_type 499=item $device_mem_cache_type = $device->global_mem_cache_type
502 500
503Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_CACHE_TYPE> and returns the result(s). 501Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_CACHE_TYPE> and returns the result.
504 502
505=item $uint = $device->global_mem_cacheline_size 503=item $uint = $device->global_mem_cacheline_size
506 504
507Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE> and returns the result(s). 505Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE> and returns the result.
508 506
509=item $ulong = $device->global_mem_cache_size 507=item $ulong = $device->global_mem_cache_size
510 508
511Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_CACHE_SIZE> and returns the result(s). 509Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_CACHE_SIZE> and returns the result.
512 510
513=item $ulong = $device->global_mem_size 511=item $ulong = $device->global_mem_size
514 512
515Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_SIZE> and returns the result(s). 513Calls C<clGetDeviceInfo> with C<CL_DEVICE_GLOBAL_MEM_SIZE> and returns the result.
516 514
517=item $ulong = $device->max_constant_buffer_size 515=item $ulong = $device->max_constant_buffer_size
518 516
519Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE> and returns the result(s). 517Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE> and returns the result.
520 518
521=item $uint = $device->max_constant_args 519=item $uint = $device->max_constant_args
522 520
523Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_CONSTANT_ARGS> and returns the result(s). 521Calls C<clGetDeviceInfo> with C<CL_DEVICE_MAX_CONSTANT_ARGS> and returns the result.
524 522
525=item $device_local_mem_type = $device->local_mem_type 523=item $device_local_mem_type = $device->local_mem_type
526 524
527Calls C<clGetDeviceInfo> with C<CL_DEVICE_LOCAL_MEM_TYPE> and returns the result(s). 525Calls C<clGetDeviceInfo> with C<CL_DEVICE_LOCAL_MEM_TYPE> and returns the result.
528 526
529=item $ulong = $device->local_mem_size 527=item $ulong = $device->local_mem_size
530 528
531Calls C<clGetDeviceInfo> with C<CL_DEVICE_LOCAL_MEM_SIZE> and returns the result(s). 529Calls C<clGetDeviceInfo> with C<CL_DEVICE_LOCAL_MEM_SIZE> and returns the result.
532 530
533=item $boolean = $device->error_correction_support 531=item $boolean = $device->error_correction_support
534 532
535Calls C<clGetDeviceInfo> with C<CL_DEVICE_ERROR_CORRECTION_SUPPORT> and returns the result(s). 533Calls C<clGetDeviceInfo> with C<CL_DEVICE_ERROR_CORRECTION_SUPPORT> and returns the result.
536 534
537=item $int = $device->profiling_timer_resolution 535=item $int = $device->profiling_timer_resolution
538 536
539Calls C<clGetDeviceInfo> with C<CL_DEVICE_PROFILING_TIMER_RESOLUTION> and returns the result(s). 537Calls C<clGetDeviceInfo> with C<CL_DEVICE_PROFILING_TIMER_RESOLUTION> and returns the result.
540 538
541=item $boolean = $device->endian_little 539=item $boolean = $device->endian_little
542 540
543Calls C<clGetDeviceInfo> with C<CL_DEVICE_ENDIAN_LITTLE> and returns the result(s). 541Calls C<clGetDeviceInfo> with C<CL_DEVICE_ENDIAN_LITTLE> and returns the result.
544 542
545=item $boolean = $device->available 543=item $boolean = $device->available
546 544
547Calls C<clGetDeviceInfo> with C<CL_DEVICE_AVAILABLE> and returns the result(s). 545Calls C<clGetDeviceInfo> with C<CL_DEVICE_AVAILABLE> and returns the result.
548 546
549=item $boolean = $device->compiler_available 547=item $boolean = $device->compiler_available
550 548
551Calls C<clGetDeviceInfo> with C<CL_DEVICE_COMPILER_AVAILABLE> and returns the result(s). 549Calls C<clGetDeviceInfo> with C<CL_DEVICE_COMPILER_AVAILABLE> and returns the result.
552 550
553=item $device_exec_capabilities = $device->execution_capabilities 551=item $device_exec_capabilities = $device->execution_capabilities
554 552
555Calls C<clGetDeviceInfo> with C<CL_DEVICE_EXECUTION_CAPABILITIES> and returns the result(s). 553Calls C<clGetDeviceInfo> with C<CL_DEVICE_EXECUTION_CAPABILITIES> and returns the result.
556 554
557=item $command_queue_properties = $device->properties 555=item $command_queue_properties = $device->properties
558 556
559Calls C<clGetDeviceInfo> with C<CL_DEVICE_QUEUE_PROPERTIES> and returns the result(s). 557Calls C<clGetDeviceInfo> with C<CL_DEVICE_QUEUE_PROPERTIES> and returns the result.
560 558
561=item $ = $device->platform 559=item $ = $device->platform
562 560
563Calls C<clGetDeviceInfo> with C<CL_DEVICE_PLATFORM> and returns the result(s). 561Calls C<clGetDeviceInfo> with C<CL_DEVICE_PLATFORM> and returns the result.
564 562
565=item $string = $device->name 563=item $string = $device->name
566 564
567Calls C<clGetDeviceInfo> with C<CL_DEVICE_NAME> and returns the result(s). 565Calls C<clGetDeviceInfo> with C<CL_DEVICE_NAME> and returns the result.
568 566
569=item $string = $device->vendor 567=item $string = $device->vendor
570 568
571Calls C<clGetDeviceInfo> with C<CL_DEVICE_VENDOR> and returns the result(s). 569Calls C<clGetDeviceInfo> with C<CL_DEVICE_VENDOR> and returns the result.
572 570
573=item $string = $device->driver_version 571=item $string = $device->driver_version
574 572
575Calls C<clGetDeviceInfo> with C<CL_DRIVER_VERSION> and returns the result(s). 573Calls C<clGetDeviceInfo> with C<CL_DRIVER_VERSION> and returns the result.
576 574
577=item $string = $device->profile 575=item $string = $device->profile
578 576
579Calls C<clGetDeviceInfo> with C<CL_DEVICE_PROFILE> and returns the result(s). 577Calls C<clGetDeviceInfo> with C<CL_DEVICE_PROFILE> and returns the result.
580 578
581=item $string = $device->version 579=item $string = $device->version
582 580
583Calls C<clGetDeviceInfo> with C<CL_DEVICE_VERSION> and returns the result(s). 581Calls C<clGetDeviceInfo> with C<CL_DEVICE_VERSION> and returns the result.
584 582
585=item $string = $device->extensions 583=item $string = $device->extensions
586 584
587Calls C<clGetDeviceInfo> with C<CL_DEVICE_EXTENSIONS> and returns the result(s). 585Calls C<clGetDeviceInfo> with C<CL_DEVICE_EXTENSIONS> and returns the result.
588 586
589=item $uint = $device->preferred_vector_width_half 587=item $uint = $device->preferred_vector_width_half
590 588
591Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF> and returns the result(s). 589Calls C<clGetDeviceInfo> with C<CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF> and returns the result.
592 590
593=item $uint = $device->native_vector_width_char 591=item $uint = $device->native_vector_width_char
594 592
595Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR> and returns the result(s). 593Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR> and returns the result.
596 594
597=item $uint = $device->native_vector_width_short 595=item $uint = $device->native_vector_width_short
598 596
599Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT> and returns the result(s). 597Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT> and returns the result.
600 598
601=item $uint = $device->native_vector_width_int 599=item $uint = $device->native_vector_width_int
602 600
603Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_INT> and returns the result(s). 601Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_INT> and returns the result.
604 602
605=item $uint = $device->native_vector_width_long 603=item $uint = $device->native_vector_width_long
606 604
607Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG> and returns the result(s). 605Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG> and returns the result.
608 606
609=item $uint = $device->native_vector_width_float 607=item $uint = $device->native_vector_width_float
610 608
611Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT> and returns the result(s). 609Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT> and returns the result.
612 610
613=item $uint = $device->native_vector_width_double 611=item $uint = $device->native_vector_width_double
614 612
615Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE> and returns the result(s). 613Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE> and returns the result.
616 614
617=item $uint = $device->native_vector_width_half 615=item $uint = $device->native_vector_width_half
618 616
619Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF> and returns the result(s). 617Calls C<clGetDeviceInfo> with C<CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF> and returns the result.
620 618
621=item $device_fp_config = $device->double_fp_config 619=item $device_fp_config = $device->double_fp_config
622 620
623Calls C<clGetDeviceInfo> with C<CL_DEVICE_DOUBLE_FP_CONFIG> and returns the result(s). 621Calls C<clGetDeviceInfo> with C<CL_DEVICE_DOUBLE_FP_CONFIG> and returns the result.
624 622
625=item $device_fp_config = $device->half_fp_config 623=item $device_fp_config = $device->half_fp_config
626 624
627Calls C<clGetDeviceInfo> with C<CL_DEVICE_HALF_FP_CONFIG> and returns the result(s). 625Calls C<clGetDeviceInfo> with C<CL_DEVICE_HALF_FP_CONFIG> and returns the result.
628 626
629=item $boolean = $device->host_unified_memory 627=item $boolean = $device->host_unified_memory
630 628
631Calls C<clGetDeviceInfo> with C<CL_DEVICE_HOST_UNIFIED_MEMORY> and returns the result(s). 629Calls C<clGetDeviceInfo> with C<CL_DEVICE_HOST_UNIFIED_MEMORY> and returns the result.
632 630
633=item $device = $device->parent_device_ext 631=item $device = $device->parent_device_ext
634 632
635Calls C<clGetDeviceInfo> with C<CL_DEVICE_PARENT_DEVICE_EXT> and returns the result(s). 633Calls C<clGetDeviceInfo> with C<CL_DEVICE_PARENT_DEVICE_EXT> and returns the result.
636 634
637=item @device_partition_property_exts = $device->partition_types_ext 635=item @device_partition_property_exts = $device->partition_types_ext
638 636
639Calls C<clGetDeviceInfo> with C<CL_DEVICE_PARTITION_TYPES_EXT> and returns the result(s). 637Calls C<clGetDeviceInfo> with C<CL_DEVICE_PARTITION_TYPES_EXT> and returns the result.
640 638
641=item @device_partition_property_exts = $device->affinity_domains_ext 639=item @device_partition_property_exts = $device->affinity_domains_ext
642 640
643Calls C<clGetDeviceInfo> with C<CL_DEVICE_AFFINITY_DOMAINS_EXT> and returns the result(s). 641Calls C<clGetDeviceInfo> with C<CL_DEVICE_AFFINITY_DOMAINS_EXT> and returns the result.
644 642
645=item $uint = $device->reference_count_ext 643=item $uint = $device->reference_count_ext
646 644
647Calls C<clGetDeviceInfo> with C<CL_DEVICE_REFERENCE_COUNT_EXT > and returns the result(s). 645Calls C<clGetDeviceInfo> with C<CL_DEVICE_REFERENCE_COUNT_EXT > and returns the result.
648 646
649=item @device_partition_property_exts = $device->partition_style_ext 647=item @device_partition_property_exts = $device->partition_style_ext
650 648
651Calls C<clGetDeviceInfo> with C<CL_DEVICE_PARTITION_STYLE_EXT> and returns the result(s). 649Calls C<clGetDeviceInfo> with C<CL_DEVICE_PARTITION_STYLE_EXT> and returns the result.
652 650
653=for gengetinfo end device 651=for gengetinfo end device
654 652
655=back 653=back
656 654
670 668
671L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateUserEvent.html> 669L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateUserEvent.html>
672 670
673=item $buf = $ctx->buffer ($flags, $len) 671=item $buf = $ctx->buffer ($flags, $len)
674 672
675Creates a new OpenCL::Buffer object with the given flags and octet-size. 673Creates a new OpenCL::Buffer (actually OpenCL::BufferObj) object with the
674given flags and octet-size.
676 675
677L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateBuffer.html> 676L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateBuffer.html>
678 677
679=item $buf = $ctx->buffer_sv ($flags, $data) 678=item $buf = $ctx->buffer_sv ($flags, $data)
680 679
681Creates a new OpenCL::Buffer object and initialise it with the given data values. 680Creates a new OpenCL::Buffer (actually OpenCL::BufferObj) object and
681initialise it with the given data values.
682 682
683=item $img = $ctx->image2d ($flags, $channel_order, $channel_type, $width, $height, $row_pitch = 0, $data = undef) 683=item $img = $ctx->image2d ($flags, $channel_order, $channel_type, $width, $height, $row_pitch = 0, $data = undef)
684 684
685Creates a new OpenCL::Image2D object and optionally initialises it with the given data values. 685Creates a new OpenCL::Image2D object and optionally initialises it with
686the given data values.
686 687
687L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage2D.html> 688L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage2D.html>
688 689
689=item $img = $ctx->image3d ($flags, $channel_order, $channel_type, $width, $height, $depth, $row_pitch = 0, $slice_pitch = 0, $data = undef) 690=item $img = $ctx->image3d ($flags, $channel_order, $channel_type, $width, $height, $depth, $row_pitch = 0, $slice_pitch = 0, $data = undef)
690 691
691Creates a new OpenCL::Image3D object and optionally initialises it with the given data values. 692Creates a new OpenCL::Image3D object and optionally initialises it with
693the given data values.
692 694
693L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html> 695L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html>
696
697=item $buffer = $ctx->gl_buffer ($flags, $bufobj)
698
699Creates a new OpenCL::Buffer (actually OpenCL::BufferObj) object that refers to the given
700OpenGL buffer object.
701
702http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLBuffer.html
703
704=item $ctx->gl_texture2d ($flags, $target, $miplevel, $texture)
705
706Creates a new OpenCL::Image2D object that refers to the given OpenGL
7072D texture object.
708
709http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLTexture2D.html
710
711=item $ctx->gl_texture3d ($flags, $target, $miplevel, $texture)
712
713Creates a new OpenCL::Image3D object that refers to the given OpenGL
7143D texture object.
715
716http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLTexture3D.html
717
718=item $ctx->gl_renderbuffer ($flags, $renderbuffer)
719
720Creates a new OpenCL::Image2D object that refers to the given OpenGL
721render buffer.
722
723http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLRenderbuffer.html
694 724
695=item @formats = $ctx->supported_image_formats ($flags, $image_type) 725=item @formats = $ctx->supported_image_formats ($flags, $image_type)
696 726
697Returns a list of matching image formats - each format is an arrayref with 727Returns a list of matching image formats - each format is an arrayref with
698two values, $channel_order and $channel_type, in it. 728two values, $channel_order and $channel_type, in it.
717 747
718L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html> 748L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetContextInfo.html>
719 749
720=for gengetinfo begin context 750=for gengetinfo begin context
721 751
722
723=item $uint = $context->reference_count 752=item $uint = $context->reference_count
724 753
725Calls C<clGetContextInfo> with C<CL_CONTEXT_REFERENCE_COUNT> and returns the result(s). 754Calls C<clGetContextInfo> with C<CL_CONTEXT_REFERENCE_COUNT> and returns the result.
726 755
727=item @devices = $context->devices 756=item @devices = $context->devices
728 757
729Calls C<clGetContextInfo> with C<CL_CONTEXT_DEVICES> and returns the result(s). 758Calls C<clGetContextInfo> with C<CL_CONTEXT_DEVICES> and returns the result.
730 759
731=item @property_ints = $context->properties 760=item @property_ints = $context->properties
732 761
733Calls C<clGetContextInfo> with C<CL_CONTEXT_PROPERTIES> and returns the result(s). 762Calls C<clGetContextInfo> with C<CL_CONTEXT_PROPERTIES> and returns the result.
734 763
735=item $uint = $context->num_devices 764=item $uint = $context->num_devices
736 765
737Calls C<clGetContextInfo> with C<CL_CONTEXT_NUM_DEVICES> and returns the result(s). 766Calls C<clGetContextInfo> with C<CL_CONTEXT_NUM_DEVICES> and returns the result.
738 767
739=for gengetinfo end context 768=for gengetinfo end context
740 769
741=back 770=back
742 771
774 803
775=item $ev = $queue->enqueue_copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...) 804=item $ev = $queue->enqueue_copy_buffer ($src, $dst, $src_offset, $dst_offset, $len, $wait_events...)
776 805
777L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html> 806L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBuffer.html>
778 807
808=item $ev = $queue->enqueue_read_buffer_rect (OpenCL::Memory buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...)
809
810http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadBufferRect.html
811
812=item $ev = $queue->enqueue_write_buffer_rect (OpenCL::Memory buf, cl_bool blocking, $buf_x, $buf_y, $buf_z, $host_x, $host_y, $host_z, $width, $height, $depth, $buf_row_pitch, $buf_slice_pitch, $host_row_pitch, $host_slice_pitch, $data, $wait_events...)
813
814http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteBufferRect.html
815
779=item $ev = $queue->enqueue_read_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...) 816=item $ev = $queue->enqueue_read_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...)
780 817
818L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferRect.html>
819
820=item $ev = $queue->enqueue_copy_buffer_to_image ($src_buffer, $dst_image, $src_offset, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...)
821
781L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadImage.html> 822L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReadImage.html>
782 823
783=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...) 824=item $ev = $queue->enqueue_write_image ($src, $blocking, $x, $y, $z, $width, $height, $depth, $row_pitch, $slice_pitch, $data, $wait_events...)
784 825
785L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteImage.html> 826L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWriteImage.html>
786 827
828=item $ev = $queue->enqueue_copy_image ($src_image, $dst_image, $src_x, $src_y, $src_z, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...)
829
830L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImage.html>
831
832=item $ev = $queue->enqueue_copy_image_to_buffer ($src_image, $dst_image, $src_x, $src_y, $src_z, $width, $height, $depth, $dst_offset, $wait_events...)
833
834L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImageToBuffer.html>
835
787=item $ev = $queue->enqueue_copy_buffer_rect ($src, $dst, $src_x, $src_y, $src_z, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $src_row_pitch, $src_slice_pitch, $dst_row_pitch, $dst_slice_pitch, $wait_event...) 836=item $ev = $queue->enqueue_copy_buffer_rect ($src, $dst, $src_x, $src_y, $src_z, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $src_row_pitch, $src_slice_pitch, $dst_row_pitch, $dst_slice_pitch, $wait_event...)
788 837
789Yeah. 838Yeah.
790 839
791L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferRect.html>
792
793=item $ev = $queue->enqueue_copy_buffer_to_image ($src_buffer, $dst_image, $src_offset, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...)
794
795L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferToImage.html>. 840L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyBufferToImage.html>.
796
797=item $ev = $queue->enqueue_copy_image ($src_image, $dst_image, $src_x, $src_y, $src_z, $dst_x, $dst_y, $dst_z, $width, $height, $depth, $wait_events...)
798
799L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImage.html>
800
801=item $ev = $queue->enqueue_copy_image_to_buffer ($src_image, $dst_image, $src_x, $src_y, $src_z, $width, $height, $depth, $dst_offset, $wait_events...)
802
803L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueCopyImageToBuffer.html>
804 841
805=item $ev = $queue->enqueue_task ($kernel, $wait_events...) 842=item $ev = $queue->enqueue_task ($kernel, $wait_events...)
806 843
807L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueTask.html> 844L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueTask.html>
808 845
850 887
851L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetCommandQueueInfo.html> 888L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetCommandQueueInfo.html>
852 889
853=for gengetinfo begin command_queue 890=for gengetinfo begin command_queue
854 891
855
856=item $ctx = $command_queue->context 892=item $ctx = $command_queue->context
857 893
858Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_CONTEXT> and returns the result(s). 894Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_CONTEXT> and returns the result.
859 895
860=item $device = $command_queue->device 896=item $device = $command_queue->device
861 897
862Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_DEVICE> and returns the result(s). 898Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_DEVICE> and returns the result.
863 899
864=item $uint = $command_queue->reference_count 900=item $uint = $command_queue->reference_count
865 901
866Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_REFERENCE_COUNT> and returns the result(s). 902Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_REFERENCE_COUNT> and returns the result.
867 903
868=item $command_queue_properties = $command_queue->properties 904=item $command_queue_properties = $command_queue->properties
869 905
870Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_PROPERTIES> and returns the result(s). 906Calls C<clGetCommandQueueInfo> with C<CL_QUEUE_PROPERTIES> and returns the result.
871 907
872=for gengetinfo end command_queue 908=for gengetinfo end command_queue
873 909
874=back 910=back
875 911
886 922
887L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html> 923L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetMemObjectInfo.html>
888 924
889=for gengetinfo begin mem 925=for gengetinfo begin mem
890 926
891
892=item $mem_object_type = $mem->type 927=item $mem_object_type = $mem->type
893 928
894Calls C<clGetMemObjectInfo> with C<CL_MEM_TYPE> and returns the result(s). 929Calls C<clGetMemObjectInfo> with C<CL_MEM_TYPE> and returns the result.
895 930
896=item $mem_flags = $mem->flags 931=item $mem_flags = $mem->flags
897 932
898Calls C<clGetMemObjectInfo> with C<CL_MEM_FLAGS> and returns the result(s). 933Calls C<clGetMemObjectInfo> with C<CL_MEM_FLAGS> and returns the result.
899 934
900=item $int = $mem->size 935=item $int = $mem->size
901 936
902Calls C<clGetMemObjectInfo> with C<CL_MEM_SIZE> and returns the result(s). 937Calls C<clGetMemObjectInfo> with C<CL_MEM_SIZE> and returns the result.
903 938
904=item $ptr_value = $mem->host_ptr 939=item $ptr_value = $mem->host_ptr
905 940
906Calls C<clGetMemObjectInfo> with C<CL_MEM_HOST_PTR> and returns the result(s). 941Calls C<clGetMemObjectInfo> with C<CL_MEM_HOST_PTR> and returns the result.
907 942
908=item $uint = $mem->map_count 943=item $uint = $mem->map_count
909 944
910Calls C<clGetMemObjectInfo> with C<CL_MEM_MAP_COUNT> and returns the result(s). 945Calls C<clGetMemObjectInfo> with C<CL_MEM_MAP_COUNT> and returns the result.
911 946
912=item $uint = $mem->reference_count 947=item $uint = $mem->reference_count
913 948
914Calls C<clGetMemObjectInfo> with C<CL_MEM_REFERENCE_COUNT> and returns the result(s). 949Calls C<clGetMemObjectInfo> with C<CL_MEM_REFERENCE_COUNT> and returns the result.
915 950
916=item $ctx = $mem->context 951=item $ctx = $mem->context
917 952
918Calls C<clGetMemObjectInfo> with C<CL_MEM_CONTEXT> and returns the result(s). 953Calls C<clGetMemObjectInfo> with C<CL_MEM_CONTEXT> and returns the result.
919 954
920=item $mem = $mem->associated_memobject 955=item $mem = $mem->associated_memobject
921 956
922Calls C<clGetMemObjectInfo> with C<CL_MEM_ASSOCIATED_MEMOBJECT> and returns the result(s). 957Calls C<clGetMemObjectInfo> with C<CL_MEM_ASSOCIATED_MEMOBJECT> and returns the result.
923 958
924=item $int = $mem->offset 959=item $int = $mem->offset
925 960
926Calls C<clGetMemObjectInfo> with C<CL_MEM_OFFSET> and returns the result(s). 961Calls C<clGetMemObjectInfo> with C<CL_MEM_OFFSET> and returns the result.
927 962
928=for gengetinfo end mem 963=for gengetinfo end mem
964
965=back
966
967=head2 THE OpenCL::Buffer CLASS
968
969This is a subclass of OpenCL::Memory, and the superclass of
970OpenCL::BufferObj. Its purpose is simply to distinguish between buffers
971and sub-buffers.
972
973=head2 THE OpenCL::BufferObj CLASS
974
975This is a subclass of OpenCL::Buffer and thus OpenCL::Memory. It exists
976because one cna create sub buffers of OpenLC::BufferObj objects, but not
977sub buffers from these sub buffers.
978
979=over 4
980
981=item $subbuf = $buf_obj->sub_buffer_region ($flags, $origin, $size)
982
983Creates an OpenCL::Buffer objects from this buffer and returns it. The
984C<buffer_create_type> is assumed to be C<CL_BUFFER_CREATE_TYPE_REGION>.
985
986L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateSubBuffer.html>
929 987
930=back 988=back
931 989
932=head2 THE OpenCL::Image CLASS 990=head2 THE OpenCL::Image CLASS
933 991
944 1002
945L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetImageInfo.html> 1003L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetImageInfo.html>
946 1004
947=for gengetinfo begin image 1005=for gengetinfo begin image
948 1006
949
950=item $int = $image->element_size 1007=item $int = $image->element_size
951 1008
952Calls C<clGetImageInfo> with C<CL_IMAGE_ELEMENT_SIZE> and returns the result(s). 1009Calls C<clGetImageInfo> with C<CL_IMAGE_ELEMENT_SIZE> and returns the result.
953 1010
954=item $int = $image->row_pitch 1011=item $int = $image->row_pitch
955 1012
956Calls C<clGetImageInfo> with C<CL_IMAGE_ROW_PITCH> and returns the result(s). 1013Calls C<clGetImageInfo> with C<CL_IMAGE_ROW_PITCH> and returns the result.
957 1014
958=item $int = $image->slice_pitch 1015=item $int = $image->slice_pitch
959 1016
960Calls C<clGetImageInfo> with C<CL_IMAGE_SLICE_PITCH> and returns the result(s). 1017Calls C<clGetImageInfo> with C<CL_IMAGE_SLICE_PITCH> and returns the result.
961 1018
962=item $int = $image->width 1019=item $int = $image->width
963 1020
964Calls C<clGetImageInfo> with C<CL_IMAGE_WIDTH> and returns the result(s). 1021Calls C<clGetImageInfo> with C<CL_IMAGE_WIDTH> and returns the result.
965 1022
966=item $int = $image->height 1023=item $int = $image->height
967 1024
968Calls C<clGetImageInfo> with C<CL_IMAGE_HEIGHT> and returns the result(s). 1025Calls C<clGetImageInfo> with C<CL_IMAGE_HEIGHT> and returns the result.
969 1026
970=item $int = $image->depth 1027=item $int = $image->depth
971 1028
972Calls C<clGetImageInfo> with C<CL_IMAGE_DEPTH> and returns the result(s). 1029Calls C<clGetImageInfo> with C<CL_IMAGE_DEPTH> and returns the result.
973 1030
974=for gengetinfo end image 1031=for gengetinfo end image
975 1032
976=back 1033=back
977 1034
985 1042
986L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetSamplerInfo.html> 1043L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetSamplerInfo.html>
987 1044
988=for gengetinfo begin sampler 1045=for gengetinfo begin sampler
989 1046
990
991=item $uint = $sampler->reference_count 1047=item $uint = $sampler->reference_count
992 1048
993Calls C<clGetSamplerInfo> with C<CL_SAMPLER_REFERENCE_COUNT> and returns the result(s). 1049Calls C<clGetSamplerInfo> with C<CL_SAMPLER_REFERENCE_COUNT> and returns the result.
994 1050
995=item $ctx = $sampler->context 1051=item $ctx = $sampler->context
996 1052
997Calls C<clGetSamplerInfo> with C<CL_SAMPLER_CONTEXT> and returns the result(s). 1053Calls C<clGetSamplerInfo> with C<CL_SAMPLER_CONTEXT> and returns the result.
998 1054
999=item $addressing_mode = $sampler->normalized_coords 1055=item $addressing_mode = $sampler->normalized_coords
1000 1056
1001Calls C<clGetSamplerInfo> with C<CL_SAMPLER_NORMALIZED_COORDS> and returns the result(s). 1057Calls C<clGetSamplerInfo> with C<CL_SAMPLER_NORMALIZED_COORDS> and returns the result.
1002 1058
1003=item $filter_mode = $sampler->addressing_mode 1059=item $filter_mode = $sampler->addressing_mode
1004 1060
1005Calls C<clGetSamplerInfo> with C<CL_SAMPLER_ADDRESSING_MODE> and returns the result(s). 1061Calls C<clGetSamplerInfo> with C<CL_SAMPLER_ADDRESSING_MODE> and returns the result.
1006 1062
1007=item $boolean = $sampler->filter_mode 1063=item $boolean = $sampler->filter_mode
1008 1064
1009Calls C<clGetSamplerInfo> with C<CL_SAMPLER_FILTER_MODE> and returns the result(s). 1065Calls C<clGetSamplerInfo> with C<CL_SAMPLER_FILTER_MODE> and returns the result.
1010 1066
1011=for gengetinfo end sampler 1067=for gengetinfo end sampler
1012 1068
1013=back 1069=back
1014 1070
1036 1092
1037L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateKernel.html> 1093L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateKernel.html>
1038 1094
1039=for gengetinfo begin program_build 1095=for gengetinfo begin program_build
1040 1096
1041
1042=item $build_status = $program->build_status ($device) 1097=item $build_status = $program->build_status ($device)
1043 1098
1044Calls C<clGetProgramBuildInfo> with C<CL_PROGRAM_BUILD_STATUS> and returns the result(s). 1099Calls C<clGetProgramBuildInfo> with C<CL_PROGRAM_BUILD_STATUS> and returns the result.
1045 1100
1046=item $string = $program->build_options ($device) 1101=item $string = $program->build_options ($device)
1047 1102
1048Calls C<clGetProgramBuildInfo> with C<CL_PROGRAM_BUILD_OPTIONS> and returns the result(s). 1103Calls C<clGetProgramBuildInfo> with C<CL_PROGRAM_BUILD_OPTIONS> and returns the result.
1049 1104
1050=item $string = $program->build_log ($device) 1105=item $string = $program->build_log ($device)
1051 1106
1052Calls C<clGetProgramBuildInfo> with C<CL_PROGRAM_BUILD_LOG> and returns the result(s). 1107Calls C<clGetProgramBuildInfo> with C<CL_PROGRAM_BUILD_LOG> and returns the result.
1053 1108
1054=for gengetinfo end program_build 1109=for gengetinfo end program_build
1055 1110
1056=item $packed_value = $program->info ($name) 1111=item $packed_value = $program->info ($name)
1057 1112
1059 1114
1060L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetProgramInfo.html> 1115L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetProgramInfo.html>
1061 1116
1062=for gengetinfo begin program 1117=for gengetinfo begin program
1063 1118
1064
1065=item $uint = $program->reference_count 1119=item $uint = $program->reference_count
1066 1120
1067Calls C<clGetProgramInfo> with C<CL_PROGRAM_REFERENCE_COUNT> and returns the result(s). 1121Calls C<clGetProgramInfo> with C<CL_PROGRAM_REFERENCE_COUNT> and returns the result.
1068 1122
1069=item $ctx = $program->context 1123=item $ctx = $program->context
1070 1124
1071Calls C<clGetProgramInfo> with C<CL_PROGRAM_CONTEXT> and returns the result(s). 1125Calls C<clGetProgramInfo> with C<CL_PROGRAM_CONTEXT> and returns the result.
1072 1126
1073=item $uint = $program->num_devices 1127=item $uint = $program->num_devices
1074 1128
1075Calls C<clGetProgramInfo> with C<CL_PROGRAM_NUM_DEVICES> and returns the result(s). 1129Calls C<clGetProgramInfo> with C<CL_PROGRAM_NUM_DEVICES> and returns the result.
1076 1130
1077=item @devices = $program->devices 1131=item @devices = $program->devices
1078 1132
1079Calls C<clGetProgramInfo> with C<CL_PROGRAM_DEVICES> and returns the result(s). 1133Calls C<clGetProgramInfo> with C<CL_PROGRAM_DEVICES> and returns the result.
1080 1134
1081=item $string = $program->source 1135=item $string = $program->source
1082 1136
1083Calls C<clGetProgramInfo> with C<CL_PROGRAM_SOURCE> and returns the result(s). 1137Calls C<clGetProgramInfo> with C<CL_PROGRAM_SOURCE> and returns the result.
1084 1138
1085=item @ints = $program->binary_sizes 1139=item @ints = $program->binary_sizes
1086 1140
1087Calls C<clGetProgramInfo> with C<CL_PROGRAM_BINARY_SIZES> and returns the result(s). 1141Calls C<clGetProgramInfo> with C<CL_PROGRAM_BINARY_SIZES> and returns the result.
1088 1142
1089=for gengetinfo end program 1143=for gengetinfo end program
1090 1144
1145=item @blobs = $program->binaries
1146
1147Returns a string for the compiled binary for every device associated with
1148the program, empty strings indicate missing programs, and an empty result
1149means no program binaries are available.
1150
1151These "binaries" are often, in fact, informative low-level assembly
1152sources.
1153
1154L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetProgramInfo.html>
1155
1091=back 1156=back
1092 1157
1093=head2 THE OpenCL::Kernel CLASS 1158=head2 THE OpenCL::Kernel CLASS
1094 1159
1095=over 4 1160=over 4
1100 1165
1101L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetKernelInfo.html> 1166L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetKernelInfo.html>
1102 1167
1103=for gengetinfo begin kernel 1168=for gengetinfo begin kernel
1104 1169
1105
1106=item $string = $kernel->function_name 1170=item $string = $kernel->function_name
1107 1171
1108Calls C<clGetKernelInfo> with C<CL_KERNEL_FUNCTION_NAME> and returns the result(s). 1172Calls C<clGetKernelInfo> with C<CL_KERNEL_FUNCTION_NAME> and returns the result.
1109 1173
1110=item $uint = $kernel->num_args 1174=item $uint = $kernel->num_args
1111 1175
1112Calls C<clGetKernelInfo> with C<CL_KERNEL_NUM_ARGS> and returns the result(s). 1176Calls C<clGetKernelInfo> with C<CL_KERNEL_NUM_ARGS> and returns the result.
1113 1177
1114=item $uint = $kernel->reference_count 1178=item $uint = $kernel->reference_count
1115 1179
1116Calls C<clGetKernelInfo> with C<CL_KERNEL_REFERENCE_COUNT> and returns the result(s). 1180Calls C<clGetKernelInfo> with C<CL_KERNEL_REFERENCE_COUNT> and returns the result.
1117 1181
1118=item $ctx = $kernel->context 1182=item $ctx = $kernel->context
1119 1183
1120Calls C<clGetKernelInfo> with C<CL_KERNEL_CONTEXT> and returns the result(s). 1184Calls C<clGetKernelInfo> with C<CL_KERNEL_CONTEXT> and returns the result.
1121 1185
1122=item $program = $kernel->program 1186=item $program = $kernel->program
1123 1187
1124Calls C<clGetKernelInfo> with C<CL_KERNEL_PROGRAM> and returns the result(s). 1188Calls C<clGetKernelInfo> with C<CL_KERNEL_PROGRAM> and returns the result.
1125 1189
1126=for gengetinfo end kernel 1190=for gengetinfo end kernel
1127 1191
1128=item $packed_value = $kernel->work_group_info ($device, $name) 1192=item $packed_value = $kernel->work_group_info ($device, $name)
1129 1193
1134 1198
1135L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetKernelWorkGroupInfo.html> 1199L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetKernelWorkGroupInfo.html>
1136 1200
1137=for gengetinfo begin kernel_work_group 1201=for gengetinfo begin kernel_work_group
1138 1202
1139
1140=item $int = $kernel->work_group_size ($device) 1203=item $int = $kernel->work_group_size ($device)
1141 1204
1142Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_WORK_GROUP_SIZE> and returns the result(s). 1205Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_WORK_GROUP_SIZE> and returns the result.
1143 1206
1144=item @ints = $kernel->compile_work_group_size ($device) 1207=item @ints = $kernel->compile_work_group_size ($device)
1145 1208
1146Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_COMPILE_WORK_GROUP_SIZE> and returns the result(s). 1209Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_COMPILE_WORK_GROUP_SIZE> and returns the result.
1147 1210
1148=item $ulong = $kernel->local_mem_size ($device) 1211=item $ulong = $kernel->local_mem_size ($device)
1149 1212
1150Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_LOCAL_MEM_SIZE> and returns the result(s). 1213Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_LOCAL_MEM_SIZE> and returns the result.
1151 1214
1152=item $int = $kernel->preferred_work_group_size_multiple ($device) 1215=item $int = $kernel->preferred_work_group_size_multiple ($device)
1153 1216
1154Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE> and returns the result(s). 1217Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE> and returns the result.
1155 1218
1156=item $ulong = $kernel->private_mem_size ($device) 1219=item $ulong = $kernel->private_mem_size ($device)
1157 1220
1158Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_PRIVATE_MEM_SIZE> and returns the result(s). 1221Calls C<clGetKernelWorkGroupInfo> with C<CL_KERNEL_PRIVATE_MEM_SIZE> and returns the result.
1159 1222
1160=for gengetinfo end kernel_work_group 1223=for gengetinfo end kernel_work_group
1161 1224
1162=item $kernel->set_TYPE ($index, $value) 1225=item $kernel->set_TYPE ($index, $value)
1163 1226
1195 1258
1196L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetEventInfo.html> 1259L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetEventInfo.html>
1197 1260
1198=for gengetinfo begin event 1261=for gengetinfo begin event
1199 1262
1200
1201=item $queue = $event->command_queue 1263=item $queue = $event->command_queue
1202 1264
1203Calls C<clGetEventInfo> with C<CL_EVENT_COMMAND_QUEUE> and returns the result(s). 1265Calls C<clGetEventInfo> with C<CL_EVENT_COMMAND_QUEUE> and returns the result.
1204 1266
1205=item $command_type = $event->command_type 1267=item $command_type = $event->command_type
1206 1268
1207Calls C<clGetEventInfo> with C<CL_EVENT_COMMAND_TYPE> and returns the result(s). 1269Calls C<clGetEventInfo> with C<CL_EVENT_COMMAND_TYPE> and returns the result.
1208 1270
1209=item $uint = $event->reference_count 1271=item $uint = $event->reference_count
1210 1272
1211Calls C<clGetEventInfo> with C<CL_EVENT_REFERENCE_COUNT> and returns the result(s). 1273Calls C<clGetEventInfo> with C<CL_EVENT_REFERENCE_COUNT> and returns the result.
1212 1274
1213=item $uint = $event->command_execution_status 1275=item $uint = $event->command_execution_status
1214 1276
1215Calls C<clGetEventInfo> with C<CL_EVENT_COMMAND_EXECUTION_STATUS> and returns the result(s). 1277Calls C<clGetEventInfo> with C<CL_EVENT_COMMAND_EXECUTION_STATUS> and returns the result.
1216 1278
1217=item $ctx = $event->context 1279=item $ctx = $event->context
1218 1280
1219Calls C<clGetEventInfo> with C<CL_EVENT_CONTEXT> and returns the result(s). 1281Calls C<clGetEventInfo> with C<CL_EVENT_CONTEXT> and returns the result.
1220 1282
1221=for gengetinfo end event 1283=for gengetinfo end event
1222 1284
1223=item $packed_value = $ev->profiling_info ($name) 1285=item $packed_value = $ev->profiling_info ($name)
1224 1286
1229 1291
1230L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetProfilingInfo.html> 1292L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetProfilingInfo.html>
1231 1293
1232=for gengetinfo begin profiling 1294=for gengetinfo begin profiling
1233 1295
1234
1235=item $ulong = $event->profiling_command_queued 1296=item $ulong = $event->profiling_command_queued
1236 1297
1237Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_QUEUED> and returns the result(s). 1298Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_QUEUED> and returns the result.
1238 1299
1239=item $ulong = $event->profiling_command_submit 1300=item $ulong = $event->profiling_command_submit
1240 1301
1241Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_SUBMIT> and returns the result(s). 1302Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_SUBMIT> and returns the result.
1242 1303
1243=item $ulong = $event->profiling_command_start 1304=item $ulong = $event->profiling_command_start
1244 1305
1245Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_START> and returns the result(s). 1306Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_START> and returns the result.
1246 1307
1247=item $ulong = $event->profiling_command_end 1308=item $ulong = $event->profiling_command_end
1248 1309
1249Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_END> and returns the result(s). 1310Calls C<clGetEventProfilingInfo> with C<CL_PROFILING_COMMAND_END> and returns the result.
1250 1311
1251=for gengetinfo end profiling 1312=for gengetinfo end profiling
1252 1313
1253=back 1314=back
1254 1315
1269package OpenCL; 1330package OpenCL;
1270 1331
1271use common::sense; 1332use common::sense;
1272 1333
1273BEGIN { 1334BEGIN {
1274 our $VERSION = '0.55'; 1335 our $VERSION = '0.92';
1275 1336
1276 require XSLoader; 1337 require XSLoader;
1277 XSLoader::load (__PACKAGE__, $VERSION); 1338 XSLoader::load (__PACKAGE__, $VERSION);
1278 1339
1279 @OpenCL::Buffer::ISA = 1340 @OpenCL::Buffer::ISA =
1280 @OpenCL::Image::ISA = OpenCL::Memory::; 1341 @OpenCL::Image::ISA = OpenCL::Memory::;
1281 1342
1343 @OpenCL::BufferObj::ISA = OpenCL::Buffer::;
1344
1282 @OpenCL::Image2D::ISA = 1345 @OpenCL::Image2D::ISA =
1283 @OpenCL::Image3D::ISA = OpenCL::Image::; 1346 @OpenCL::Image3D::ISA = OpenCL::Image::;
1284 1347
1285 @OpenCL::UserEvent::ISA = OpenCL::Event::; 1348 @OpenCL::UserEvent::ISA = OpenCL::Event::;
1286} 1349}
1287 1350
12881; 13511;
1289 1352
1290=head1 AUTHOR 1353=head1 AUTHOR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines