Class AMDBusAddressableMemory
- java.lang.Object
-
- org.lwjgl.opencl.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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CL_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 int
CL_MEM_BUS_ADDRESSABLE_AMD
CL_MEM_EXTERNAL_PHYSICAL_AMDAccepted by theflags
parameter ofCreateBuffer
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
clEnqueueMakeBuffersResidentAMD(long command_queue, org.lwjgl.PointerBuffer mem_objects, boolean blocking_make_resident, CLBusAddressAMD.Buffer bus_addresses, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)
The application requires the bus address in order to access the buffers from a remote device.static int
clEnqueueWaitSignalAMD(long command_queue, long mem_object, int value, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)
Instructs the OpenCL to wait untilvalue
is written tobuffer
before issuing the next command.static int
clEnqueueWriteSignalAMD(long command_queue, long mem_object, int value, long offset, org.lwjgl.PointerBuffer event_wait_list, org.lwjgl.PointerBuffer event)
This command instructs the OpenCL to writevalue
to the signal address +offset
ofbuffer
(which must be a buffer created withMEM_EXTERNAL_PHYSICAL_AMD
).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)
Unsafe version of:EnqueueMakeBuffersResidentAMD
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
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
-
-
-
Field Detail
-
CL_MEM_BUS_ADDRESSABLE_AMD
Accepted by theflags
parameter 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_PTR
andMEM_USE_HOST_PTR
are mutually exclusive.
-
CL_MEM_EXTERNAL_PHYSICAL_AMD
Accepted by theflags
parameter 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_PTR
andMEM_USE_HOST_PTR
are mutually exclusive.MEM_EXTERNAL_PHYSICAL_AMD
,MEM_READ_WRITE
andMEM_READ_ONLY
are mutually exclusive.
-
CL_COMMAND_WAIT_SIGNAL_AMD, CL_COMMAND_WRITE_SIGNAL_AMD, CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD
New command types for the events returned by the amd_bus_addressable_memory functions.
-
-
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 inevent_wait_list
-
clEnqueueWaitSignalAMD
public static int clEnqueueWaitSignalAMD(long command_queue, long mem_object, int value, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event)
Instructs the OpenCL to wait untilvalue
is written tobuffer
before 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_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_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 beNULL
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 theevent_wait_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_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 thebuffer
parameter of clEnqueueWaitSignalAMD is not a valid buffer.INVALID_COMMAND_QUEUE
is generated if thecommand_queue
parameter of clEnqueueWaitSignalAMD is not a valid command queue.INVALID_MEM_OBJECT
is generated if thebuffer
parameter of clEnqueueWaitSignalAMD does not represent a buffer allocated withMEM_BUS_ADDRESSABLE_AMD
.INVALID_VALUE
is generated if the signal address used by clEnqueueWaitSignalAMD ofbufffer
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 inevent_wait_list
-
clEnqueueWriteSignalAMD
public static int clEnqueueWriteSignalAMD(long command_queue, long mem_object, int value, long offset, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.PointerBuffer event)
This command instructs the OpenCL to writevalue
to the signal address +offset
ofbuffer
(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_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_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 beNULL
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 theevent_wait_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_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 thebuffer
parameter of clEnqueueWriteSignalAMD is not a valid buffer.INVALID_COMMAND_QUEUE
is generated if thecommand_queue
parameter of clEnqueueWriteSignalAMD is not a valid command queue.INVALID_MEM_OBJECT
is generated if thebuffer
parameter of clEnqueueWriteSignalAMD does not represent a buffer defined asMEM_EXTERNAL_PHYSICAL_AMD
.INVALID_BUFFER_SIZE
is generated if theoffset
parameter of clEnqueueWriteSignalAMD would lead to a write beyond the size ofbuffer
.INVALID_VALUE
is generated if the signal address used by clEnqueueWriteSignalAMD ofbufffer
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)
Unsafe version of:EnqueueMakeBuffersResidentAMD
- Parameters:
num_mem_objs
- the number of memory objects inmem_objects
num_events_in_wait_list
- the number of events inevent_wait_list
-
clEnqueueMakeBuffersResidentAMD
public static int clEnqueueMakeBuffersResidentAMD(long command_queue, org.lwjgl.PointerBuffer mem_objects, boolean blocking_make_resident, CLBusAddressAMD.Buffer bus_addresses, @Nullable org.lwjgl.PointerBuffer event_wait_list, @Nullable org.lwjgl.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_AMD
flagblocking_make_resident
- indicates if read operation is blocking or non-blockingbus_addresses
- a pointer to a list ofCLBusAddressAMD
structuresevent_wait_list
- a list of events that need to complete before this particular command can be executed. Ifevent_wait_list
isNULL
, then this particular command does not wait on any event to complete. The events specified inevent_wait_list
act as synchronization points. The context associated with events inevent_wait_list
andcommand_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 beNULL
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 theevent_wait_list
and theevent
arguments are notNULL
, the event argument should not refer to an element of theevent_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 areNULL
(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 withMEM_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.
-
-