Radeon Pro Solid State Graphics Api User Manual - page 8
Rev. 1.01
8
synchronization points, and the contexts associated with events in event_wait_list and command_queue
must be the same. Memory associated with event_wait_list can be reused or freed-up after the function
returns.
event
[out, optional]
Returns an event object that identifies the clEnqueueWriteSsgFileAMD command and can query or queue
a wait for this command to finish executing. The event argument can be NULL, in which case the
application will be unable to query the command status or queue a wait for the command to finish. Unless
the event_wait_list and event arguments are NULL, the event argument should avoid referring to an
element of the event_wait_list array.
Return Value
Description
CL_SUCCESS
The function executed successfully.
CL_INVALID_FILE_OBJECT_AMD The file is invalid for OpenCL.
CL_INVALID_COMMAND_QUEUE Command_queue is an invalid host command queue.
CL_INVALID_CONTEXT
The contexts associated with command_queue and buffer are
different, or the contexts associated with command_queue and the
events in event_wait_list are different.
CL_INVALID_MEM_OBJECT
The buffer object is invalid.
CL_INVALID_VALUE
The region specified by buffer_offset, file_offset or size is out of
bounds or misaligned with CL_FILE_BLOCK_SIZE_AMD.
CL_INVALID_EVENT_WAIT_LIST Either event_wait_list is NULL and num_events_in_wait_list is greater
than 0, event_wait_list is not NULL and num_events_in_wait_list is 0,
or event objects in event_wait_list are invalid.
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
Write operations are blocking and the execution status of at least one
event in event_wait_list is a negative integer value.
CL_MEM_OBJECT_ALLOCATION_FAILURE
Memory failed to allocate for data store associated with buffer.
4 OpenCL Performance Guidelines and Caveats
The following guidelines and caveats will optimize for the greatest performance from OpenCL.
•
For best performance, create the target resources with the flag
CL_MEM_USE_PERSISTENT_MEM_AMD.
•
Because of OS limitations, persistent memory must be referenced by the GPU once before it
truly becomes resident in GPU memory. A one-time performance drop may be experienced the
first time the buffer is used as a file-transfer target if the GPU has yet to access the resource.
Clear the buffer using clEnqueueFillBuffer to generate such a reference.
•
The persistent-memory heap available to all applications is 128 MB. If the heap is entirely
consumed, the run time will silently fall back to standard allocations. If the data set is larger than
100 MB, the application should employ the persistent-memory allocation as a staging buffer and