[Beignet] [PATCH 2/2] update utest to loose userptr limitation

Guo Yejun yejun.guo at intel.com
Wed Jan 21 21:31:48 PST 2015


the limitation is loosed from page size to cache line size
alignment inside driver, update utest accordingly.

Signed-off-by: Guo Yejun <yejun.guo at intel.com>
---
 benchmark/benchmark_use_host_ptr_buffer.cpp | 2 +-
 utests/runtime_use_host_ptr_buffer.cpp      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/benchmark/benchmark_use_host_ptr_buffer.cpp b/benchmark/benchmark_use_host_ptr_buffer.cpp
index 7ede576..80b6c5c 100644
--- a/benchmark/benchmark_use_host_ptr_buffer.cpp
+++ b/benchmark/benchmark_use_host_ptr_buffer.cpp
@@ -10,7 +10,7 @@ int benchmark_use_host_ptr_buffer(void)
   // Setup kernel and buffers
   OCL_CREATE_KERNEL("runtime_use_host_ptr_buffer");
 
-  int ret = posix_memalign(&buf_data[0], 4096, sizeof(uint32_t) * n);
+  int ret = posix_memalign(&buf_data[0], 64, sizeof(uint32_t) * n);
   OCL_ASSERT(ret == 0);
 
   for (uint32_t i = 0; i < n; ++i) ((uint32_t*)buf_data[0])[i] = i;
diff --git a/utests/runtime_use_host_ptr_buffer.cpp b/utests/runtime_use_host_ptr_buffer.cpp
index 79273c3..54f39d3 100644
--- a/utests/runtime_use_host_ptr_buffer.cpp
+++ b/utests/runtime_use_host_ptr_buffer.cpp
@@ -7,7 +7,7 @@ static void runtime_use_host_ptr_buffer(void)
   // Setup kernel and buffers
   OCL_CREATE_KERNEL("runtime_use_host_ptr_buffer");
 
-  int ret = posix_memalign(&buf_data[0], 4096, sizeof(uint32_t) * n);
+  int ret = posix_memalign(&buf_data[0], 64, sizeof(uint32_t) * n);
   OCL_ASSERT(ret == 0);
 
   for (uint32_t i = 0; i < n; ++i) ((uint32_t*)buf_data[0])[i] = i;
-- 
1.9.1



More information about the Beignet mailing list