Re: [Beignet] [PATCH] Add condition checking of residuals because it may be NULL.

2016-04-05 Thread Yang, Rong R
Pushed, thanks.

> -Original Message-
> From: Beignet [mailto:beignet-boun...@lists.freedesktop.org] On Behalf Of
> Weng, Chuanbo
> Sent: Tuesday, March 29, 2016 11:04
> To: yan.w...@linux.intel.com; beignet@lists.freedesktop.org
> Subject: Re: [Beignet] [PATCH] Add condition checking of residuals because it
> may be NULL.
> 
> LGTM, thanks.
> 
> -Original Message-
> From: Beignet [mailto:beignet-boun...@lists.freedesktop.org] On Behalf Of
> yan.w...@linux.intel.com
> Sent: Monday, March 28, 2016 3:35 PM
> To: beignet@lists.freedesktop.org
> Cc: Yan Wang 
> Subject: [Beignet] [PATCH] Add condition checking of residuals because it
> may be NULL.
> 
> From: Yan Wang 
> 
> ---
>  src/kernels/cl_internal_block_motion_estimate_intel.cl | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/kernels/cl_internal_block_motion_estimate_intel.cl
> b/src/kernels/cl_internal_block_motion_estimate_intel.cl
> index 23c5488..e56520a 100644
> --- a/src/kernels/cl_internal_block_motion_estimate_intel.cl
> +++ b/src/kernels/cl_internal_block_motion_estimate_intel.cl
> @@ -341,7 +341,8 @@ void
> block_motion_estimate_intel(accelerator_intel_t accel,
>  mv_index = index * 1;
>  if( lid_x == 0 ){
>motion_vector_buffer[mv_index] = mv[lid_x];
> -  residuals[mv_index] = 2 * res[lid_x];
> +  if(residuals)
> +residuals[mv_index] = 2 * res[lid_x];
>  }
>}
>//CL_ME_MB_TYPE_8x8_INTEL
> @@ -350,7 +351,8 @@ void
> block_motion_estimate_intel(accelerator_intel_t accel,
>mv_index = lgid_y * num_groups_x * 4 + lgid_x * 2;
>mv_index = mv_index + num_groups_x * 2 * (lid_x / 2) + (lid_x % 2);
>motion_vector_buffer[mv_index] = mv[lid_x];
> -  residuals[mv_index] = 2 * res[lid_x];
> +  if(residuals)
> +residuals[mv_index] = 2 * res[lid_x];
>  }
>}
>//CL_ME_MB_TYPE_4x4_INTEL
> @@ -359,7 +361,8 @@ void
> block_motion_estimate_intel(accelerator_intel_t accel,
>mv_index = lgid_y * num_groups_x * 16 + lgid_x * 4;
>mv_index = mv_index + num_groups_x * 4 * (lid_x / 4) + (lid_x % 4);
>motion_vector_buffer[mv_index] = mv[lid_x];
> -  residuals[mv_index] = 2 * res[lid_x];
> +  if(residuals)
> +residuals[mv_index] = 2 * res[lid_x];
>  }
>}
> 
> --
> 2.5.0
> 
> ___
> Beignet mailing list
> Beignet@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet
> ___
> Beignet mailing list
> Beignet@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet
___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


Re: [Beignet] [PATCH] Add condition checking of residuals because it may be NULL.

2016-03-28 Thread Weng, Chuanbo
LGTM, thanks.

-Original Message-
From: Beignet [mailto:beignet-boun...@lists.freedesktop.org] On Behalf Of 
yan.w...@linux.intel.com
Sent: Monday, March 28, 2016 3:35 PM
To: beignet@lists.freedesktop.org
Cc: Yan Wang 
Subject: [Beignet] [PATCH] Add condition checking of residuals because it may 
be NULL.

From: Yan Wang 

---
 src/kernels/cl_internal_block_motion_estimate_intel.cl | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/kernels/cl_internal_block_motion_estimate_intel.cl 
b/src/kernels/cl_internal_block_motion_estimate_intel.cl
index 23c5488..e56520a 100644
--- a/src/kernels/cl_internal_block_motion_estimate_intel.cl
+++ b/src/kernels/cl_internal_block_motion_estimate_intel.cl
@@ -341,7 +341,8 @@ void block_motion_estimate_intel(accelerator_intel_t accel,
 mv_index = index * 1;
 if( lid_x == 0 ){
   motion_vector_buffer[mv_index] = mv[lid_x];
-  residuals[mv_index] = 2 * res[lid_x];
+  if(residuals)
+residuals[mv_index] = 2 * res[lid_x];
 }
   }
   //CL_ME_MB_TYPE_8x8_INTEL
@@ -350,7 +351,8 @@ void block_motion_estimate_intel(accelerator_intel_t accel,
   mv_index = lgid_y * num_groups_x * 4 + lgid_x * 2;
   mv_index = mv_index + num_groups_x * 2 * (lid_x / 2) + (lid_x % 2);
   motion_vector_buffer[mv_index] = mv[lid_x];
-  residuals[mv_index] = 2 * res[lid_x];
+  if(residuals)
+residuals[mv_index] = 2 * res[lid_x];
 }
   }
   //CL_ME_MB_TYPE_4x4_INTEL
@@ -359,7 +361,8 @@ void block_motion_estimate_intel(accelerator_intel_t accel,
   mv_index = lgid_y * num_groups_x * 16 + lgid_x * 4;
   mv_index = mv_index + num_groups_x * 4 * (lid_x / 4) + (lid_x % 4);
   motion_vector_buffer[mv_index] = mv[lid_x];
-  residuals[mv_index] = 2 * res[lid_x];
+  if(residuals)
+residuals[mv_index] = 2 * res[lid_x];
 }
   }
 
-- 
2.5.0

___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet
___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


[Beignet] [PATCH] Add condition checking of residuals because it may be NULL.

2016-03-28 Thread yan . wang
From: Yan Wang 

---
 src/kernels/cl_internal_block_motion_estimate_intel.cl | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/kernels/cl_internal_block_motion_estimate_intel.cl 
b/src/kernels/cl_internal_block_motion_estimate_intel.cl
index 23c5488..e56520a 100644
--- a/src/kernels/cl_internal_block_motion_estimate_intel.cl
+++ b/src/kernels/cl_internal_block_motion_estimate_intel.cl
@@ -341,7 +341,8 @@ void block_motion_estimate_intel(accelerator_intel_t accel,
 mv_index = index * 1;
 if( lid_x == 0 ){
   motion_vector_buffer[mv_index] = mv[lid_x];
-  residuals[mv_index] = 2 * res[lid_x];
+  if(residuals)
+residuals[mv_index] = 2 * res[lid_x];
 }
   }
   //CL_ME_MB_TYPE_8x8_INTEL
@@ -350,7 +351,8 @@ void block_motion_estimate_intel(accelerator_intel_t accel,
   mv_index = lgid_y * num_groups_x * 4 + lgid_x * 2;
   mv_index = mv_index + num_groups_x * 2 * (lid_x / 2) + (lid_x % 2);
   motion_vector_buffer[mv_index] = mv[lid_x];
-  residuals[mv_index] = 2 * res[lid_x];
+  if(residuals)
+residuals[mv_index] = 2 * res[lid_x];
 }
   }
   //CL_ME_MB_TYPE_4x4_INTEL
@@ -359,7 +361,8 @@ void block_motion_estimate_intel(accelerator_intel_t accel,
   mv_index = lgid_y * num_groups_x * 16 + lgid_x * 4;
   mv_index = mv_index + num_groups_x * 4 * (lid_x / 4) + (lid_x % 4);
   motion_vector_buffer[mv_index] = mv[lid_x];
-  residuals[mv_index] = 2 * res[lid_x];
+  if(residuals)
+residuals[mv_index] = 2 * res[lid_x];
 }
   }
 
-- 
2.5.0

___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet