Hi Tomasz,

I've committed your patch, with a few changes.

git diff 69a355d0 master

will show you what I changed. Some comments below. I'd appreciate your
feedback on my changes.

Thanks for your contribution,
Andreas

On Wed, 24 Nov 2010 23:58:01 +0100, Tomasz Rybak <bogom...@post.pl> wrote:
> Sending patch once again - it looks line not everyone received
> previous email, and I got no feedback on patch.
> 
> -- 
> Tomasz Rybak <bogom...@post.pl> GPG/PGP key ID: 2AD5 9860
> Fingerprint A481 824E 7DD3 9C0E C40A  488E C654 FB33 2AD5 9860
> http://member.acm.org/~tomaszrybak
> diff --git a/doc/source/gl.rst b/doc/source/gl.rst
> index e5d196f..6d7b42c 100644
> --- a/doc/source/gl.rst
> +++ b/doc/source/gl.rst
> @@ -19,6 +19,8 @@ GL Interoperability
>  
>      .. warning ::
>  
> +        This function is deprecated since CUDA 3.0 and PyCUDA 0.95.
> +
>          This will fail with a rather unhelpful error message if you don't 
> already 
>          have a GL context created and active.
>  
> @@ -33,11 +35,43 @@ GL Interoperability
>          This will fail with a rather unhelpful error message if you don't 
> already 
>          have a GL context created and active.
>  
> +.. class :: map_flags
> +
> +    Usage of OpenGL object from CUDA.
> +
> +    .. attribute :: CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE
> +
> +        Read and write access to mapped OpenGL object from CUDA code.
> +
> +    .. attribute :: CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY
> +
> +        Read only access to mapped OpenGL object from CUDA code.
> +
> +    .. attribute :: CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD
> +
> +        Write only access to mapped OpenGL object from CUDA code. Reading
> +        is prohibited.

Changed/shortened names.

> +
> +.. class :: map_targets
> +
> +    Type of OpenGL Image object that is mapped to CUDA.
> +
> +    .. attribute :: GL_TEXTURE_2D
> +    .. attribute :: GL_TEXTURE_RECTANGLE
> +    .. attribute :: GL_TEXTURE_CUBE_MAP
> +    .. attribute :: GL_TEXTURE_3D
> +    .. attribute :: GL_TEXTURE_2D_ARRAY
> +    .. attribute :: GL_RENDERBUFFER
> +

I'd argue these are the GL wrapper's business, since they're defined in
the GL header. Removed.

>  .. class :: BufferObject(bufobj)
>  
>      .. method :: unregister()
>      .. method :: handle()
>      .. method :: map()
> +
> +    .. warning ::
> +
> +        This class is deprecated since CUDA 3.0 and PyCUDA 0.95.
>      

I've made a nice separate section for the old-style API in the docs, so
no-one uses it by accident.

>  .. class :: BufferObjectMapping
>  
> @@ -45,6 +79,33 @@ GL Interoperability
>      .. method :: device_ptr()
>      .. method :: size()
>  
> +    .. warning ::
> +
> +        This class is deprecated since CUDA 3.0 and PyCUDA 0.95.
> +
> +.. class :: RegisteredBuffer(bufobj, flags = 
> CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE)
> +
> +  Object managing mapping of OpenGL buffers to CUDA. Cannot be used to
> +  map images.
> +
> +    .. method :: unregister()
> +    .. method :: handle()
> +    .. method :: map()
> +    
> +.. class :: RegisteredImage(bufobj, target, flags = 
> CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE)
> +
> +  Object managing mapping of OpenGL textures and render buffers to CUDA.
> +
> +    .. method :: unregister()
> +    .. method :: handle()
> +    .. method :: map()
> +    
> +.. class :: RegisteredMapping
> +
> +    .. method :: unmap()
> +    .. method :: device_ptr()
> +    .. method :: size()
> +

Renamed handle() -> gl_handle() for clarity. Added stream arguments to
map()/unmap(). Since Nvidia saw it fit to have a batch interface to
map/unmap, we might need one at some point, too.


Attachment: pgp4C2Uxb0GNm.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to