Class AMDBusAddressableMemory
- java.lang.Object
-
- org.lwjgl.opencl.AMDBusAddressableMemory
-
public class AMDBusAddressableMemory extends java.lang.ObjectNative 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.
-
-
Field Summary
Fields Modifier and Type Field and Description static intCL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD
CL_COMMAND_WAIT_SIGNAL_AMD
CL_COMMAND_WRITE_SIGNAL_AMDNew command types for the events returned by the amd_bus_addressable_memory functions.static intCL_MEM_BUS_ADDRESSABLE_AMD
CL_MEM_EXTERNAL_PHYSICAL_AMDAccepted by theflagsparameter ofCreateBuffer.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static intclEnqueueMakeBuffersResidentAMD(long command_queue, PointerBuffer mem_objects, int blocking_make_resident, CLBusAddressAMD.Buffer bus_addresses, PointerBuffer event_wait_list, PointerBuffer event)The application requires the bus address in order to access the buffers from a remote device.static intclEnqueueWaitSignalAMD(long command_queue, long mem_object, int value, PointerBuffer event_wait_list, PointerBuffer event)Instructs the OpenCL to wait untilvalueis written tobufferbefore issuing the next command.static intclEnqueueWriteSignalAMD(long command_queue, long mem_object, int value, long offset, PointerBuffer event_wait_list, PointerBuffer event)This command instructs the OpenCL to writevalueto the signal address +offsetofbuffer(which must be a buffer created withMEM_EXTERNAL_PHYSICAL_AMD).
-
-
-
Field Detail
-
CL_MEM_BUS_ADDRESSABLE_AMD
public static final int CL_MEM_BUS_ADDRESSABLE_AMD
Accepted by theflagsparameter ofCreateBuffer.This flag specifies that the application wants the OpenCL implementation to create a buffer that can be accessed by remote device DMA.
MEM_BUS_ADDRESSABLE_AMD,MEM_ALLOC_HOST_PTRandMEM_USE_HOST_PTRare mutually exclusive.- See Also:
- Constant Field Values
-
CL_MEM_EXTERNAL_PHYSICAL_AMD
public static final int CL_MEM_EXTERNAL_PHYSICAL_AMD
Accepted by theflagsparameter ofCreateBuffer.This flag specifies that the application wants the OpenCL implementation to create a buffer from an already allocated memory on remote device.
MEM_EXTERNAL_PHYSICAL_AMD,MEM_ALLOC_HOST_PTR,MEM_COPY_HOST_PTRandMEM_USE_HOST_PTRare mutually exclusive.MEM_EXTERNAL_PHYSICAL_AMD,MEM_READ_WRITEandMEM_READ_ONLYare mutually exclusive.- See Also:
- Constant Field Values
-
CL_COMMAND_WAIT_SIGNAL_AMD
public static final int CL_COMMAND_WAIT_SIGNAL_AMD
New command types for the events returned by the amd_bus_addressable_memory functions.- See Also:
- Constant Field Values
-
CL_COMMAND_WRITE_SIGNAL_AMD
public static final int CL_COMMAND_WRITE_SIGNAL_AMD
New command types for the events returned by the amd_bus_addressable_memory functions.- See Also:
- Constant Field Values
-
CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD
public static final int CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD
New command types for the events returned by the amd_bus_addressable_memory functions.- See Also:
- Constant Field Values
-
-
Method Detail
-
clEnqueueWaitSignalAMD
public static int clEnqueueWaitSignalAMD(long command_queue, long mem_object, int value, PointerBuffer event_wait_list, PointerBuffer event)Instructs the OpenCL to wait untilvalueis written tobufferbefore issuing the next command.- Parameters:
command_queue- a command-queuemem_object- a memory objectvalue- the signal valueevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust 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.eventcan beNULLin 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 theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.- Returns:
SUCCESSif the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_MEM_OBJECTis generated if thebufferparameter of clEnqueueWaitSignalAMD is not a valid buffer.INVALID_COMMAND_QUEUEis generated if thecommand_queueparameter of clEnqueueWaitSignalAMD is not a valid command queue.INVALID_MEM_OBJECTis generated if thebufferparameter of clEnqueueWaitSignalAMD does not represent a buffer allocated withMEM_BUS_ADDRESSABLE_AMD.INVALID_VALUEis generated if the signal address used by clEnqueueWaitSignalAMD ofbuffferis invalid (for example 0).
-
clEnqueueWriteSignalAMD
public static int clEnqueueWriteSignalAMD(long command_queue, long mem_object, int value, long offset, PointerBuffer event_wait_list, PointerBuffer event)This command instructs the OpenCL to writevalueto the signal address +offsetofbuffer(which must be a buffer created withMEM_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-queuemem_object- a memory objectvalue- the signal valueoffset- the write offsetevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust 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.eventcan beNULLin 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 theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.- Returns:
SUCCESSif the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_MEM_OBJECTis generated if thebufferparameter of clEnqueueWriteSignalAMD is not a valid buffer.INVALID_COMMAND_QUEUEis generated if thecommand_queueparameter of clEnqueueWriteSignalAMD is not a valid command queue.INVALID_MEM_OBJECTis generated if thebufferparameter of clEnqueueWriteSignalAMD does not represent a buffer defined asMEM_EXTERNAL_PHYSICAL_AMD.INVALID_BUFFER_SIZEis generated if theoffsetparameter of clEnqueueWriteSignalAMD would lead to a write beyond the size ofbuffer.INVALID_VALUEis generated if the signal address used by clEnqueueWriteSignalAMD ofbuffferis invalid (for example 0).
-
clEnqueueMakeBuffersResidentAMD
public static int clEnqueueMakeBuffersResidentAMD(long command_queue, PointerBuffer mem_objects, int blocking_make_resident, CLBusAddressAMD.Buffer bus_addresses, PointerBuffer event_wait_list, 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-queuemem_objects- a pointer to a list of memory objects created withMEM_BUS_ADDRESSABLE_AMDflagblocking_make_resident- indicates if read operation is blocking or non-blockingbus_addresses- a pointer to a list ofCLBusAddressAMDstructuresevent_wait_list- a list of events that need to complete before this particular command can be executed. Ifevent_wait_listisNULL, then this particular command does not wait on any event to complete. The events specified inevent_wait_listact as synchronization points. The context associated with events inevent_wait_listandcommand_queuemust 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.eventcan beNULLin 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 theevent_wait_listand theeventarguments are notNULL, the event argument should not refer to an element of theevent_wait_listarray.- Returns:
SUCCESSif the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_OPERATIONis generated if any of the pointer parameters of clEnqueueMakeBuffersResidentAMD areNULL(and count is > 0).INVALID_OPERATIONis generated if any of the mem_objects passed to clEnqueueMakeBuffersResidentAMD was not a valid cl_mem object created withMEM_BUS_ADDRESSABLE_AMDflag.OUT_OF_HOST_MEMORYis 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.
-
-