Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t] lib/intel_compute: reuse bo checking code
Date: Fri, 4 Jul 2025 10:24:16 +0200	[thread overview]
Message-ID: <aGePsCuPncEOTOIa@fdugast-desk> (raw)
In-Reply-To: <20250704081131.895088-2-zbigniew.kempczynski@intel.com>

On Fri, Jul 04, 2025 at 10:11:32AM +0200, Zbigniew Kempczyński wrote:
> Use previously added bo checker helper to reduce code size.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Francois Dugast <francois.dugast@intel.com>

Thanks for cleaning this up:

Reviewed-by: Francois Dugast <francois.dugast@intel.com>

> ---
>  lib/intel_compute.c | 65 +++++++--------------------------------------
>  1 file changed, 10 insertions(+), 55 deletions(-)
> 
> diff --git a/lib/intel_compute.c b/lib/intel_compute.c
> index 6126bdb3f7..147dd29163 100644
> --- a/lib/intel_compute.c
> +++ b/lib/intel_compute.c
> @@ -882,17 +882,8 @@ static void compute_exec(int fd, const unsigned char *kernel,
>  
>  	bo_execenv_exec(&execenv, ADDR_BATCH);
>  
> -	for (int i = 0; i < execenv.array_size; i++) {
> -		float input = input_data[i];
> -		float output = output_data[i];
> -		float expected_output = input * input;
> -
> -		if (output != expected_output)
> -			igt_debug("[%4d] input:%f output:%f expected_output:%f\n",
> -				  i, input, output, expected_output);
> -		if (!user || (user && !user->skip_results_check))
> -			igt_assert_eq_double(output, expected_output);
> -	}
> +	if (!user || (user && !user->skip_results_check))
> +		bo_check_square(input_data, output_data, execenv.array_size);
>  
>  	bo_execenv_unbind(&execenv, bo_dict, entries);
>  	bo_execenv_destroy(&execenv);
> @@ -1170,17 +1161,8 @@ static void xehp_compute_exec(int fd, const unsigned char *kernel,
>  
>  	bo_execenv_exec(&execenv, ADDR_BATCH);
>  
> -	for (int i = 0; i < execenv.array_size; i++) {
> -		float input = input_data[i];
> -		float output = output_data[i];
> -		float expected_output = input * input;
> -
> -		if (output != expected_output)
> -			igt_debug("[%4d] input:%f output:%f expected_output:%f\n",
> -				  i, input, output, expected_output);
> -		if (!user || (user && !user->skip_results_check))
> -			igt_assert_eq_double(output, expected_output);
> -	}
> +	if (!user || (user && !user->skip_results_check))
> +		bo_check_square(input_data, output_data, execenv.array_size);
>  
>  	bo_execenv_unbind(&execenv, bo_dict, entries);
>  	bo_execenv_destroy(&execenv);
> @@ -1388,17 +1370,8 @@ static void xehpc_compute_exec(int fd, const unsigned char *kernel,
>  
>  	bo_execenv_exec(&execenv, ADDR_BATCH);
>  
> -	for (int i = 0; i < execenv.array_size; i++) {
> -		float input = input_data[i];
> -		float output = output_data[i];
> -		float expected_output = input * input;
> -
> -		if (output != expected_output)
> -			igt_debug("[%4d] input:%f output:%f expected_output:%f\n",
> -				  i, input, output, expected_output);
> -		if (!user || (user && !user->skip_results_check))
> -			igt_assert_eq_double(output, expected_output);
> -	}
> +	if (!user || (user && !user->skip_results_check))
> +		bo_check_square(input_data, output_data, execenv.array_size);
>  
>  	bo_execenv_unbind(&execenv, bo_dict, entries);
>  	bo_execenv_destroy(&execenv);
> @@ -1789,17 +1762,8 @@ static void xelpg_compute_exec(int fd, const unsigned char *kernel,
>  
>  	bo_execenv_exec(&execenv, ADDR_BATCH);
>  
> -	for (int i = 0; i < execenv.array_size; i++) {
> -		float input = input_data[i];
> -		float output = output_data[i];
> -		float expected_output = input * input;
> -
> -		if (output != expected_output)
> -			igt_debug("[%4d] input:%f output:%f expected_output:%f\n",
> -				  i, input, output, expected_output);
> -		if (!user || (user && !user->skip_results_check))
> -			igt_assert_eq_double(output, expected_output);
> -	}
> +	if (!user || (user && !user->skip_results_check))
> +		bo_check_square(input_data, output_data, execenv.array_size);
>  
>  	bo_execenv_unbind(&execenv, bo_dict, entries);
>  	bo_execenv_destroy(&execenv);
> @@ -1887,17 +1851,8 @@ static void xe2lpg_compute_exec(int fd, const unsigned char *kernel,
>  
>  	bo_execenv_exec(&execenv, ADDR_BATCH);
>  
> -	for (int i = 0; i < execenv.array_size; i++) {
> -		float input = input_data[i];
> -		float output = output_data[i];
> -		float expected_output = input * input;
> -
> -		if (output != expected_output)
> -			igt_debug("[%4d] input:%f output:%f expected_output:%f\n",
> -				  i, input, output, expected_output);
> -		if (!user || (user && !user->skip_results_check))
> -			igt_assert_eq_double(output, expected_output);
> -	}
> +	if (!user || (user && !user->skip_results_check))
> +		bo_check_square(input_data, output_data, execenv.array_size);
>  
>  	bo_execenv_unbind(&execenv, bo_dict, entries);
>  	bo_execenv_destroy(&execenv);
> -- 
> 2.43.0
> 

  reply	other threads:[~2025-07-04  8:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04  8:11 [PATCH i-g-t] lib/intel_compute: reuse bo checking code Zbigniew Kempczyński
2025-07-04  8:24 ` Francois Dugast [this message]
2025-07-04  9:06 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-07-04 10:13 ` ✓ i915.CI.BAT: " Patchwork
2025-07-04 14:17 ` ✗ i915.CI.Full: failure " Patchwork
2025-07-04 15:38   ` Zbigniew Kempczyński
2025-07-05 22:35 ` ✗ Xe.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aGePsCuPncEOTOIa@fdugast-desk \
    --to=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox