Class CUGL

    • Method Detail

      • ncuGraphicsGLRegisterBuffer

        public static int ncuGraphicsGLRegisterBuffer​(long pCudaResource,
                                                      int buffer,
                                                      int Flags)
        Unsafe version of: GraphicsGLRegisterBuffer
      • cuGraphicsGLRegisterBuffer

        public static int cuGraphicsGLRegisterBuffer​(org.lwjgl.PointerBuffer pCudaResource,
                                                     int buffer,
                                                     int Flags)
        Registers an OpenGL buffer object.

        Registers the buffer object specified by buffer for access by CUDA. A handle to the registered object is returned as pCudaResource. The register flags Flags specify the intended usage, as follows:

        • GRAPHICS_REGISTER_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA. This is the default value.
        • GRAPHICS_REGISTER_FLAGS_READ_ONLY: Specifies that CUDA will not write to this resource.
        • GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved.
        Parameters:
        pCudaResource - pointer to the returned object handle
        buffer - name of buffer object to be registered
        Flags - register flags
      • ncuGraphicsGLRegisterImage

        public static int ncuGraphicsGLRegisterImage​(long pCudaResource,
                                                     int image,
                                                     int target,
                                                     int Flags)
        Unsafe version of: GraphicsGLRegisterImage
      • cuGraphicsGLRegisterImage

        public static int cuGraphicsGLRegisterImage​(org.lwjgl.PointerBuffer pCudaResource,
                                                    int image,
                                                    int target,
                                                    int Flags)
        Register an OpenGL texture or renderbuffer object.

        Registers the texture or renderbuffer object specified by image for access by CUDA. A handle to the registered object is returned as pCudaResource.

        target must match the type of the object, and must be one of GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE, GL_TEXTURE_CUBE_MAP, GL_TEXTURE_3D, GL_TEXTURE_2D_ARRAY, or GL_RENDERBUFFER.

        The register flags Flags specify the intended usage, as follows:

        The following image formats are supported. For brevity's sake, the list is abbreviated. For ex., {GL_R, GL_RG} X {8, 16} would expand to the following 4 formats {GL_R8, GL_R16, GL_RG8, GL_RG16}:

        • GL_RED, GL_RG, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY
        • {GL_R, GL_RG, GL_RGBA} X {8, 16, 16F, 32F, 8UI, 16UI, 32UI, 8I, 16I, 32I}
        • {GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY} X {8, 16, 16F_ARB, 32F_ARB, 8UI_EXT, 16UI_EXT, 32UI_EXT, 8I_EXT, 16I_EXT, 32I_EXT}

        The following image classes are currently disallowed:

        • Textures with borders
        • Multisampled renderbuffers
        Parameters:
        pCudaResource - pointer to the returned object handle
        image - name of texture or renderbuffer object to be registered
        target - identifies the type of object specified by image
        Flags - register flags
      • ncuGLGetDevices

        public static int ncuGLGetDevices​(long pCudaDeviceCount,
                                          long pCudaDevices,
                                          int cudaDeviceCount,
                                          int deviceList)
        Unsafe version of: GLGetDevices
        Parameters:
        cudaDeviceCount - the size of the output device array pCudaDevices
      • cuGLGetDevices

        public static int cuGLGetDevices​(java.nio.IntBuffer pCudaDeviceCount,
                                         java.nio.IntBuffer pCudaDevices,
                                         int deviceList)
        Gets the CUDA devices associated with the current OpenGL context.

        Returns in *pCudaDeviceCount the number of CUDA-compatible devices corresponding to the current OpenGL context. Also returns in *pCudaDevices at most cudaDeviceCount of the CUDA-compatible devices corresponding to the current OpenGL context. If any of the GPUs being used by the current OpenGL context are not CUDA capable then the call will return CU.CUDA_ERROR_NO_DEVICE.

        The deviceList argument may be any of the following:

        • GL_DEVICE_LIST_ALL: Query all devices used by the current OpenGL context.
        • GL_DEVICE_LIST_CURRENT_FRAME: Query the devices used by the current OpenGL context to render the current frame (in SLI).
        • GL_DEVICE_LIST_NEXT_FRAME: Query the devices used by the current OpenGL context to render the next frame (in SLI). Note that this is a prediction, it can't be guaranteed that this is correct in all cases.
        Note

        This function is not supported on Mac OS X.

        Parameters:
        pCudaDeviceCount - returned number of CUDA devices
        pCudaDevices - returned CUDA devices
        deviceList - the set of devices to return
      • ncuGLCtxCreate

        public static int ncuGLCtxCreate​(long pCtx,
                                         int Flags,
                                         int device)
        Unsafe version of: GLCtxCreate
      • cuGLCtxCreate

        public static int cuGLCtxCreate​(org.lwjgl.PointerBuffer pCtx,
                                        int Flags,
                                        int device)
        Create a CUDA context for interoperability with OpenGL.

        Deprecated: This function is deprecated as of Cuda 5.0.

        This function is deprecated and should no longer be used. It is no longer necessary to associate a CUDA context with an OpenGL context in order to achieve maximum interoperability performance.

        Parameters:
        pCtx - returned CUDA context
        Flags - options for CUDA context creation
        device - device on which to create the context
      • cuGLInit

        public static int cuGLInit()
        Initializes OpenGL interoperability.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Initializes OpenGL interoperability. This function is deprecated and calling it is no longer required. It may fail if the needed OpenGL driver facilities are not available.

      • cuGLRegisterBufferObject

        public static int cuGLRegisterBufferObject​(int buffer)
        Registers an OpenGL buffer object.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Registers the buffer object specified by buffer for access by CUDA. This function must be called before CUDA can map the buffer object. There must be a valid OpenGL context bound to the current thread when this function is called, and the buffer name is resolved by that context.

        Parameters:
        buffer - the name of the buffer object to register
      • ncuGLMapBufferObject

        public static int ncuGLMapBufferObject​(long dptr,
                                               long size,
                                               int buffer)
        Unsafe version of: GLMapBufferObject
      • cuGLMapBufferObject

        public static int cuGLMapBufferObject​(org.lwjgl.PointerBuffer dptr,
                                              org.lwjgl.PointerBuffer size,
                                              int buffer)
        Maps an OpenGL buffer object.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Maps the buffer object specified by buffer into the address space of the current CUDA context and returns in *dptr and *size the base pointer and size of the resulting mapping.

        There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered.

        All streams in the current CUDA context are synchronized with the current GL context.

        Parameters:
        dptr - returned mapped base pointer
        size - returned size of mapping
        buffer - the name of the buffer object to map
      • cuGLUnmapBufferObject

        public static int cuGLUnmapBufferObject​(int buffer)
        Unmaps an OpenGL buffer object.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Unmaps the buffer object specified by buffer for access by CUDA.

        There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered.

        All streams in the current CUDA context are synchronized with the current GL context.

        Parameters:
        buffer - buffer object to unmap
      • cuGLUnregisterBufferObject

        public static int cuGLUnregisterBufferObject​(int buffer)
        Unregister an OpenGL buffer object.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Unregisters the buffer object specified by buffer. This releases any resources associated with the registered buffer. After this call, the buffer may no longer be mapped for access by CUDA.

        There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered.

        Parameters:
        buffer - name of the buffer object to unregister
      • cuGLSetBufferObjectMapFlags

        public static int cuGLSetBufferObjectMapFlags​(int buffer,
                                                      int Flags)
        Set the map flags for an OpenGL buffer object.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Sets the map flags for the buffer object specified by buffer.

        Changes to Flags will take effect the next time buffer is mapped. The Flags argument may be any of the following:

        • GL_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA kernels. This is the default value.
        • GL_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA kernels which access this resource will not write to this resource.
        • GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA kernels which access this resource will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved.

        If buffer has not been registered for use with CUDA, then CU.CUDA_ERROR_INVALID_HANDLE is returned. If buffer is presently mapped for access by CUDA, then CU.CUDA_ERROR_ALREADY_MAPPED is returned.

        There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered.

        Parameters:
        buffer - buffer object to unmap
        Flags - map flags
      • ncuGLMapBufferObjectAsync

        public static int ncuGLMapBufferObjectAsync​(long dptr,
                                                    long size,
                                                    int buffer,
                                                    long hStream)
        Unsafe version of: GLMapBufferObjectAsync
      • cuGLMapBufferObjectAsync

        public static int cuGLMapBufferObjectAsync​(org.lwjgl.PointerBuffer dptr,
                                                   org.lwjgl.PointerBuffer size,
                                                   int buffer,
                                                   long hStream)
        Maps an OpenGL buffer object.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Maps the buffer object specified by buffer into the address space of the current CUDA context and returns in *dptr and *size the base pointer and size of the resulting mapping.

        There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered.

        Stream hStream in the current CUDA context is synchronized with the current GL context.

        Parameters:
        dptr - returned mapped base pointer
        size - returned size of mapping
        buffer - the name of the buffer object to map
        hStream - stream to synchronize
      • cuGLUnmapBufferObjectAsync

        public static int cuGLUnmapBufferObjectAsync​(int buffer,
                                                     long hStream)
        Unmaps an OpenGL buffer object.

        Deprecated: This function is deprecated as of Cuda 3.0.

        Unmaps the buffer object specified by buffer for access by CUDA.

        There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered.

        Stream hStream in the current CUDA context is synchronized with the current GL context.

        Parameters:
        buffer - name of the buffer object to unmap
        hStream - stream to synchronize