-
-
Save fltermare/9177074 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void * clSVMAlloc (cl_context context, cl_svm_mem_flags flags, size_t size, unsigned int alignment) { | |
// flgs <- flags (some trnasform) | |
return clCreateBuffer (context, flags, size, NULL, NULL); | |
} | |
// ? | |
void clSVMFree (cl_context context, void * svm_pointer); | |
// ? | |
cl_int clEnqueueSVMFree (...); | |
// enqueues a command to do a memcpy operation. | |
cl_int clEnqueueSVMMemcpy (cl_command_queue command_queue, | |
cl_bool blocking_copy, | |
void *dst_ptr, | |
const void *src_ptr, | |
size_t size, | |
cl_uint num_events_in_wait_list, | |
const cl_event *event_wait_list, | |
cl_event *event) { | |
// enqueues a command to copy a buffer object identified by src_buffer to another buffer object identified by dst_buffer. | |
cl_int clEnqueueCopyBuffer (cl_command_queue command_queue, | |
cl_mem src_buffer, | |
cl_mem dst_buffer, | |
size_t src_offset, | |
size_t dst_offset, | |
size_t size, | |
cl_uint num_events_in_wait_list, | |
const cl_event *event_wait_list, | |
cl_event *event) | |
} | |
// enqueues a command to fill a region in memory with a pattern of a given pattern size. | |
cl_int clEnqueueSVMMemFill (cl_command_queue command_queue, | |
void *svm_ptr, | |
const void *pattern, | |
size_t pattern_size, | |
size_t size, | |
cl_uint num_events_in_wait_list, | |
const cl_event *event_wait_list, | |
cl_event *event) { | |
// enqueues a command to fill a buffer object with a pattern of a given pattern size. | |
cl_int clEnqueueFillBuffer (cl_command_queue command_queue, | |
cl_mem buffer, | |
const void *pattern, | |
size_t pattern_size, | |
size_t offset, | |
size_t size, | |
cl_uint num_events_in_wait_list, | |
const cl_event *event_wait_list, | |
cl_event *event) | |
} | |
// enqueues a command that will allow the host to update a region of a SVM buffer. | |
// Note that since we are enqueuing a command with a SVM buffer, the region is already mapped in the host address space. | |
cl_int clEnqueueSVMMap (cl_command_queue command_queue, | |
cl_bool blocking_map, | |
cl_map_flags map_flags, | |
void *svm_ptr, | |
size_t size, | |
cl_uint num_events_in_wait_list, | |
const cl_event *event_wait_list, | |
cl_event *event) { | |
// enqueues a command to map a region of the buffer object given by buffer into the | |
// host address space and returns a pointer to this mapped region. | |
void * clEnqueueMapBuffer (cl_command_queue command_queue, | |
cl_mem buffer, | |
cl_bool blocking_map, | |
cl_map_flags map_flags, | |
size_t offset, | |
size_t size, | |
cl_uint num_events_in_wait_list, | |
const cl_event *event_wait_list, | |
cl_event *event, | |
cl_int *errcode_ret) | |
} | |
// enqueues a command to indicate that the host has completed updating the region given by | |
// svm_ptr and which was specified in a previous call to clEnqueueSVMMap. | |
cl_int clEnqueueSVMUnmap (cl_command_queue command_queue, | |
void *svm_ptr, | |
cl_uint num_events_in_wait_list, | |
const cl_event *event_wait_list, | |
cl_event *event) { | |
// no unmap buffer? | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, do you have an email or contact form?