From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 1/4] compute_square_kernel.cl: add CL file used at xe_compute.c
Date: Tue, 4 Apr 2023 09:38:32 +0200 [thread overview]
Message-ID: <20230404073835.205323-2-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230404073835.205323-1-mauro.chehab@linux.intel.com>
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Provide the cl file that it was used to produce the OpenCL
Kernel used by xe_compute, and document how the binary at
xe_compute.h was produced.
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
lib/xe/xe_compute.c | 3 ++-
opencl/compute_square_kernel.cl | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 opencl/compute_square_kernel.cl
diff --git a/lib/xe/xe_compute.c b/lib/xe/xe_compute.c
index 8c0f8c87d50f..2165eada8931 100644
--- a/lib/xe/xe_compute.c
+++ b/lib/xe/xe_compute.c
@@ -18,7 +18,8 @@
#define GPGPU_WALKER 0x7105000d
#define MI_BATCH_BUFFER_END (0xA << 23)
-// generated with: ocloc -file kernel.cl -device tgllp && xxd -i kernel_Gen12LPlp.gen
+// generated with:
+// ocloc -file opencl/compute_square_kernel.cl -device tgllp && xxd -i compute_square_kernel_Gen12LPlp.bin
unsigned char tgllp_kernel_square_bin[] = {
0x61, 0x00, 0x03, 0x80, 0x20, 0x02, 0x05, 0x03, 0x04, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x66, 0x01, 0x00, 0x80, 0x20, 0x82, 0x01, 0x80,
diff --git a/opencl/compute_square_kernel.cl b/opencl/compute_square_kernel.cl
new file mode 100644
index 000000000000..f6260fb934dc
--- /dev/null
+++ b/opencl/compute_square_kernel.cl
@@ -0,0 +1,5 @@
+__kernel void square(__global float* input, __global float* output, const unsigned int count) {
+ int i = get_global_id(0);
+ if(i < count)
+ output[i] = input[i] * input[i];
+}
--
2.39.2
next prev parent reply other threads:[~2023-04-04 7:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 7:38 [igt-dev] [PATCH i-g-t v2 0/4] Make xe_compute test more generic Mauro Carvalho Chehab
2023-04-04 7:38 ` Mauro Carvalho Chehab [this message]
2023-04-04 7:38 ` [igt-dev] [PATCH i-g-t v2 2/4] xe/xe_compute: place OpenCL kernel on a separate file Mauro Carvalho Chehab
2023-04-04 7:38 ` [igt-dev] [PATCH i-g-t v2 3/4] lib/xe/xe_compute: use registers defs from intel_gpu_commands.h Mauro Carvalho Chehab
2023-04-04 7:38 ` [igt-dev] [PATCH i-g-t v2 4/4] gen_opencl_kernel: add script to dynamically create OpenCL kernels Mauro Carvalho Chehab
2023-04-04 14:28 ` Kamil Konieczny
2023-04-04 10:41 ` [igt-dev] ✓ Fi.CI.BAT: success for Make xe_compute test more generic (rev2) Patchwork
2023-04-04 16:53 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20230404073835.205323-2-mauro.chehab@linux.intel.com \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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