From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E64810E50D for ; Tue, 5 Sep 2023 13:33:44 +0000 (UTC) From: =?UTF-8?q?Zbigniew=20Kempczy=C5=84ski?= To: igt-dev@lists.freedesktop.org Date: Tue, 5 Sep 2023 15:33:06 +0200 Message-Id: <20230905133309.365109-7-zbigniew.kempczynski@intel.com> In-Reply-To: <20230905133309.365109-1-zbigniew.kempczynski@intel.com> References: <20230905133309.365109-1-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v2 6/9] intel/gem_compute: Add test which runs compute workload on i915 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: This test is verbatim copy of xe_compute with driver open exception (it opens i915 drm fd instead xe). Technically it is possible to create single test code (open would try DEVICE_INTEL | DEVICE_XE) but I resisted to that distinguishing i915 and xe version. Signed-off-by: Zbigniew Kempczyński Cc: Christoph Manszewski Cc: Francois Dugast Cc: Mauro Carvalho Chehab --- tests/intel/gem_compute.c | 46 +++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 2 files changed, 47 insertions(+) create mode 100644 tests/intel/gem_compute.c diff --git a/tests/intel/gem_compute.c b/tests/intel/gem_compute.c new file mode 100644 index 0000000000..b408efee16 --- /dev/null +++ b/tests/intel/gem_compute.c @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright © 2023 Intel Corporation + */ + +/** + * TEST: Check compute-related functionality + * Category: Hardware building block + * Sub-category: compute + * Test category: functionality test + * Run type: BAT + */ + +#include + +#include "igt.h" +#include "intel_compute.h" + +/** + * SUBTEST: compute-square + * GPU requirement: only works on TGL + * Description: + * Run an openCL Kernel that returns output[i] = input[i] * input[i], + * for an input dataset.. + * Functionality: compute openCL kernel + * TODO: extend test to cover other platforms + */ +static void +test_compute_square(int fd) +{ + igt_require_f(run_compute_kernel(fd), "GPU not supported\n"); +} + +igt_main +{ + int i915; + + igt_fixture + i915 = drm_open_driver(DRIVER_INTEL); + + igt_subtest("compute-square") + test_compute_square(i915); + + igt_fixture + drm_close_driver(i915); +} diff --git a/tests/meson.build b/tests/meson.build index aa8e3434ce..03bb7785c3 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -105,6 +105,7 @@ intel_i915_progs = [ 'gem_ccs', 'gem_close', 'gem_close_race', + 'gem_compute', 'gem_concurrent_blit', 'gem_cs_tlb', 'gem_ctx_bad_destroy', -- 2.34.1