summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDenis Steckelmacher <steckdenis@yahoo.fr>2011-08-01 15:36:21 +0200
committerDenis Steckelmacher <steckdenis@yahoo.fr>2011-08-01 15:36:21 +0200
commit570e86e46c84ffc8ce3fc6bb8f8963e3a31e4106 (patch)
treec42de236b2b8b1526b250eff02ee3c58c4435010 /tests
parentce8975073e81ae54c8542646d146b43c741048e4 (diff)
Implement clEnqueueMapImage
Diffstat (limited to 'tests')
-rw-r--r--tests/test_commandqueue.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_commandqueue.cpp b/tests/test_commandqueue.cpp
index 2bb57f6..c8d9834 100644
--- a/tests/test_commandqueue.cpp
+++ b/tests/test_commandqueue.cpp
@@ -779,6 +779,26 @@ START_TEST (test_copy_image_buffer)
"copying data around isn't working the expected way"
);
+ // Map the image and check pointers
+ unsigned char *mapped;
+ size_t row_pitch;
+
+ origin[0] = 0;
+ origin[1] = 0;
+ origin[2] = 0;
+
+ mapped = (unsigned char *)clEnqueueMapImage(queue, image, 1, CL_MAP_READ,
+ origin, region, &row_pitch, 0, 0,
+ 0, 0, &result);
+ fail_if(
+ result != CL_SUCCESS,
+ "unable to map an image"
+ );
+ fail_if(
+ mapped != image_buffer,
+ "mapped aread doesn't match host ptr"
+ );
+
clReleaseEvent(event);
clReleaseMemObject(image);
clReleaseMemObject(buffer);