Top Description Fields Constructors Methods
org.lwjgl.opencl

public Class AMDBusAddressableMemory

extends Object
Class Inheritance
Imports
javax.annotation.*, org.lwjgl.*, org.lwjgl.system.*

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

Modifier and TypeField and Description
public static final int
CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD

New command types for the events returned by the amd_bus_addressable_memory functions.

public static final int
CL_COMMAND_WAIT_SIGNAL_AMD

New command types for the events returned by the amd_bus_addressable_memory functions.

public static final int
CL_COMMAND_WRITE_SIGNAL_AMD

New command types for the events returned by the amd_bus_addressable_memory functions.

public static final int
CL_MEM_BUS_ADDRESSABLE_AMD

Accepted by the flags parameter of CreateBuffer.

public static final int
CL_MEM_EXTERNAL_PHYSICAL_AMD

Accepted by the flags parameter of CreateBuffer.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int

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.
clEnqueueMakeBuffersResidentAMD
(long
a command-queue
command_queue
,
PointerBuffer
a pointer to a list of memory objects created with MEM_BUS_ADDRESSABLE_AMD flag
mem_objects
,
boolean
indicates if read operation is blocking or non-blocking
blocking_make_resident
,
CLBusAddressAMD.Buffer
a pointer to a list of CLBusAddressAMD structures
bus_addresses
,
PointerBuffer
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_wait_list
,
PointerBuffer
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.
event
)

The application requires the bus address in order to access the buffers from a remote device.

public static int

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).
clEnqueueWaitSignalAMD
(long
a command-queue
command_queue
,
long
a memory object
mem_object
,
int
the signal value
value
,
PointerBuffer
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_wait_list
,
PointerBuffer
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.
event
)

Instructs the OpenCL to wait until value is written to buffer before issuing the next command.

public static int

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).
clEnqueueWriteSignalAMD
(long
a command-queue
command_queue
,
long
a memory object
mem_object
,
int
the signal value
value
,
long
the write offset
offset
,
PointerBuffer
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_wait_list
,
PointerBuffer
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.
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).

public static int
nclEnqueueMakeBuffersResidentAMD(long command_queue, int
the number of memory objects in mem_objects
num_mem_objs
,
long mem_objects, int blocking_make_resident, long bus_addresses, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueMakeBuffersResidentAMD

public static int
nclEnqueueWaitSignalAMD(long command_queue, long mem_object, int value, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueWaitSignalAMD

public static int
nclEnqueueWriteSignalAMD(long command_queue, long mem_object, int value, long offset, int
the number of events in event_wait_list
num_events_in_wait_list
,
long event_wait_list, long event)

Unsafe version of: EnqueueWriteSignalAMD

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMDback to summary
public static final int CL_COMMAND_MAKE_BUFFERS_RESIDENT_AMD

New command types for the events returned by the amd_bus_addressable_memory functions.

CL_COMMAND_WAIT_SIGNAL_AMDback to summary
public static final int CL_COMMAND_WAIT_SIGNAL_AMD

New command types for the events returned by the amd_bus_addressable_memory functions.

CL_COMMAND_WRITE_SIGNAL_AMDback to summary
public static final int CL_COMMAND_WRITE_SIGNAL_AMD

New command types for the events returned by the amd_bus_addressable_memory functions.

CL_MEM_BUS_ADDRESSABLE_AMDback to summary
public static final int CL_MEM_BUS_ADDRESSABLE_AMD

Accepted by the flags parameter of CreateBuffer.

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 and MEM_USE_HOST_PTR are mutually exclusive.

CL_MEM_EXTERNAL_PHYSICAL_AMDback to summary
public static final int CL_MEM_EXTERNAL_PHYSICAL_AMD

Accepted by the flags parameter of CreateBuffer.

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 and MEM_USE_HOST_PTR are mutually exclusive.

MEM_EXTERNAL_PHYSICAL_AMD, MEM_READ_WRITE and MEM_READ_ONLY are mutually exclusive.

Constructor Detail

AMDBusAddressableMemoryback to summary
protected AMDBusAddressableMemory()

Method Detail

clEnqueueMakeBuffersResidentAMDback to summary
public static int clEnqueueMakeBuffersResidentAMD(long command_queue, PointerBuffer mem_objects, boolean 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:long

a command-queue

mem_objects:PointerBuffer

a pointer to a list of memory objects created with MEM_BUS_ADDRESSABLE_AMD flag

blocking_make_resident:boolean

indicates if read operation is blocking or non-blocking

bus_addresses:CLBusAddressAMD.Buffer

a pointer to a list of CLBusAddressAMD structures

event_wait_list:PointerBuffer

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:PointerBuffer

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:int

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.
Annotations
@NativeType:cl_int
clEnqueueWaitSignalAMDback to summary
public static int clEnqueueWaitSignalAMD(long command_queue, long mem_object, int value, PointerBuffer event_wait_list, PointerBuffer event)

Instructs the OpenCL to wait until value is written to buffer before issuing the next command.

Parameters
command_queue:long

a command-queue

mem_object:long

a memory object

value:int

the signal value

event_wait_list:PointerBuffer

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:PointerBuffer

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:int

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).
Annotations
@NativeType:cl_int
clEnqueueWriteSignalAMDback to summary
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 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:long

a command-queue

mem_object:long

a memory object

value:int

the signal value

offset:long

the write offset

event_wait_list:PointerBuffer

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:PointerBuffer

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:int

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).
Annotations
@NativeType:cl_int
nclEnqueueMakeBuffersResidentAMDback to summary
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:int

the number of memory objects in mem_objects

num_events_in_wait_list:int

the number of events in event_wait_list

nclEnqueueWaitSignalAMDback to summary
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:int

the number of events in event_wait_list

nclEnqueueWriteSignalAMDback to summary
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:int

the number of events in event_wait_list