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

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.31 by root, Mon Apr 16 06:39:54 2012 UTC vs.
Revision 1.36 by root, Thu Apr 19 14:34:56 2012 UTC

271 ulong IV - Q 271 ulong IV - Q
272 float NV float f 272 float NV float f
273 half IV ushort S 273 half IV ushort S
274 double NV double d 274 double NV double d
275 275
276=head2 GLX SUPPORT
277
278Due to the sad state that OpenGL support is in in Perl (mostly the OpenGL
279module, which has little to no documentation and has little to no support
280for glx), this module, as a special extension, treats context creation
281properties C<OpenCL::GLX_DISPLAY_KHR> and C<OpenCL::GL_CONTEXT_KHR>
282specially: If either or both of these are C<undef>, then the OpenCL
283module tries to dynamically resolve C<glxGetCurrentDisplay> and
284C<glxGetCurrentContext>, call these functions and use their return values
285instead.
286
287For this to work, the OpenGL library must be loaded, a GLX context must
288have been created and be made current, and C<dlsym> must be available and
289capable of finding the function via C<RTLD_DEFAULT>.
290
276=head2 THE OpenCL PACKAGE 291=head2 THE OpenCL PACKAGE
277 292
278=over 4 293=over 4
279 294
280=item $int = OpenCL::errno 295=item $int = OpenCL::errno
692Creates a new OpenCL::Image3D object and optionally initialises it with 707Creates a new OpenCL::Image3D object and optionally initialises it with
693the given data values. 708the given data values.
694 709
695L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html> 710L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateImage3D.html>
696 711
712=item $buffer = $ctx->gl_buffer ($flags, $bufobj)
713
714Creates a new OpenCL::Buffer (actually OpenCL::BufferObj) object that refers to the given
715OpenGL buffer object.
716
717http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLBuffer.html
718
719=item $ctx->gl_texture2d ($flags, $target, $miplevel, $texture)
720
721Creates a new OpenCL::Image2D object that refers to the given OpenGL
7222D texture object.
723
724http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLTexture2D.html
725
726=item $ctx->gl_texture3d ($flags, $target, $miplevel, $texture)
727
728Creates a new OpenCL::Image3D object that refers to the given OpenGL
7293D texture object.
730
731http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLTexture3D.html
732
733=item $ctx->gl_renderbuffer ($flags, $renderbuffer)
734
735Creates a new OpenCL::Image2D object that refers to the given OpenGL
736render buffer.
737
738http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateFromGLRenderbuffer.html
739
697=item @formats = $ctx->supported_image_formats ($flags, $image_type) 740=item @formats = $ctx->supported_image_formats ($flags, $image_type)
698 741
699Returns a list of matching image formats - each format is an arrayref with 742Returns a list of matching image formats - each format is an arrayref with
700two values, $channel_order and $channel_type, in it. 743two values, $channel_order and $channel_type, in it.
701 744
831reference to an array of local work sizes, with the same number of 874reference to an array of local work sizes, with the same number of
832elements as @$global_work_size. 875elements as @$global_work_size.
833 876
834L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueNDRangeKernel.html> 877L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueNDRangeKernel.html>
835 878
836=item $ev = $queue->enqueue_marker 879=item $ev = $queue->enqueue_marker ($wait_events...)
837 880
838L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueMarker.html> 881L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueMarker.html>
882
883=item $ev = $queue->enqueue_acquire_gl_objects ([object, ...], $wait_events...)
884
885Enqueues a list (an array-ref of OpenCL::Memory objects) to be acquired
886for subsequent OpenCL usage.
887
888L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueAcquireGLObjects.html>
889
890=item $ev = $queue->enqueue_release_gl_objects ([object, ...], $wait_events...)
891
892Enqueues a list (an array-ref of OpenCL::Memory objects) to be released
893for subsequent OpenGL usage.
894
895L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueReleaseGLObjects.html>
839 896
840=item $ev = $queue->enqueue_wait_for_events ($wait_events...) 897=item $ev = $queue->enqueue_wait_for_events ($wait_events...)
841 898
842L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWaitForEvents.html> 899L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueWaitForEvents.html>
843 900
931=item $int = $mem->offset 988=item $int = $mem->offset
932 989
933Calls C<clGetMemObjectInfo> with C<CL_MEM_OFFSET> and returns the result. 990Calls C<clGetMemObjectInfo> with C<CL_MEM_OFFSET> and returns the result.
934 991
935=for gengetinfo end mem 992=for gengetinfo end mem
993
994=item ($type, $name) = $mem->gl_object_info
995
996Returns the OpenGL object type (e.g. OpenCL::GL_OBJECT_TEXTURE2D) and the
997object "name" (e.g. the texture name) used to create this memory object.
998
999L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clGetGLObjectInfo.html>
936 1000
937=back 1001=back
938 1002
939=head2 THE OpenCL::Buffer CLASS 1003=head2 THE OpenCL::Buffer CLASS
940 1004
999=item $int = $image->depth 1063=item $int = $image->depth
1000 1064
1001Calls C<clGetImageInfo> with C<CL_IMAGE_DEPTH> and returns the result. 1065Calls C<clGetImageInfo> with C<CL_IMAGE_DEPTH> and returns the result.
1002 1066
1003=for gengetinfo end image 1067=for gengetinfo end image
1068
1069=for gengetinfo begin gl_texture
1070
1071=item $GLenum = $gl_texture->target
1072
1073Calls C<clGetGlTextureInfo> with C<CL_GL_TEXTURE_TARGET> and returns the result.
1074
1075=item $GLint = $gl_texture->gl_mipmap_level
1076
1077Calls C<clGetGlTextureInfo> with C<CL_GL_MIPMAP_LEVEL> and returns the result.
1078
1079=for gengetinfo end gl_texture
1004 1080
1005=back 1081=back
1006 1082
1007=head2 THE OpenCL::Sampler CLASS 1083=head2 THE OpenCL::Sampler CLASS
1008 1084

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines