Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/xe_exec_system_allocator: Enhance SVM compute test
@ 2026-03-09  4:34 nishit.sharma
  2026-03-09  6:04 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: nishit.sharma @ 2026-03-09  4:34 UTC (permalink / raw)
  To: igt-dev, zbigniew.kempczynski; +Cc: francois.dugast

From: Nishit Sharma <nishit.sharma@intel.com>

Updated test to validate output values against expected results after
workload execution. These enhancements improve test coverage, reliability,
and debugging for SVM compute workloads. Updated test to validate output
values against expected results after kernel execution.

Signed-off-by: Nishit Sharma <nishit.sharma@intel.com>
---
 tests/intel/xe_exec_system_allocator.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
index 14f5e358f..e670ee007 100644
--- a/tests/intel/xe_exec_system_allocator.c
+++ b/tests/intel/xe_exec_system_allocator.c
@@ -2257,7 +2257,7 @@ test_compute(int fd, size_t size, unsigned int flags)
 		 */
 		.array_size = size / sizeof(float),
 	};
-	float *compute_input;
+	float *compute_input, *compute_output;
 	int i;
 
 	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE, 0);
@@ -2267,19 +2267,31 @@ test_compute(int fd, size_t size, unsigned int flags)
 	xe_wait_ufence(fd, &bo_sync->sync, USER_FENCE_VALUE, 0, FIVE_SEC);
 
 	compute_input = aligned_alloc(SZ_2M, size);
-	igt_assert(compute_input);
+	compute_output = aligned_alloc(SZ_2M, size);
+	igt_assert(compute_input && compute_output);
 
-	env.loop_count = (flags & TOUCH_ONCE) ? 1 : env.array_size;
+	env.loop_count = (flags & TOUCH_ONCE) ? 1 : env.array_size / 2;
 	env.skip_results_check = !(flags & ACCESS_DEVICE_HOST);
 	env.input_addr = to_user_pointer(compute_input);
+	env.output_addr = to_user_pointer(compute_output);
 	env.vm = vm;
 
 	for (i = 0; i < env.loop_count; i++)
-		compute_input[i] = rand() / (float)RAND_MAX;
+		compute_input[i] = (float)i + 2.0f;
 
 	run_intel_compute_kernel(fd, &env, EXECENV_PREF_SYSTEM);
 
+	for (i = 0; i < env.loop_count; i++) {
+		float expected_output = compute_input[i] * compute_input[i];
+
+		if (compute_output[i] != expected_output || compute_output[i] == 0.0f)
+			igt_debug("[%4d] input:%f output:%f expected_output:%f\n",
+				  i, compute_input[i], compute_output[i], expected_output);
+		igt_assert_eq_double(compute_output[i], expected_output);
+	}
+
 	free(compute_input);
+	free(compute_output);
 	unbind_system_allocator();
 	xe_vm_destroy(fd, vm);
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-09 10:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09  4:34 [PATCH i-g-t] tests/intel/xe_exec_system_allocator: Enhance SVM compute test nishit.sharma
2026-03-09  6:04 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-09  6:09 ` ✓ i915.CI.BAT: " Patchwork
2026-03-09  7:16 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-09  8:27 ` ✗ i915.CI.Full: " Patchwork
2026-03-09  9:43 ` [PATCH i-g-t] " Zbigniew Kempczyński
2026-03-09  9:55 ` Francois Dugast
2026-03-09 10:01   ` Sharma, Nishit
2026-03-09 10:19     ` Francois Dugast

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox