Class AMDBusAddressableMemory


  • public class AMDBusAddressableMemory
    extends java.lang.Object
    Native bindings to the amd_bus_addressable_memory extension.

    This extension defines an API that allows improved control of the physical memory used by the graphics device.

    It allows to share a memory allocated by the Graphics driver to be used by other device on the bus by exposing a write-only bus address. One example of application would be a video capture device which would DMA into the GPU memory.

    It also offers the reverse operation of specifying a buffer allocated on another device to be used for write access by the GPU.

    • Method Detail

      • nclEnqueueWaitSignalAMD

        public static int nclEnqueueWaitSignalAMD​(long command_queue,
                                                  long mem_object,
                                                  int value,
                                                  int num_events_in_wait_list,
                                                  long event_wait_list,
                                                  long event)
        Unsafe version of: EnqueueWaitSignalAMD
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueWaitSignalAMD

        public static int clEnqueueWaitSignalAMD​(long command_queue,
                                                 long mem_object,
                                                 int value,
                                                 @Nullable
                                                 PointerBuffer event_wait_list,
                                                 @Nullable
                                                 PointerBuffer event)
        Instructs the OpenCL to wait until value is written to buffer before issuing the next command.
        Parameters:
        command_queue - a command-queue
        mem_object - a memory object
        value - the signal value
        event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
        event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_MEM_OBJECT is generated if the buffer parameter of clEnqueueWaitSignalAMD is not a valid buffer.
        • INVALID_COMMAND_QUEUE is generated if the command_queue parameter of clEnqueueWaitSignalAMD is not a valid command queue.
        • INVALID_MEM_OBJECT is generated if the buffer parameter of clEnqueueWaitSignalAMD does not represent a buffer allocated with MEM_BUS_ADDRESSABLE_AMD.
        • INVALID_VALUE is generated if the signal address used by clEnqueueWaitSignalAMD of bufffer is invalid (for example 0).
      • nclEnqueueWriteSignalAMD

        public static int nclEnqueueWriteSignalAMD​(long command_queue,
                                                   long mem_object,
                                                   int value,
                                                   long offset,
                                                   int num_events_in_wait_list,
                                                   long event_wait_list,
                                                   long event)
        Unsafe version of: EnqueueWriteSignalAMD
        Parameters:
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueWriteSignalAMD

        public static int clEnqueueWriteSignalAMD​(long command_queue,
                                                  long mem_object,
                                                  int value,
                                                  long offset,
                                                  @Nullable
                                                  PointerBuffer event_wait_list,
                                                  @Nullable
                                                  PointerBuffer event)
        This command instructs the OpenCL to write value to the signal address + offset of buffer (which must be a buffer created with MEM_EXTERNAL_PHYSICAL_AMD). This should be done after a write operation by the device into that buffer is complete. Consecutive marker values must keep increasing.
        Parameters:
        command_queue - a command-queue
        mem_object - a memory object
        value - the signal value
        offset - the write offset
        event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
        event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_MEM_OBJECT is generated if the buffer parameter of clEnqueueWriteSignalAMD is not a valid buffer.
        • INVALID_COMMAND_QUEUE is generated if the command_queue parameter of clEnqueueWriteSignalAMD is not a valid command queue.
        • INVALID_MEM_OBJECT is generated if the buffer parameter of clEnqueueWriteSignalAMD does not represent a buffer defined as MEM_EXTERNAL_PHYSICAL_AMD.
        • INVALID_BUFFER_SIZE is generated if the offset parameter of clEnqueueWriteSignalAMD would lead to a write beyond the size of buffer.
        • INVALID_VALUE is generated if the signal address used by clEnqueueWriteSignalAMD of bufffer is invalid (for example 0).
      • nclEnqueueMakeBuffersResidentAMD

        public static int nclEnqueueMakeBuffersResidentAMD​(long command_queue,
                                                           int num_mem_objs,
                                                           long mem_objects,
                                                           int blocking_make_resident,
                                                           long bus_addresses,
                                                           int num_events_in_wait_list,
                                                           long event_wait_list,
                                                           long event)
        Parameters:
        num_mem_objs - the number of memory objects in mem_objects
        num_events_in_wait_list - the number of events in event_wait_list
      • clEnqueueMakeBuffersResidentAMD

        public static int clEnqueueMakeBuffersResidentAMD​(long command_queue,
                                                          PointerBuffer mem_objects,
                                                          boolean blocking_make_resident,
                                                          CLBusAddressAMD.Buffer bus_addresses,
                                                          @Nullable
                                                          PointerBuffer event_wait_list,
                                                          @Nullable
                                                          PointerBuffer event)
        The application requires the bus address in order to access the buffers from a remote device. As the OS may rearrange buffers to make space for other memory allocation, we must make the buffers resident before trying to access them on remote device.

        This function is used to make buffers resident.

        Parameters:
        command_queue - a command-queue
        mem_objects - a pointer to a list of memory objects created with MEM_BUS_ADDRESSABLE_AMD flag
        blocking_make_resident - indicates if read operation is blocking or non-blocking
        bus_addresses - a pointer to a list of CLBusAddressAMD structures
        event_wait_list - a list of events that need to complete before this particular command can be executed. If event_wait_list is NULL, then this particular command does not wait on any event to complete. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same.
        event - Returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. event can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. If the event_wait_list and the event arguments are not NULL, the event argument should not refer to an element of the event_wait_list array.
        Returns:
        SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
        • INVALID_OPERATION is generated if any of the pointer parameters of clEnqueueMakeBuffersResidentAMD are NULL (and count is > 0).
        • INVALID_OPERATION is generated if any of the mem_objects passed to clEnqueueMakeBuffersResidentAMD was not a valid cl_mem object created with MEM_BUS_ADDRESSABLE_AMD flag.
        • OUT_OF_HOST_MEMORY is generated if any of the mem_objects passed to clEnqueueMakeBuffersResidentAMD could not be made resident so that the buffer or signal bus addresses will be returned as 0.