summaryrefslogtreecommitdiff
path: root/src/cl_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cl_api.c')
-rw-r--r--src/cl_api.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cl_api.c b/src/cl_api.c
index 05d30933..1f246386 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -2665,9 +2665,13 @@ clEnqueueMapBuffer(cl_command_queue command_queue,
ptr = data->ptr;
if(event) cl_event_set_status(*event, CL_COMPLETE);
} else {
- if ((ptr = cl_mem_map_gtt_unsync(buffer)) == NULL) {
- err = CL_MAP_FAILURE;
- goto error;
+ if (buffer->is_userptr)
+ ptr = buffer->host_ptr;
+ else {
+ if ((ptr = cl_mem_map_gtt_unsync(buffer)) == NULL) {
+ err = CL_MAP_FAILURE;
+ goto error;
+ }
}
}
err = _cl_map_mem(buffer, ptr, &mem_ptr, offset, size, NULL, NULL);