use OCL_MAP_BUFFER_GTT to map climage

Submitted by Guo Yejun on Aug. 19, 2016, 12:57 a.m.

Details

Message ID 1471568224-2993-1-git-send-email-yejun.guo@intel.com
State New
Headers show
Series "use OCL_MAP_BUFFER_GTT to map climage" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Guo Yejun Aug. 19, 2016, 12:57 a.m.
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
---
 utests/runtime_cmrt.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/utests/runtime_cmrt.cpp b/utests/runtime_cmrt.cpp
index 837f09a..92bd368 100644
--- a/utests/runtime_cmrt.cpp
+++ b/utests/runtime_cmrt.cpp
@@ -236,8 +236,8 @@  void runtime_cmrt(void)
   OCL_CREATE_IMAGE(buf[0], 0, &format, &desc, NULL);
   OCL_CREATE_IMAGE(buf[1], 0, &format, &desc, NULL);
 
-  OCL_MAP_BUFFER(0);
-  OCL_MAP_BUFFER(1);
+  OCL_MAP_BUFFER_GTT(0);
+  OCL_MAP_BUFFER_GTT(1);
   uint8_t* src = (uint8_t*)buf_data[0];
   uint8_t* dst = (uint8_t*)buf_data[1];
   for (uint32_t j = 0; j < h; ++j)
@@ -245,8 +245,8 @@  void runtime_cmrt(void)
       src[j * w * 4 + i] = i;
       dst[j * w * 4 + i] = 0;
     }
-  OCL_UNMAP_BUFFER(0);
-  OCL_UNMAP_BUFFER(1);
+  OCL_UNMAP_BUFFER_GTT(0);
+  OCL_UNMAP_BUFFER_GTT(1);
 
   unsigned int d = 3;
   OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
@@ -259,16 +259,16 @@  void runtime_cmrt(void)
   //if kernel uses cm_linear_global_id, locals must be not NULL to invoke pCmQueue->EnqueueWithGroup
   OCL_CALL (clEnqueueNDRangeKernel, queue, kernel, 2, NULL, globals, NULL, 0, NULL, NULL);
 
-  OCL_MAP_BUFFER(0);
-  OCL_MAP_BUFFER(1);
+  OCL_MAP_BUFFER_GTT(0);
+  OCL_MAP_BUFFER_GTT(1);
   src = (uint8_t*)buf_data[0];
   dst = (uint8_t*)buf_data[1];
   for (uint32_t j = 0; j < h; ++j)
     for (uint32_t i = 0; i < w*4; i++) {
       OCL_ASSERT(src[j * w * 4 + i] / d == dst[j * w * 4 + i]);
     }
-  OCL_UNMAP_BUFFER(0);
-  OCL_UNMAP_BUFFER(1);
+  OCL_UNMAP_BUFFER_GTT(0);
+  OCL_UNMAP_BUFFER_GTT(1);
 }
 
 MAKE_UTEST_FROM_FUNCTION(runtime_cmrt);

Comments

LGTM, thanks.

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Guo Yejun

> Sent: Friday, August 19, 2016 8:57

> To: beignet@lists.freedesktop.org

> Cc: Guo, Yejun <yejun.guo@intel.com>

> Subject: [Beignet] [PATCH] use OCL_MAP_BUFFER_GTT to map climage

> 

> Signed-off-by: Guo Yejun <yejun.guo@intel.com>

> ---

>  utests/runtime_cmrt.cpp | 16 ++++++++--------

>  1 file changed, 8 insertions(+), 8 deletions(-)

> 

> diff --git a/utests/runtime_cmrt.cpp b/utests/runtime_cmrt.cpp index

> 837f09a..92bd368 100644

> --- a/utests/runtime_cmrt.cpp

> +++ b/utests/runtime_cmrt.cpp

> @@ -236,8 +236,8 @@ void runtime_cmrt(void)

>    OCL_CREATE_IMAGE(buf[0], 0, &format, &desc, NULL);

>    OCL_CREATE_IMAGE(buf[1], 0, &format, &desc, NULL);

> 

> -  OCL_MAP_BUFFER(0);

> -  OCL_MAP_BUFFER(1);

> +  OCL_MAP_BUFFER_GTT(0);

> +  OCL_MAP_BUFFER_GTT(1);

>    uint8_t* src = (uint8_t*)buf_data[0];

>    uint8_t* dst = (uint8_t*)buf_data[1];

>    for (uint32_t j = 0; j < h; ++j)

> @@ -245,8 +245,8 @@ void runtime_cmrt(void)

>        src[j * w * 4 + i] = i;

>        dst[j * w * 4 + i] = 0;

>      }

> -  OCL_UNMAP_BUFFER(0);

> -  OCL_UNMAP_BUFFER(1);

> +  OCL_UNMAP_BUFFER_GTT(0);

> +  OCL_UNMAP_BUFFER_GTT(1);

> 

>    unsigned int d = 3;

>    OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]); @@ -259,16 +259,16 @@ void

> runtime_cmrt(void)

>    //if kernel uses cm_linear_global_id, locals must be not NULL to invoke

> pCmQueue->EnqueueWithGroup

>    OCL_CALL (clEnqueueNDRangeKernel, queue, kernel, 2, NULL, globals,

> NULL, 0, NULL, NULL);

> 

> -  OCL_MAP_BUFFER(0);

> -  OCL_MAP_BUFFER(1);

> +  OCL_MAP_BUFFER_GTT(0);

> +  OCL_MAP_BUFFER_GTT(1);

>    src = (uint8_t*)buf_data[0];

>    dst = (uint8_t*)buf_data[1];

>    for (uint32_t j = 0; j < h; ++j)

>      for (uint32_t i = 0; i < w*4; i++) {

>        OCL_ASSERT(src[j * w * 4 + i] / d == dst[j * w * 4 + i]);

>      }

> -  OCL_UNMAP_BUFFER(0);

> -  OCL_UNMAP_BUFFER(1);

> +  OCL_UNMAP_BUFFER_GTT(0);

> +  OCL_UNMAP_BUFFER_GTT(1);

>  }

> 

>  MAKE_UTEST_FROM_FUNCTION(runtime_cmrt);

> --

> 1.9.1

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/beignet