summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Yejun <yejun.guo@intel.com>2014-11-28 10:23:29 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-12-02 17:16:56 +0800
commit6d6ea43aacbe65d9f9e2167d1824c35f128eec79 (patch)
treea2d6a96ad01065eac57470c049db7e413aaab76c
parent9174fec835760941cd13c49c9d161bd13bb7b0e6 (diff)
refine utest of cl_mem_use_host_ptr
From application perspective, userptr is transparent. App does not need to know if userptr is enabled or not, just invokes standard OpenCL APIs. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
-rw-r--r--utests/CMakeLists.txt5
-rw-r--r--utests/runtime_use_host_ptr_buffer.cpp8
2 files changed, 1 insertions, 12 deletions
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index 603338f6..4551983b 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -224,11 +224,6 @@ else(GEN_PCI_ID)
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/../backend/src/gbe_bin_generater ${kernel_bin}.cl)
endif(GEN_PCI_ID)
-if (DRM_INTEL_USERPTR)
- SET(CMAKE_CXX_FLAGS "-DHAS_USERPTR ${CMAKE_CXX_FLAGS}")
- SET(CMAKE_C_FLAGS "-DHAS_USERPTR ${CMAKE_C_FLAGS}")
-endif (DRM_INTEL_USERPTR)
-
ADD_CUSTOM_TARGET(kernel_bin.bin
DEPENDS ${kernel_bin}.bin)
diff --git a/utests/runtime_use_host_ptr_buffer.cpp b/utests/runtime_use_host_ptr_buffer.cpp
index 4603f90d..79273c30 100644
--- a/utests/runtime_use_host_ptr_buffer.cpp
+++ b/utests/runtime_use_host_ptr_buffer.cpp
@@ -20,17 +20,11 @@ static void runtime_use_host_ptr_buffer(void)
OCL_NDRANGE(1);
// Check result
-
-#ifdef HAS_USERPTR
- OCL_FINISH();
-#else
void* mapptr = (int*)clEnqueueMapBuffer(queue, buf[0], CL_TRUE, CL_MAP_READ, 0, n*sizeof(uint32_t), 0, NULL, NULL, NULL);
OCL_ASSERT(mapptr == buf_data[0]);
- clEnqueueUnmapMemObject(queue, buf[0], mapptr, 0, NULL, NULL);
-#endif
-
for (uint32_t i = 0; i < n; ++i)
OCL_ASSERT(((uint32_t*)buf_data[0])[i] == i / 2);
+ clEnqueueUnmapMemObject(queue, buf[0], mapptr, 0, NULL, NULL);
free(buf_data[0]);
buf_data[0] = NULL;