summaryrefslogtreecommitdiff
path: root/lib/gpgpu_shader.h
diff options
context:
space:
mode:
authorAndrzej Hajda <andrzej.hajda@intel.com>2024-06-27 09:25:01 +0200
committerKamil Konieczny <kamil.konieczny@linux.intel.com>2024-07-02 17:32:33 +0200
commitc0aa6326db14114f1ec1500d09ad9ef4e2cfa224 (patch)
tree06f03f3b24e71df164d41693897479f8163500ee /lib/gpgpu_shader.h
parentc0b7746395e0790156a75139a33f9dd544716f98 (diff)
lib/gpgpu_shader: tooling for preparing and running gpgpu shaders
Implement tooling for building shaders for specific generations. The library allows you to build and run shader from precompiled blocks and provides an abstraction layer over gpgpu pipeline. v8: added asserts after memory allocations. Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com> Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib/gpgpu_shader.h')
-rw-r--r--lib/gpgpu_shader.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/gpgpu_shader.h b/lib/gpgpu_shader.h
new file mode 100644
index 000000000..02f6f1aad
--- /dev/null
+++ b/lib/gpgpu_shader.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2024 Intel Corporation
+ */
+
+#ifndef GPGPU_SHADER_H
+#define GPGPU_SHADER_H
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+struct intel_bb;
+struct intel_buf;
+
+struct gpgpu_shader {
+ uint32_t gen_ver;
+ uint32_t size;
+ uint32_t max_size;
+ union {
+ uint32_t *code;
+ uint32_t (*instr)[4];
+ };
+};
+
+struct gpgpu_shader *gpgpu_shader_create(int fd);
+void gpgpu_shader_destroy(struct gpgpu_shader *shdr);
+
+void gpgpu_shader_dump(struct gpgpu_shader *shdr);
+
+void gpgpu_shader_exec(struct intel_bb *ibb,
+ struct intel_buf *target,
+ unsigned int x_dim, unsigned int y_dim,
+ struct gpgpu_shader *shdr,
+ struct gpgpu_shader *sip,
+ uint64_t ring, bool explicit_engine);
+
+#endif /* GPGPU_SHADER_H */