From 26fe0830dded6435b56c532b6b53f36d00fe8c5d Mon Sep 17 00:00:00 2001 From: hlthantr Date: Tue, 6 Sep 2011 21:57:02 +0000 Subject: [PATCH] iTesting out the email facilitywq! --- README | 3 +++ src/CMakeLists.txt | 6 ++++-- src/cl_api.c | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README b/README index 1b2d0b7..28bfd73 100644 --- a/README +++ b/README @@ -51,6 +51,9 @@ threads but it was never tested unmap buffer. This extension "clIntelMapBuffer" directly maps dri_bo_map which is really convenient +[Update]: Added support for EnqueueBuffer through a straightforward copy into +host-allocated memory after maping the buffer [Hari Thantry] + Fulsim ------ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 34b8f0e..3da388f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,7 @@ ADD_LIBRARY(cl_test STATIC TARGET_LINK_LIBRARIES(cl_test cl) ADD_EXECUTABLE(test_copy_buffer tests/test_copy_buffer.c) +ADD_EXECUTABLE(test_enqueue_read tests/test_enqueue_read.c) ADD_EXECUTABLE(test_imm_parameters tests/test_imm_parameters.c) ADD_EXECUTABLE(test_2d_copy tests/test_2d_copy.c) ADD_EXECUTABLE(test_barrier tests/test_barrier.c) @@ -47,7 +48,7 @@ ADD_EXECUTABLE(test_private_memory tests/test_private_memory.c) ADD_EXECUTABLE(test_constant_memory tests/test_constant_memory.c) ADD_EXECUTABLE(test_memory_leak tests/test_memory_leak.c) ADD_EXECUTABLE(test_perf_report tests/test_perf_report.c) -ADD_EXECUTABLE(test_trigo tests/test_trigo.c) +#ADD_EXECUTABLE(test_trigo tests/test_trigo.c) ADD_EXECUTABLE(mersenneTwister tests/mersenneTwister.c) ADD_EXECUTABLE(blackscholes tests/blackscholes.c) ADD_EXECUTABLE(matmul tests/matmul.c) @@ -59,6 +60,7 @@ ADD_EXECUTABLE(binomialOption tests/binomialOption.c) ADD_EXECUTABLE(nbody tests/nbody.c) ADD_EXECUTABLE(svm_test tests/svm_test.c) TARGET_LINK_LIBRARIES(test_copy_buffer cl_test m) +TARGET_LINK_LIBRARIES(test_enqueue_read cl_test m) TARGET_LINK_LIBRARIES(test_imm_parameters cl_test m) TARGET_LINK_LIBRARIES(test_2d_copy cl_test m) TARGET_LINK_LIBRARIES(test_barrier cl_test m) @@ -68,7 +70,7 @@ TARGET_LINK_LIBRARIES(test_private_memory cl_test m) TARGET_LINK_LIBRARIES(test_constant_memory cl_test m) TARGET_LINK_LIBRARIES(test_memory_leak cl_test m) TARGET_LINK_LIBRARIES(test_perf_report cl_test m) -TARGET_LINK_LIBRARIES(test_trigo cl_test m) +#TARGET_LINK_LIBRARIES(test_trigo cl_test m) TARGET_LINK_LIBRARIES(mersenneTwister cl_test m) TARGET_LINK_LIBRARIES(blackscholes cl_test m) TARGET_LINK_LIBRARIES(matmul cl_test m) diff --git a/src/cl_api.c b/src/cl_api.c index beab87f..7940348 100644 --- a/src/cl_api.c +++ b/src/cl_api.c @@ -685,7 +685,10 @@ clEnqueueReadBuffer(cl_command_queue command_queue, { cl_int err = CL_SUCCESS; assert(ptr != NULL); - ptr = clIntelMapBuffer(buffer, &err); + void* temp_ptr = NULL; + temp_ptr = clIntelMapBuffer(buffer, &err); + assert(err == CL_SUCCESS); + memcpy(ptr, temp_ptr, cb); return err; } -- 2.7.4