diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ee355b564..0cfc7d1e6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -92,6 +92,8 @@ jobs: **.hpp **.c **.h + files_ignore: | + backends/**/include/ - name: Run clang-format if: steps.changed-cpp-files.outputs.any_changed == 'true' run: | diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 68af3f1b1..f74cef496 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -40,14 +40,13 @@ jobs: name: Build and Check on ubuntu-24.04 with ${{ matrix.compilers }} strategy: matrix: - config-option: ["", "--disable-clang-parser"] compilers: ["CC=gcc CXX=g++", "CC=clang CXX=clang++ CFLAGS=\"-Wno-gnu-folding-constant\""] steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup-thapi - run: mkdir -p build - run: ./autogen.sh - - run: ../configure ${{ matrix.config-option }} ${{ matrix.compilers }} + - run: ../configure ${{ matrix.compilers }} working-directory: build - run: make working-directory: build diff --git a/backends/ze/Makefile.am b/backends/ze/Makefile.am index 57b00cf3a..9ada1de32 100644 --- a/backends/ze/Makefile.am +++ b/backends/ze/Makefile.am @@ -2,15 +2,18 @@ if STRICT # We disable `nonnull` check due to - # ././ze_tracepoints.h: In function 'lttng_ust__event_get_size__lttng_ust_ze___zeModuleCreate_entry': + # .//ze_tracepoints.h: In function 'lttng_ust__event_get_size__lttng_ust_ze___zeModuleCreate_entry': # [...]/lttng/ust-tracepoint-event.h:578:17: error: argument 1 null where non-null expected [-Werror=nonnull] # 578 | strlen((_src) ? (_src) : LTTNG_UST__NULL_STRING) + 1; - WERROR = -Werror -Wno-error=nonnull -else - WERROR = + # We disable `extern-c-compat` check due to + # ./layers/zel_tracing_register_cb.h:2729:9: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat] + #2729 | typedef struct _zer_get_default_context_params_t + # | ^ + #1 error generated. + WERROR = -Werror -Wno-error=nonnull endif -ZE_NAMESPACES = ze zet zes zel zex +ZE_NAMESPACES = ze zet zes zel zex # zer ZE_STRUCTS_NAMESPACES = $(ZE_NAMESPACES:=_structs) ZE_HDR_ROOT = \ @@ -23,13 +26,16 @@ ZE_HDR_ROOT = \ zet_api.h \ zet_ddi.h \ zet_ddi_ver.h \ + #zer_api.h \ + #zer_ddi.h \ + #zer_ddi_ver.h \ zex_api.h \ - loader/ze_loader_api.h \ layers/zel_tracing_api.h \ layers/zel_tracing_ddi.h \ layers/zel_tracing_ddi_ver.h \ layers/zel_tracing_register_cb.h \ - loader/ze_loader.h + loader/ze_loader.h \ + loader/ze_loader_api.h ZE_HDR = $(ZE_HDR_ROOT:%=$(srcdir)/include/%) MODIFIED_ZE_HDR = $(ZE_HDR_ROOT:%=modified_include/%) @@ -149,7 +155,7 @@ nodist_libZESampling_la_SOURCES = \ $(ZE_PROBES_INCL) \ $(ZE_STATIC_PROBES_INCL) -libZESampling_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(top_srcdir)/backends/ze/include -I./ +libZESampling_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I./modified_include -I./ libZESampling_la_CFLAGS = -Wall -Wextra $(WERROR) $(LTTNG_UST_CFLAGS) libZESampling_la_LDFLAGS = -avoid-version -module libZESampling_la_LIBADD = $(top_builddir)/sampling/libThapiSampling.la libzetracepoints.la -ldl $(LTTNG_UST_LIBS) @@ -174,7 +180,7 @@ nodist_libzetracepoints_la_SOURCES = \ $(ZE_PROBES_SRC) \ $(ZE_STATIC_PROBES_SRC) -libzetracepoints_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(srcdir)/include -I./ +libzetracepoints_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I./modified_include -I./ libzetracepoints_la_CFLAGS = -fPIC -Wall -Wextra -Wno-unused-parameter -Wno-type-limits -Wno-sign-compare $(WERROR) $(LTTNG_UST_CFLAGS) libzetracepoints_la_LDFLAGS = $(LTTNG_UST_LIBS) @@ -189,7 +195,7 @@ nodist_libze_loader_la_SOURCES = \ $(ZE_STATIC_PROBES_INCL) \ tracer_ze.c -libze_loader_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(srcdir)/include -I$(top_srcdir)/utils -I./ +libze_loader_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I./modified_include -I$(top_srcdir)/utils -I./ libze_loader_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS) libze_loader_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) libze_loader_la_LDFLAGS += -version-info 1:0:0 @@ -260,7 +266,7 @@ libZEInterval_la_SOURCES = \ btx_zeinterval_callbacks.cpp \ btx_zeinterval_callbacks.hpp -libZEInterval_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(srcdir)/include -I./ -I./btx_filter_ze +libZEInterval_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I./modified_include -I./ -I./btx_filter_ze libZEInterval_la_CFLAGS = -Wall -Wextra -Wno-unused-parameter $(WERROR) $(BABELTRACE2_CFLAGS) libZEInterval_la_CXXFLAGS = -std=c++17 -Wall -Wextra -Wno-unused-parameter $(WERROR) $(BABELTRACE2_CFLAGS) libZEInterval_la_LDFLAGS = $(BABELTRACE2_LIBS) -avoid-version -module @@ -286,7 +292,7 @@ $(BTX_ZE_GENERATED_SOURCE_TEST) &: btx_ze_model.yaml noinst_LTLIBRARIES += libtestzesource.la nodist_libtestzesource_la_SOURCES = $(BTX_ZE_GENERATED_SOURCE_TEST) -libtestzesource_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(srcdir)/include -I./btx_source_ze_test/ +libtestzesource_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I./modified_include -I./btx_source_ze_test/ libtestzesource_la_CFLAGS = -fPIC -Wall -Wextra -Wno-unused-parameter $(WERROR) $(BABELTRACE2_CFLAGS) TRACE_OUT = $(TRACE_COMMON:.thapi_text_pretty=.bt_text_pretty) diff --git a/backends/ze/README.md b/backends/ze/README.md new file mode 100644 index 000000000..7e0b76343 --- /dev/null +++ b/backends/ze/README.md @@ -0,0 +1,167 @@ +# Header Location + +- Standard: `https://github.com/argonne-lcf/level-zero-spec/tree/ddi_ver` +- Loader: `https://github.com/oneapi-src/level-zero/tags` +- Extension: `https://github.com/intel/compute-runtime/blob/master/level_zero/include/level_zero/driver_experimental/zex_api.h` + +# Steps: + +## 1/ Loader Repo + +- We will use the loader repo to get most of the headers. The loader contains the spec header (`ze_api.h`) and the loader-specific API (`loader/ze_loader.h`). + + - Note: It is preferable to have a loader already installed on your system: + - We may need it to check for symbols that are "defined in the header but not exported by the lib" + - We are wary of exposing a newer loader than the system one, as users may request symbols that we cannot forward + + - If you have access to a Level Zero lib, compile and run: +```bash +$ icpx -lze_loader utils_spec_update/query_ze_version.cpp && ./a.out +Driver version: 259.33578 +API version: 1.13 +Loader component versions: + [0] Name: loader + Spec: 1.13 + Lib version: 1.24.0 + [1] Name: tracing layer + Spec: 1.13 + Lib version: 1.24.0 +``` + - This will give you the loader version. + +- If you have access to a loader, you can copy/paste the `/usr/include/level_zero/` folder into `$THAPI_ROOT/backend/ze/include/`. + If not, use `git clone --depth 1 --branch $(lib_version) https://github.com/oneapi-src/level-zero.git`, where `lib_version` is the version you want. + To find the latest lib version of the loader released, run: +```bash +$ git ls-remote --sort="v:refname" --tags https://github.com/oneapi-src/level-zero.git | tail -1 +6369d8d642e9c7625e67f38664267f171b8e42dc refs/tags/v1.28.2 +``` + +### Note on `ze_loader_api.h` + +- We need also to copy / paste `source/loader/ze_loader_api.h`. The loader export it, so we export it too, just in case. +- Those header, are a nighmare. + - 1/ C++ header: We modify them manually to remove any C++ + - 2/ We split them by namespace: + - `ze_loader`, contain `zel`, + - `ze_loader_api_ze_namespace.h` contain the `ze`. + +## 2/ DDI Ver + +### Sync + +- Sync the fork (` https://github.com/argonne-lcf/level-zero-spec.git`) with the original remote +- Sync the `ddi_ver` branch + +### Building `ddi_table` + +Then we will build the `ddi_table` corresponding to the Level Zero API version. + +If you don't know the Header/API version associated with the driver previously used, you can grep for `ZE_API_VERSION_CURRENT`: +```bash +$ grep define ZE_API_VERSION_CURRENT ./level_zero/ze_api.h | head -1 +ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 13 ), ///< latest known version +``` + +Now it's time to generate `ddi_ver.h`: +```bash +git clone -b ddi_ver https://github.com/argonne-lcf/level-zero-spec.git +cd level-zero-spec/scripts/ +uv pip install -r third_party/requirements.txt +python run.py --ver $version --\!debug --\!html +``` + +- The headers will be generated in `level-zero-spec/include/`. Copy `../include/*_ddi_ver.h` into `$THAPI_ROOT/backend/ze/include/`. +- You can sanity-check that the headers are the same And that `ZE_API_VERSION_CURRENT_M` define the same version +``` +grep "ZE_API_VERSION_CURRENT" ../include/ze_api.h # Sanity check + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 13 ), ///< latest known version +#ifndef ZE_API_VERSION_CURRENT_M +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 15 ) +#endif // ZE_API_VERSION_CURRENT_M +``` +(We don't talk about `ZE_API_VERSION_CURRENT_M`...) + +- Note that `layers/zel_tracing_ddi_ver.h` is not generated manually, and need manual update. + - We remove all the C++, and all the weird important who bring symbol for other namespace. + +## 3/ Optional: ZEX + +- We are missing the `zex` header: +- Found at `https://github.com/intel/compute-runtime/blob/master/level_zero/include/level_zero/driver_experimental/zex_api.h` + +## Now Try to Compile: + +- Try to compile + +## 4/ Add medatadata + +You can use the `check_metadata.py` script to help you indentify function which need update and then figure it out. + +# Potential Problems, Thinks to check + +## 0 + +Run `utils_spec_update/test_symbol_exported.sh $loader_so $out_so` +If symbol are not exposed by the loader, but are exposed by us it's a bug! +Add a patch to comment them in `header.path`. + +``` +$ bash ./utils_spec_update/test_symbol_exported.sh /usr/lib64/libze_loader.so ~/project/p26.04/THAPI/build/ici/lib/thapi/ze/libze_loader.so +--- /usr/lib64/libze_loader.so ++++ /home/applenco/project/p26.04/THAPI/build/ici/lib/thapi/ze/libze_loader.so +@@ -240,6 +240,7 @@ + zelLoaderContextTeardown + zelLoaderDriverCheck + zelLoaderGetContext ++zelLoaderGetVersion + zelLoaderGetVersions + zelLoaderGetVersionsInternal + zelLoaderTracingLayerInit +@@ -444,6 +445,7 @@ + zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback + zelTracerRTASParallelOperationJoinExpRegisterCallback + zelTracerRTASParallelOperationJoinExtRegisterCallback ++zelTracerResetAllCallbacks + zelTracerSamplerCreateRegisterCallback + zelTracerSamplerDestroyRegisterCallback + zelTracerSetEnabled +``` + +One possibility is to do: +``` +cp -r ../../build/backends/ze/modified_include . +# Modify `modified_include` +Then +`diff -u4 -r --new-file include/ modified_include/ > headers.patch` + +## 1 + +``` +tracer_ze.c:197:8: error: use of undeclared identifier 'ZE_STRUCTURE_TYPE_DEVICE_CACHE_LINE_SIZE_EXT'; did you mean 'ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT'? + 197 | case ZE_STRUCTURE_TYPE_DEVICE_CACHE_LINE_SIZE_EXT: + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT +``` + +Due to Intel's lack of naming consistency, you may need to update the `struct_type_conversion_table` in `ze_model.rb`. + +## 2 + +``` +tracer_ze.c:8456:20: error: unused function 'zelTracerResetAllCallbacks_hid' [-Werror,-Wunused-function] + 8456 | static ze_result_t zelTracerResetAllCallbacks_hid(zel_tracer_handle_t hTracer)__attribute__ ((alias ("zelTracerResetAllCallbacks"))); + | ^~~~~~~~~~~~~~~~~ +``` +Need to modify the `$zel_commands.each` block that generates `#{c.decl_hidden_alias};` in `gen_ze.rb`. + +## 3 + +Runtime error: When running `babeltrace_thapi` (`iprof -t`), constant error: +``` +PogrammableParamValueInfoExp>': uninitialized constant ZE::ZETMetricProgrammableParamValueInfoExp::ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP (NameError) + + :description, [ :char, ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP ] +``` +Update in `backends/ze/gen_ze_library.rb`, Module ZE. +TODO: `h2yaml` should be able to find all the constants defined. diff --git a/backends/ze/extract_ze.rb b/backends/ze/extract_ze.rb index 180d9b185..4c81d2f44 100644 --- a/backends/ze/extract_ze.rb +++ b/backends/ze/extract_ze.rb @@ -4,7 +4,7 @@ #include #include #include - #include + #include EOF if enable_clang_parser? diff --git a/backends/ze/extract_zel.rb b/backends/ze/extract_zel.rb index 792df8872..f05a3136c 100644 --- a/backends/ze/extract_zel.rb +++ b/backends/ze/extract_zel.rb @@ -6,6 +6,7 @@ #include #include #include + #include EOF if enable_clang_parser? diff --git a/backends/ze/extract_zer.rb b/backends/ze/extract_zer.rb new file mode 100644 index 000000000..fe51b3e89 --- /dev/null +++ b/backends/ze/extract_zer.rb @@ -0,0 +1,37 @@ +require_relative 'extract_base' + +zel_header = < + #include + #include +EOF + +if enable_clang_parser? + header = [shared_header, zel_header].join("\n") + require 'open3' + yaml, status = Open3.capture2( + 'h2yaml --compat-cast-to-yaml -Wc,-xc -Wc,-Imodified_include/ --filter-header "zer" -', stdin_data: header + ) + exit(1) unless status.success? + +else + require_relative 'extract_base' + preprocessed_sources_ze_api = $cpp.preprocess(<<~EOF).gsub(/^#.*?$/, '') + #include + #include + EOF + + preprocessed_sources_zel_api = $cpp.preprocess(<<~EOF).gsub(/^#.*?$/, '') + #define _ZE_API_H + #{zel_header} + EOF + + $parser.parse(preprocessed_sources_ze_api) + ast = $parser.parse(preprocessed_sources_zel_api) + yaml = ast.extract_declarations.to_yaml + +end + +File.open('zer_api.yaml', 'w') do |f| + f.puts yaml +end diff --git a/backends/ze/gen_babeltrace_ze_model.rb b/backends/ze/gen_babeltrace_ze_model.rb index 9c314971d..58393acbe 100644 --- a/backends/ze/gen_babeltrace_ze_model.rb +++ b/backends/ze/gen_babeltrace_ze_model.rb @@ -7,6 +7,7 @@ [:lttng_ust_zet, $zet_commands], [:lttng_ust_zes, $zes_commands], [:lttng_ust_zel, $zel_commands], + [:lttng_ust_zer, $zer_commands], [:lttng_ust_zex, $zex_commands]].collect do |provider, commands| commands.collect do |c| [gen_event_bt_model(provider, c, :start), @@ -76,8 +77,9 @@ def gen_struct_event_bt_model(provider, struct) [:lttng_ust_zet_structs, get_structs_types(:zet, $zet_api['typedefs'], $zet_api['structs'])], [:lttng_ust_zes_structs, get_structs_types(:zes, $zes_api['typedefs'], $zes_api['structs'])], [:lttng_ust_zel_structs, get_structs_types(:zel, $zel_api['typedefs'], $zel_api['structs'])], + [:lttng_ust_zer_structs, get_structs_types(:zer, $zer_api['typedefs'], $zer_api['structs'])], [:lttng_ust_zex_structs, - get_structs_types(:zex, $zes_api['typedefs'], $zes_api['structs'])]].collect do |provider, structs| + get_structs_types(:zex, $zex_api['typedefs'], $zex_api['structs'])]].collect do |provider, structs| structs.collect do |struct| gen_struct_event_bt_model(provider, struct) end diff --git a/backends/ze/gen_ze.rb b/backends/ze/gen_ze.rb index 77265bca4..12dc75dfc 100644 --- a/backends/ze/gen_ze.rb +++ b/backends/ze/gen_ze.rb @@ -1,35 +1,41 @@ require_relative 'ze_model' puts <<~EOF - #include - #include - #include "ze.h.include" - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include "uthash.h" - #include "utlist.h" - - #include "ze_tracepoints.h" - #include "zet_tracepoints.h" - #include "zes_tracepoints.h" - #include "zel_tracepoints.h" - #include "zex_tracepoints.h" - #include "ze_structs_tracepoints.h" - #include "zet_structs_tracepoints.h" - #include "zes_structs_tracepoints.h" - #include "zel_structs_tracepoints.h" - #include "zex_structs_tracepoints.h" - #include "ze_sampling.h" - #include "ze_profiling.h" - #include "ze_properties.h" - #include "ze_build.h" + #include + #include + #include "ze.h.include" + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include "uthash.h" + #include "utlist.h" + + #include "ze_tracepoints.h" + #include "zet_tracepoints.h" + #include "zes_tracepoints.h" + #include "zel_tracepoints.h" + #ifdef NEW_VERSION_WITH_ZER + #include "zer_tracepoints.h" + #endif + #include "zex_tracepoints.h" + #include "ze_structs_tracepoints.h" + #include "zet_structs_tracepoints.h" + #include "zes_structs_tracepoints.h" + #include "zel_structs_tracepoints.h" + #ifdef NEW_VERSION_WITH_ZER + #include "zer_structs_tracepoints.h" + #endif + #include "zex_structs_tracepoints.h" + #include "ze_sampling.h" + #include "ze_profiling.h" + #include "ze_properties.h" + #include "ze_build.h" EOF @@ -94,15 +100,17 @@ def gen_struct_printer(namespace, types) zet_struct_types = get_structs_types(:zet, $zet_api['typedefs'], $zet_api['structs']) zes_struct_types = get_structs_types(:zes, $zes_api['typedefs'], $zes_api['structs']) zel_struct_types = get_structs_types(:zel, $zel_api['typedefs'], $zel_api['structs']) +zer_struct_types = get_structs_types(:zer, $zer_api['typedefs'], $zer_api['structs']) zex_struct_types = get_structs_types(:zex, $zex_api['typedefs'], $zex_api['structs']) gen_struct_printer(:ze, ze_struct_types) gen_struct_printer(:zet, zet_struct_types) gen_struct_printer(:zes, zes_struct_types) gen_struct_printer(:zel, zel_struct_types) +# gen_struct_printer(:zer, zel_struct_types) # gen_struct_printer(:zex, zex_struct_types) -all_commands = $ze_commands + $zet_commands + $zes_commands + $zel_commands +all_commands = $ze_commands + $zet_commands + $zes_commands + $zel_commands + $zer_commands all_commands.each do |c| puts "#define #{ZE_POINTER_NAMES[c]} #{c.pointer_name}" end @@ -183,7 +191,7 @@ def gen_struct_printer(namespace, types) end if c.has_return_type? - puts < LTTNG_USABLE_PARAMS + + $tracepoint_lambda.call(provider, c, :start) + $tracepoint_lambda.call(provider, c, :stop) +end diff --git a/backends/ze/headers.patch b/backends/ze/headers.patch index edbc6a6a1..1912dee4a 100644 --- a/backends/ze/headers.patch +++ b/backends/ze/headers.patch @@ -1,38 +1,14 @@ -diff -u4 -r --new-file include/layers/zel_tracing_api.h modified_include/layers/zel_tracing_api.h ---- include/layers/zel_tracing_api.h 2024-04-02 10:40:17.625021869 -0500 -+++ modified_include/layers/zel_tracing_api.h 2024-04-02 13:06:28.056000505 -0500 -@@ -54,9 +54,9 @@ - { - ZEL_STRUCTURE_TYPE_TRACER_DESC = 0x1 ,///< ::zel_tracer_desc_t - // This enumeration value is deprecated. - // Pluse use ZEL_STRUCTURE_TYPE_TRACER_DESC. -- ZEL_STRUCTURE_TYPE_TRACER_EXP_DESC = 0x1 ,///< ::zel_tracer_desc_t -+ //ZEL_STRUCTURE_TYPE_TRACER_EXP_DESC = 0x1 ,///< ::zel_tracer_desc_t - ZEL_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff - - } zel_structure_type_t; - diff -u4 -r --new-file include/layers/zel_tracing_register_cb.h modified_include/layers/zel_tracing_register_cb.h ---- include/layers/zel_tracing_register_cb.h 2024-04-02 18:30:39.225008820 -0500 -+++ modified_include/layers/zel_tracing_register_cb.h 2024-04-02 18:26:48.488474369 -0500 -@@ -21,9 +21,9 @@ - #endif - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Handle of tracer object --typedef struct _zel_tracer_handle_t *zel_tracer_handle_t; -+//typedef struct _zel_tracer_handle_t *zel_tracer_handle_t; - - /// Callback definitions for all API released in LevelZero spec 1.1 or newer - /// Callbacks for APIs included in spec 1.0 are contained in ze_api.helper - -@@ -3242,10 +3242,10 @@ - ze_pfnCommandListUpdateMutableCommandWaitEventsExpCb_t pfnUpdateMutableCommandWaitEventsExpCb +--- include/layers/zel_tracing_register_cb.h 2026-03-05 21:34:03.000000000 +0000 ++++ modified_include/layers/zel_tracing_register_cb.h 2026-03-05 21:45:37.000000000 +0000 +@@ -3919,10 +3919,11 @@ + ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb ); -ZE_APIEXPORT ze_result_t ZE_APICALL -zelTracerResetAllCallbacks(zel_tracer_handle_t hTracer); ++// Not exposed by the loader +//ZE_APIEXPORT ze_result_t ZE_APICALL +//zelTracerResetAllCallbacks(zel_tracer_handle_t hTracer); @@ -40,1360 +16,21 @@ diff -u4 -r --new-file include/layers/zel_tracing_register_cb.h modified_include #if defined(__cplusplus) } // extern "C" diff -u4 -r --new-file include/loader/ze_loader_api.h modified_include/loader/ze_loader_api.h ---- include/loader/ze_loader_api.h 2025-09-24 16:25:46.320158542 -0500 -+++ modified_include/loader/ze_loader_api.h 2025-10-16 17:33:33.069602137 -0500 -@@ -7,10 +7,15 @@ - * @file ze_loader_api.cpp - * - */ - -+#ifndef THAPI_NO_INCLUDE - #include "ze_loader_internal.h" - #include "loader/ze_loader.h" -+#endif -+#include "../ze_api.h" -+#include -+#define HMODULE void * - - #define TRACING_COMP_NAME "loader" - - #if defined(__cplusplus) -@@ -55,27 +60,10 @@ +--- include/loader/ze_loader_api.h 2026-03-05 21:17:00.000000000 +0000 ++++ modified_include/loader/ze_loader_api.h 2026-03-05 21:46:13.000000000 +0000 +@@ -74,11 +74,11 @@ /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for getting version /// +-// Aurora loader doesn't export it for some reason -ZE_DLLEXPORT ze_result_t ZE_APICALL -zelLoaderGetVersion(zel_component_version_t *version); -- -- --/////////////////////////////////////////////////////////////////////////////// --/// @brief Exported function for getting versions of all components --/// --ZE_DLLEXPORT ze_result_t ZE_APICALL --zelLoaderGetVersionsInternal( -- size_t *num_elems, //Pointer to num versions to get. -- zel_component_version_t *versions); //Pointer to array of versions. If set to NULL, num_elems is returned -- -- --ZE_DLLEXPORT ze_result_t ZE_APICALL --zelLoaderTranslateHandleInternal( -- zel_handle_type_t handleType, //Handle type -- void *handleIn, //Input: handle to translate from loader handle to driver handle -- void **handleOut); //Output: Pointer to handleOut is set to driver handle if successful -- ++// Not exposed by the loader +//ZE_DLLEXPORT ze_result_t ZE_APICALL +//zelLoaderGetVersion(zel_component_version_t *version); - #if defined(__cplusplus) - } - #endif -\ No newline at end of file -diff -u4 -r --new-file include/loader/ze_loader.h modified_include/loader/ze_loader.h ---- include/loader/ze_loader.h 2025-09-24 16:25:46.319212940 -0500 -+++ modified_include/loader/ze_loader.h 2025-10-16 17:33:33.069765006 -0500 -@@ -24,9 +24,11 @@ - int patch; - } zel_version_t; - - //Ex component string "ze_tracing", "ze_validation", etc -+#ifndef ZEL_COMPONENT_STRING_SIZE - #define ZEL_COMPONENT_STRING_SIZE 64 -+#endif - - typedef struct zel_component_version { - char component_name[ZEL_COMPONENT_STRING_SIZE]; - ze_api_version_t spec_version; -@@ -38,8 +40,16 @@ - zelLoaderGetVersions( - size_t *num_elems, //Pointer to num versions to get. - zel_component_version_t *versions); //Pointer to array of versions. If set to NULL, num_elems is returned - -+/////////////////////////////////////////////////////////////////////////////// -+/// @brief Exported function for getting versions of all components -+/// -+ZE_DLLEXPORT ze_result_t ZE_APICALL -+zelLoaderGetVersionsInternal( -+ size_t *num_elems, //Pointer to num versions to get. -+ zel_component_version_t *versions); //Pointer to array of versions. If set to NULL, num_elems is returned -+ - typedef enum _zel_handle_type_t { - ZEL_HANDLE_DRIVER, - ZEL_HANDLE_DEVICE, - ZEL_HANDLE_CONTEXT, -@@ -64,8 +74,17 @@ - void *handleIn, //Input: handle to translate from loader handle to driver handle - void **handleOut); //Output: Pointer to handleOut is set to driver handle if successful - - /////////////////////////////////////////////////////////////////////////////// -+/// @brief Exported function for Enabling the Tracing Layer During Runtime. -+/// -+ZE_DLLEXPORT ze_result_t ZE_APICALL -+zelLoaderTranslateHandleInternal( -+ zel_handle_type_t handleType, //Handle type -+ void *handleIn, //Input: handle to translate from loader handle to driver handle -+ void **handleOut); //Output: Pointer to handleOut is set to driver handle if successful -+ -+/////////////////////////////////////////////////////////////////////////////// - /// @brief Exported function for handling calls to released drivers in teardown. - /// - ZE_DLLEXPORT ze_result_t ZE_APICALL - zelSetDriverTeardown(); -diff -u4 -r --new-file include/ze_api.h modified_include/ze_api.h ---- include/ze_api.h 2025-09-24 16:25:46.320229688 -0500 -+++ modified_include/ze_api.h 2025-10-16 17:33:33.073893223 -0500 -@@ -14,10 +14,12 @@ - #pragma once - #endif - - // standard headers -+#ifndef THAPI_NO_INCLUDE - #include - #include -+#endif - - #if defined(__cplusplus) - extern "C" { - #endif -@@ -447,493 +449,493 @@ - /// implementation - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_ipc_mem_handle_t --typedef struct _ze_ipc_mem_handle_t ze_ipc_mem_handle_t; -+//typedef struct _ze_ipc_mem_handle_t ze_ipc_mem_handle_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_ipc_event_pool_handle_t --typedef struct _ze_ipc_event_pool_handle_t ze_ipc_event_pool_handle_t; -+//typedef struct _ze_ipc_event_pool_handle_t ze_ipc_event_pool_handle_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_uuid_t --typedef struct _ze_uuid_t ze_uuid_t; -+//typedef struct _ze_uuid_t ze_uuid_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_base_cb_params_t --typedef struct _ze_base_cb_params_t ze_base_cb_params_t; -+//typedef struct _ze_base_cb_params_t ze_base_cb_params_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_base_properties_t --typedef struct _ze_base_properties_t ze_base_properties_t; -+//typedef struct _ze_base_properties_t ze_base_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_base_desc_t --typedef struct _ze_base_desc_t ze_base_desc_t; -+//typedef struct _ze_base_desc_t ze_base_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_driver_uuid_t --typedef struct _ze_driver_uuid_t ze_driver_uuid_t; -+//typedef struct _ze_driver_uuid_t ze_driver_uuid_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_driver_properties_t --typedef struct _ze_driver_properties_t ze_driver_properties_t; -+//typedef struct _ze_driver_properties_t ze_driver_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_driver_ipc_properties_t --typedef struct _ze_driver_ipc_properties_t ze_driver_ipc_properties_t; -+//typedef struct _ze_driver_ipc_properties_t ze_driver_ipc_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_driver_extension_properties_t --typedef struct _ze_driver_extension_properties_t ze_driver_extension_properties_t; -+//typedef struct _ze_driver_extension_properties_t ze_driver_extension_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_uuid_t --typedef struct _ze_device_uuid_t ze_device_uuid_t; -+//typedef struct _ze_device_uuid_t ze_device_uuid_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_properties_t --typedef struct _ze_device_properties_t ze_device_properties_t; -+//typedef struct _ze_device_properties_t ze_device_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_thread_t --typedef struct _ze_device_thread_t ze_device_thread_t; -+//typedef struct _ze_device_thread_t ze_device_thread_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_compute_properties_t --typedef struct _ze_device_compute_properties_t ze_device_compute_properties_t; -+//typedef struct _ze_device_compute_properties_t ze_device_compute_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_native_kernel_uuid_t --typedef struct _ze_native_kernel_uuid_t ze_native_kernel_uuid_t; -+//typedef struct _ze_native_kernel_uuid_t ze_native_kernel_uuid_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_module_properties_t --typedef struct _ze_device_module_properties_t ze_device_module_properties_t; -+//typedef struct _ze_device_module_properties_t ze_device_module_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_command_queue_group_properties_t --typedef struct _ze_command_queue_group_properties_t ze_command_queue_group_properties_t; -+//typedef struct _ze_command_queue_group_properties_t ze_command_queue_group_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_memory_properties_t --typedef struct _ze_device_memory_properties_t ze_device_memory_properties_t; -+//typedef struct _ze_device_memory_properties_t ze_device_memory_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_memory_access_properties_t --typedef struct _ze_device_memory_access_properties_t ze_device_memory_access_properties_t; -+//typedef struct _ze_device_memory_access_properties_t ze_device_memory_access_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_cache_properties_t --typedef struct _ze_device_cache_properties_t ze_device_cache_properties_t; -+//typedef struct _ze_device_cache_properties_t ze_device_cache_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_image_properties_t --typedef struct _ze_device_image_properties_t ze_device_image_properties_t; -+//typedef struct _ze_device_image_properties_t ze_device_image_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_external_memory_properties_t --typedef struct _ze_device_external_memory_properties_t ze_device_external_memory_properties_t; -+//typedef struct _ze_device_external_memory_properties_t ze_device_external_memory_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_p2p_properties_t --typedef struct _ze_device_p2p_properties_t ze_device_p2p_properties_t; -+//typedef struct _ze_device_p2p_properties_t ze_device_p2p_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_context_desc_t --typedef struct _ze_context_desc_t ze_context_desc_t; -+//typedef struct _ze_context_desc_t ze_context_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_command_queue_desc_t --typedef struct _ze_command_queue_desc_t ze_command_queue_desc_t; -+//typedef struct _ze_command_queue_desc_t ze_command_queue_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_command_list_desc_t --typedef struct _ze_command_list_desc_t ze_command_list_desc_t; -+//typedef struct _ze_command_list_desc_t ze_command_list_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_copy_region_t --typedef struct _ze_copy_region_t ze_copy_region_t; -+//typedef struct _ze_copy_region_t ze_copy_region_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_region_t --typedef struct _ze_image_region_t ze_image_region_t; -+//typedef struct _ze_image_region_t ze_image_region_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_event_pool_desc_t --typedef struct _ze_event_pool_desc_t ze_event_pool_desc_t; -+//typedef struct _ze_event_pool_desc_t ze_event_pool_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_event_desc_t --typedef struct _ze_event_desc_t ze_event_desc_t; -+//typedef struct _ze_event_desc_t ze_event_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_kernel_timestamp_data_t --typedef struct _ze_kernel_timestamp_data_t ze_kernel_timestamp_data_t; -+//typedef struct _ze_kernel_timestamp_data_t ze_kernel_timestamp_data_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_kernel_timestamp_result_t --typedef struct _ze_kernel_timestamp_result_t ze_kernel_timestamp_result_t; -+//typedef struct _ze_kernel_timestamp_result_t ze_kernel_timestamp_result_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_fence_desc_t --typedef struct _ze_fence_desc_t ze_fence_desc_t; -+//typedef struct _ze_fence_desc_t ze_fence_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_format_t --typedef struct _ze_image_format_t ze_image_format_t; -+//typedef struct _ze_image_format_t ze_image_format_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_desc_t --typedef struct _ze_image_desc_t ze_image_desc_t; -+//typedef struct _ze_image_desc_t ze_image_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_properties_t --typedef struct _ze_image_properties_t ze_image_properties_t; -+//typedef struct _ze_image_properties_t ze_image_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_mem_alloc_desc_t --typedef struct _ze_device_mem_alloc_desc_t ze_device_mem_alloc_desc_t; -+//typedef struct _ze_device_mem_alloc_desc_t ze_device_mem_alloc_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_host_mem_alloc_desc_t --typedef struct _ze_host_mem_alloc_desc_t ze_host_mem_alloc_desc_t; -+//typedef struct _ze_host_mem_alloc_desc_t ze_host_mem_alloc_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_memory_allocation_properties_t --typedef struct _ze_memory_allocation_properties_t ze_memory_allocation_properties_t; -+//typedef struct _ze_memory_allocation_properties_t ze_memory_allocation_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_external_memory_export_desc_t --typedef struct _ze_external_memory_export_desc_t ze_external_memory_export_desc_t; -+//typedef struct _ze_external_memory_export_desc_t ze_external_memory_export_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_external_memory_import_fd_t --typedef struct _ze_external_memory_import_fd_t ze_external_memory_import_fd_t; -+//typedef struct _ze_external_memory_import_fd_t ze_external_memory_import_fd_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_external_memory_export_fd_t --typedef struct _ze_external_memory_export_fd_t ze_external_memory_export_fd_t; -+//typedef struct _ze_external_memory_export_fd_t ze_external_memory_export_fd_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_external_memory_import_win32_handle_t --typedef struct _ze_external_memory_import_win32_handle_t ze_external_memory_import_win32_handle_t; -+//typedef struct _ze_external_memory_import_win32_handle_t ze_external_memory_import_win32_handle_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_external_memory_export_win32_handle_t --typedef struct _ze_external_memory_export_win32_handle_t ze_external_memory_export_win32_handle_t; -+//typedef struct _ze_external_memory_export_win32_handle_t ze_external_memory_export_win32_handle_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_module_constants_t --typedef struct _ze_module_constants_t ze_module_constants_t; -+//typedef struct _ze_module_constants_t ze_module_constants_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_module_desc_t --typedef struct _ze_module_desc_t ze_module_desc_t; -+//typedef struct _ze_module_desc_t ze_module_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_module_properties_t --typedef struct _ze_module_properties_t ze_module_properties_t; -+//typedef struct _ze_module_properties_t ze_module_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_kernel_desc_t --typedef struct _ze_kernel_desc_t ze_kernel_desc_t; -+//typedef struct _ze_kernel_desc_t ze_kernel_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_kernel_uuid_t --typedef struct _ze_kernel_uuid_t ze_kernel_uuid_t; -+//typedef struct _ze_kernel_uuid_t ze_kernel_uuid_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_kernel_properties_t --typedef struct _ze_kernel_properties_t ze_kernel_properties_t; -+//typedef struct _ze_kernel_properties_t ze_kernel_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_kernel_preferred_group_size_properties_t --typedef struct _ze_kernel_preferred_group_size_properties_t ze_kernel_preferred_group_size_properties_t; -+//typedef struct _ze_kernel_preferred_group_size_properties_t ze_kernel_preferred_group_size_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_group_count_t --typedef struct _ze_group_count_t ze_group_count_t; -+//typedef struct _ze_group_count_t ze_group_count_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_module_program_exp_desc_t --typedef struct _ze_module_program_exp_desc_t ze_module_program_exp_desc_t; -+//typedef struct _ze_module_program_exp_desc_t ze_module_program_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_raytracing_ext_properties_t --typedef struct _ze_device_raytracing_ext_properties_t ze_device_raytracing_ext_properties_t; -+//typedef struct _ze_device_raytracing_ext_properties_t ze_device_raytracing_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_raytracing_mem_alloc_ext_desc_t --typedef struct _ze_raytracing_mem_alloc_ext_desc_t ze_raytracing_mem_alloc_ext_desc_t; -+//typedef struct _ze_raytracing_mem_alloc_ext_desc_t ze_raytracing_mem_alloc_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_sampler_desc_t --typedef struct _ze_sampler_desc_t ze_sampler_desc_t; -+//typedef struct _ze_sampler_desc_t ze_sampler_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_physical_mem_desc_t --typedef struct _ze_physical_mem_desc_t ze_physical_mem_desc_t; -+//typedef struct _ze_physical_mem_desc_t ze_physical_mem_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_float_atomic_ext_properties_t --typedef struct _ze_float_atomic_ext_properties_t ze_float_atomic_ext_properties_t; -+//typedef struct _ze_float_atomic_ext_properties_t ze_float_atomic_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_relaxed_allocation_limits_exp_desc_t --typedef struct _ze_relaxed_allocation_limits_exp_desc_t ze_relaxed_allocation_limits_exp_desc_t; -+//typedef struct _ze_relaxed_allocation_limits_exp_desc_t ze_relaxed_allocation_limits_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_cache_reservation_ext_desc_t --typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; -+//typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_memory_properties_exp_t --typedef struct _ze_image_memory_properties_exp_t ze_image_memory_properties_exp_t; -+//typedef struct _ze_image_memory_properties_exp_t ze_image_memory_properties_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_view_planar_ext_desc_t --typedef struct _ze_image_view_planar_ext_desc_t ze_image_view_planar_ext_desc_t; -+//typedef struct _ze_image_view_planar_ext_desc_t ze_image_view_planar_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_view_planar_exp_desc_t --typedef struct _ze_image_view_planar_exp_desc_t ze_image_view_planar_exp_desc_t; -+//typedef struct _ze_image_view_planar_exp_desc_t ze_image_view_planar_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_scheduling_hint_exp_properties_t --typedef struct _ze_scheduling_hint_exp_properties_t ze_scheduling_hint_exp_properties_t; -+//typedef struct _ze_scheduling_hint_exp_properties_t ze_scheduling_hint_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_scheduling_hint_exp_desc_t --typedef struct _ze_scheduling_hint_exp_desc_t ze_scheduling_hint_exp_desc_t; -+//typedef struct _ze_scheduling_hint_exp_desc_t ze_scheduling_hint_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_context_power_saving_hint_exp_desc_t --typedef struct _ze_context_power_saving_hint_exp_desc_t ze_context_power_saving_hint_exp_desc_t; -+//typedef struct _ze_context_power_saving_hint_exp_desc_t ze_context_power_saving_hint_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_eu_count_ext_t --typedef struct _ze_eu_count_ext_t ze_eu_count_ext_t; -+//typedef struct _ze_eu_count_ext_t ze_eu_count_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_pci_address_ext_t --typedef struct _ze_pci_address_ext_t ze_pci_address_ext_t; -+//typedef struct _ze_pci_address_ext_t ze_pci_address_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_pci_speed_ext_t --typedef struct _ze_pci_speed_ext_t ze_pci_speed_ext_t; -+//typedef struct _ze_pci_speed_ext_t ze_pci_speed_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_pci_ext_properties_t --typedef struct _ze_pci_ext_properties_t ze_pci_ext_properties_t; -+//typedef struct _ze_pci_ext_properties_t ze_pci_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_srgb_ext_desc_t --typedef struct _ze_srgb_ext_desc_t ze_srgb_ext_desc_t; -+//typedef struct _ze_srgb_ext_desc_t ze_srgb_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_allocation_ext_properties_t --typedef struct _ze_image_allocation_ext_properties_t ze_image_allocation_ext_properties_t; -+//typedef struct _ze_image_allocation_ext_properties_t ze_image_allocation_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_linkage_inspection_ext_desc_t --typedef struct _ze_linkage_inspection_ext_desc_t ze_linkage_inspection_ext_desc_t; -+//typedef struct _ze_linkage_inspection_ext_desc_t ze_linkage_inspection_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_memory_compression_hints_ext_desc_t --typedef struct _ze_memory_compression_hints_ext_desc_t ze_memory_compression_hints_ext_desc_t; -+//typedef struct _ze_memory_compression_hints_ext_desc_t ze_memory_compression_hints_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_driver_memory_free_ext_properties_t --typedef struct _ze_driver_memory_free_ext_properties_t ze_driver_memory_free_ext_properties_t; -+//typedef struct _ze_driver_memory_free_ext_properties_t ze_driver_memory_free_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_memory_free_ext_desc_t --typedef struct _ze_memory_free_ext_desc_t ze_memory_free_ext_desc_t; -+//typedef struct _ze_memory_free_ext_desc_t ze_memory_free_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_p2p_bandwidth_exp_properties_t --typedef struct _ze_device_p2p_bandwidth_exp_properties_t ze_device_p2p_bandwidth_exp_properties_t; -+//typedef struct _ze_device_p2p_bandwidth_exp_properties_t ze_device_p2p_bandwidth_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_copy_bandwidth_exp_properties_t --typedef struct _ze_copy_bandwidth_exp_properties_t ze_copy_bandwidth_exp_properties_t; -+//typedef struct _ze_copy_bandwidth_exp_properties_t ze_copy_bandwidth_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_luid_ext_t --typedef struct _ze_device_luid_ext_t ze_device_luid_ext_t; -+//typedef struct _ze_device_luid_ext_t ze_device_luid_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_luid_ext_properties_t --typedef struct _ze_device_luid_ext_properties_t ze_device_luid_ext_properties_t; -+//typedef struct _ze_device_luid_ext_properties_t ze_device_luid_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_fabric_vertex_pci_exp_address_t --typedef struct _ze_fabric_vertex_pci_exp_address_t ze_fabric_vertex_pci_exp_address_t; -+//typedef struct _ze_fabric_vertex_pci_exp_address_t ze_fabric_vertex_pci_exp_address_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_fabric_vertex_exp_properties_t --typedef struct _ze_fabric_vertex_exp_properties_t ze_fabric_vertex_exp_properties_t; -+//typedef struct _ze_fabric_vertex_exp_properties_t ze_fabric_vertex_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_fabric_edge_exp_properties_t --typedef struct _ze_fabric_edge_exp_properties_t ze_fabric_edge_exp_properties_t; -+//typedef struct _ze_fabric_edge_exp_properties_t ze_fabric_edge_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_memory_ext_properties_t --typedef struct _ze_device_memory_ext_properties_t ze_device_memory_ext_properties_t; -+//typedef struct _ze_device_memory_ext_properties_t ze_device_memory_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_ip_version_ext_t --typedef struct _ze_device_ip_version_ext_t ze_device_ip_version_ext_t; -+//typedef struct _ze_device_ip_version_ext_t ze_device_ip_version_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_kernel_max_group_size_properties_ext_t --typedef struct _ze_kernel_max_group_size_properties_ext_t ze_kernel_max_group_size_properties_ext_t; -+//typedef struct _ze_kernel_max_group_size_properties_ext_t ze_kernel_max_group_size_properties_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_sub_allocation_t --typedef struct _ze_sub_allocation_t ze_sub_allocation_t; -+//typedef struct _ze_sub_allocation_t ze_sub_allocation_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_memory_sub_allocations_exp_properties_t --typedef struct _ze_memory_sub_allocations_exp_properties_t ze_memory_sub_allocations_exp_properties_t; -+//typedef struct _ze_memory_sub_allocations_exp_properties_t ze_memory_sub_allocations_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_event_query_kernel_timestamps_ext_properties_t --typedef struct _ze_event_query_kernel_timestamps_ext_properties_t ze_event_query_kernel_timestamps_ext_properties_t; -+//typedef struct _ze_event_query_kernel_timestamps_ext_properties_t ze_event_query_kernel_timestamps_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_synchronized_timestamp_data_ext_t --typedef struct _ze_synchronized_timestamp_data_ext_t ze_synchronized_timestamp_data_ext_t; -+//typedef struct _ze_synchronized_timestamp_data_ext_t ze_synchronized_timestamp_data_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_synchronized_timestamp_result_ext_t --typedef struct _ze_synchronized_timestamp_result_ext_t ze_synchronized_timestamp_result_ext_t; -+//typedef struct _ze_synchronized_timestamp_result_ext_t ze_synchronized_timestamp_result_ext_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_event_query_kernel_timestamps_results_ext_properties_t --typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_t ze_event_query_kernel_timestamps_results_ext_properties_t; -+//typedef struct _ze_event_query_kernel_timestamps_results_ext_properties_t ze_event_query_kernel_timestamps_results_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_exp_desc_t --typedef struct _ze_rtas_builder_exp_desc_t ze_rtas_builder_exp_desc_t; -+//typedef struct _ze_rtas_builder_exp_desc_t ze_rtas_builder_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_exp_properties_t --typedef struct _ze_rtas_builder_exp_properties_t ze_rtas_builder_exp_properties_t; -+//typedef struct _ze_rtas_builder_exp_properties_t ze_rtas_builder_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_parallel_operation_exp_properties_t --typedef struct _ze_rtas_parallel_operation_exp_properties_t ze_rtas_parallel_operation_exp_properties_t; -+//typedef struct _ze_rtas_parallel_operation_exp_properties_t ze_rtas_parallel_operation_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_device_exp_properties_t --typedef struct _ze_rtas_device_exp_properties_t ze_rtas_device_exp_properties_t; -+//typedef struct _ze_rtas_device_exp_properties_t ze_rtas_device_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_float3_exp_t --typedef struct _ze_rtas_float3_exp_t ze_rtas_float3_exp_t; -+//typedef struct _ze_rtas_float3_exp_t ze_rtas_float3_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_transform_float3x4_column_major_exp_t --typedef struct _ze_rtas_transform_float3x4_column_major_exp_t ze_rtas_transform_float3x4_column_major_exp_t; -+//typedef struct _ze_rtas_transform_float3x4_column_major_exp_t ze_rtas_transform_float3x4_column_major_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_transform_float3x4_aligned_column_major_exp_t --typedef struct _ze_rtas_transform_float3x4_aligned_column_major_exp_t ze_rtas_transform_float3x4_aligned_column_major_exp_t; -+//typedef struct _ze_rtas_transform_float3x4_aligned_column_major_exp_t ze_rtas_transform_float3x4_aligned_column_major_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_transform_float3x4_row_major_exp_t --typedef struct _ze_rtas_transform_float3x4_row_major_exp_t ze_rtas_transform_float3x4_row_major_exp_t; -+//typedef struct _ze_rtas_transform_float3x4_row_major_exp_t ze_rtas_transform_float3x4_row_major_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_aabb_exp_t --typedef struct _ze_rtas_aabb_exp_t ze_rtas_aabb_exp_t; -+//typedef struct _ze_rtas_aabb_exp_t ze_rtas_aabb_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_triangle_indices_uint32_exp_t --typedef struct _ze_rtas_triangle_indices_uint32_exp_t ze_rtas_triangle_indices_uint32_exp_t; -+//typedef struct _ze_rtas_triangle_indices_uint32_exp_t ze_rtas_triangle_indices_uint32_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_quad_indices_uint32_exp_t --typedef struct _ze_rtas_quad_indices_uint32_exp_t ze_rtas_quad_indices_uint32_exp_t; -+//typedef struct _ze_rtas_quad_indices_uint32_exp_t ze_rtas_quad_indices_uint32_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_geometry_info_exp_t --typedef struct _ze_rtas_builder_geometry_info_exp_t ze_rtas_builder_geometry_info_exp_t; -+//typedef struct _ze_rtas_builder_geometry_info_exp_t ze_rtas_builder_geometry_info_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_triangles_geometry_info_exp_t --typedef struct _ze_rtas_builder_triangles_geometry_info_exp_t ze_rtas_builder_triangles_geometry_info_exp_t; -+//typedef struct _ze_rtas_builder_triangles_geometry_info_exp_t ze_rtas_builder_triangles_geometry_info_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_quads_geometry_info_exp_t --typedef struct _ze_rtas_builder_quads_geometry_info_exp_t ze_rtas_builder_quads_geometry_info_exp_t; -+//typedef struct _ze_rtas_builder_quads_geometry_info_exp_t ze_rtas_builder_quads_geometry_info_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_geometry_aabbs_exp_cb_params_t --typedef struct _ze_rtas_geometry_aabbs_exp_cb_params_t ze_rtas_geometry_aabbs_exp_cb_params_t; -+//typedef struct _ze_rtas_geometry_aabbs_exp_cb_params_t ze_rtas_geometry_aabbs_exp_cb_params_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_procedural_geometry_info_exp_t --typedef struct _ze_rtas_builder_procedural_geometry_info_exp_t ze_rtas_builder_procedural_geometry_info_exp_t; -+//typedef struct _ze_rtas_builder_procedural_geometry_info_exp_t ze_rtas_builder_procedural_geometry_info_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_instance_geometry_info_exp_t --typedef struct _ze_rtas_builder_instance_geometry_info_exp_t ze_rtas_builder_instance_geometry_info_exp_t; -+//typedef struct _ze_rtas_builder_instance_geometry_info_exp_t ze_rtas_builder_instance_geometry_info_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_rtas_builder_build_op_exp_desc_t --typedef struct _ze_rtas_builder_build_op_exp_desc_t ze_rtas_builder_build_op_exp_desc_t; -+//typedef struct _ze_rtas_builder_build_op_exp_desc_t ze_rtas_builder_build_op_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_event_pool_counter_based_exp_desc_t --typedef struct _ze_event_pool_counter_based_exp_desc_t ze_event_pool_counter_based_exp_desc_t; -+//typedef struct _ze_event_pool_counter_based_exp_desc_t ze_event_pool_counter_based_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_bindless_exp_desc_t --typedef struct _ze_image_bindless_exp_desc_t ze_image_bindless_exp_desc_t; -+//typedef struct _ze_image_bindless_exp_desc_t ze_image_bindless_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_image_pitched_exp_desc_t --typedef struct _ze_image_pitched_exp_desc_t ze_image_pitched_exp_desc_t; -+//typedef struct _ze_image_pitched_exp_desc_t ze_image_pitched_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_device_pitched_alloc_exp_properties_t --typedef struct _ze_device_pitched_alloc_exp_properties_t ze_device_pitched_alloc_exp_properties_t; -+//typedef struct _ze_device_pitched_alloc_exp_properties_t ze_device_pitched_alloc_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_command_id_exp_desc_t --typedef struct _ze_mutable_command_id_exp_desc_t ze_mutable_command_id_exp_desc_t; -+//typedef struct _ze_mutable_command_id_exp_desc_t ze_mutable_command_id_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_command_list_exp_properties_t --typedef struct _ze_mutable_command_list_exp_properties_t ze_mutable_command_list_exp_properties_t; -+//typedef struct _ze_mutable_command_list_exp_properties_t ze_mutable_command_list_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_command_list_exp_desc_t --typedef struct _ze_mutable_command_list_exp_desc_t ze_mutable_command_list_exp_desc_t; -+//typedef struct _ze_mutable_command_list_exp_desc_t ze_mutable_command_list_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_commands_exp_desc_t --typedef struct _ze_mutable_commands_exp_desc_t ze_mutable_commands_exp_desc_t; -+//typedef struct _ze_mutable_commands_exp_desc_t ze_mutable_commands_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_kernel_argument_exp_desc_t --typedef struct _ze_mutable_kernel_argument_exp_desc_t ze_mutable_kernel_argument_exp_desc_t; -+//typedef struct _ze_mutable_kernel_argument_exp_desc_t ze_mutable_kernel_argument_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_group_count_exp_desc_t --typedef struct _ze_mutable_group_count_exp_desc_t ze_mutable_group_count_exp_desc_t; -+//typedef struct _ze_mutable_group_count_exp_desc_t ze_mutable_group_count_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_group_size_exp_desc_t --typedef struct _ze_mutable_group_size_exp_desc_t ze_mutable_group_size_exp_desc_t; -+//typedef struct _ze_mutable_group_size_exp_desc_t ze_mutable_group_size_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare ze_mutable_global_offset_exp_desc_t --typedef struct _ze_mutable_global_offset_exp_desc_t ze_mutable_global_offset_exp_desc_t; -+//typedef struct _ze_mutable_global_offset_exp_desc_t ze_mutable_global_offset_exp_desc_t; - - - #if !defined(__GNUC__) - #pragma endregion -@@ -7547,14 +7549,14 @@ - /////////////////////////////////////////////////////////////////////////////// - /// @brief Cache Reservation Region - typedef enum _ze_cache_ext_region_t - { -- ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use -- ///< ::ZE_CACHE_EXT_REGION_DEFAULT. -- ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use -- ///< ::ZE_CACHE_EXT_REGION_RESERVED. -- ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use -- ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. -+// ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use -+// ///< ::ZE_CACHE_EXT_REGION_DEFAULT. -+// ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use -+// ///< ::ZE_CACHE_EXT_REGION_RESERVED. -+// ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use -+// ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. - ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme - ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region - ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region - ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff -diff -u4 -r --new-file include/zes_api.h modified_include/zes_api.h ---- include/zes_api.h 2024-04-02 18:12:14.546658929 -0500 -+++ modified_include/zes_api.h 2024-04-02 18:28:43.360746334 -0500 -@@ -212,341 +212,341 @@ - } zes_base_capability_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_base_properties_t --typedef struct _zes_base_properties_t zes_base_properties_t; -+//typedef struct _zes_base_properties_t zes_base_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_base_desc_t --typedef struct _zes_base_desc_t zes_base_desc_t; -+//typedef struct _zes_base_desc_t zes_base_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_base_state_t --typedef struct _zes_base_state_t zes_base_state_t; -+//typedef struct _zes_base_state_t zes_base_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_base_config_t --typedef struct _zes_base_config_t zes_base_config_t; -+//typedef struct _zes_base_config_t zes_base_config_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_base_capability_t --typedef struct _zes_base_capability_t zes_base_capability_t; -+//typedef struct _zes_base_capability_t zes_base_capability_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_driver_extension_properties_t --typedef struct _zes_driver_extension_properties_t zes_driver_extension_properties_t; -+//typedef struct _zes_driver_extension_properties_t zes_driver_extension_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_device_state_t --typedef struct _zes_device_state_t zes_device_state_t; -+//typedef struct _zes_device_state_t zes_device_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_reset_properties_t --typedef struct _zes_reset_properties_t zes_reset_properties_t; -+//typedef struct _zes_reset_properties_t zes_reset_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_uuid_t --typedef struct _zes_uuid_t zes_uuid_t; -+//typedef struct _zes_uuid_t zes_uuid_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_device_properties_t --typedef struct _zes_device_properties_t zes_device_properties_t; -+//typedef struct _zes_device_properties_t zes_device_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_device_ext_properties_t --typedef struct _zes_device_ext_properties_t zes_device_ext_properties_t; -+//typedef struct _zes_device_ext_properties_t zes_device_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_process_state_t --typedef struct _zes_process_state_t zes_process_state_t; -+//typedef struct _zes_process_state_t zes_process_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_pci_address_t --typedef struct _zes_pci_address_t zes_pci_address_t; -+//typedef struct _zes_pci_address_t zes_pci_address_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_pci_speed_t --typedef struct _zes_pci_speed_t zes_pci_speed_t; -+//typedef struct _zes_pci_speed_t zes_pci_speed_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_pci_properties_t --typedef struct _zes_pci_properties_t zes_pci_properties_t; -+//typedef struct _zes_pci_properties_t zes_pci_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_pci_state_t --typedef struct _zes_pci_state_t zes_pci_state_t; -+//typedef struct _zes_pci_state_t zes_pci_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_pci_bar_properties_t --typedef struct _zes_pci_bar_properties_t zes_pci_bar_properties_t; -+//typedef struct _zes_pci_bar_properties_t zes_pci_bar_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_pci_bar_properties_1_2_t --typedef struct _zes_pci_bar_properties_1_2_t zes_pci_bar_properties_1_2_t; -+//typedef struct _zes_pci_bar_properties_1_2_t zes_pci_bar_properties_1_2_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_pci_stats_t --typedef struct _zes_pci_stats_t zes_pci_stats_t; -+//typedef struct _zes_pci_stats_t zes_pci_stats_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_overclock_properties_t --typedef struct _zes_overclock_properties_t zes_overclock_properties_t; -+//typedef struct _zes_overclock_properties_t zes_overclock_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_control_property_t --typedef struct _zes_control_property_t zes_control_property_t; -+//typedef struct _zes_control_property_t zes_control_property_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_vf_property_t --typedef struct _zes_vf_property_t zes_vf_property_t; -+//typedef struct _zes_vf_property_t zes_vf_property_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_diag_test_t --typedef struct _zes_diag_test_t zes_diag_test_t; -+//typedef struct _zes_diag_test_t zes_diag_test_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_diag_properties_t --typedef struct _zes_diag_properties_t zes_diag_properties_t; -+//typedef struct _zes_diag_properties_t zes_diag_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_device_ecc_desc_t --typedef struct _zes_device_ecc_desc_t zes_device_ecc_desc_t; -+//typedef struct _zes_device_ecc_desc_t zes_device_ecc_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_device_ecc_properties_t --typedef struct _zes_device_ecc_properties_t zes_device_ecc_properties_t; -+//typedef struct _zes_device_ecc_properties_t zes_device_ecc_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_engine_properties_t --typedef struct _zes_engine_properties_t zes_engine_properties_t; -+//typedef struct _zes_engine_properties_t zes_engine_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_engine_stats_t --typedef struct _zes_engine_stats_t zes_engine_stats_t; -+//typedef struct _zes_engine_stats_t zes_engine_stats_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_port_id_t --typedef struct _zes_fabric_port_id_t zes_fabric_port_id_t; -+//typedef struct _zes_fabric_port_id_t zes_fabric_port_id_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_port_speed_t --typedef struct _zes_fabric_port_speed_t zes_fabric_port_speed_t; -+//typedef struct _zes_fabric_port_speed_t zes_fabric_port_speed_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_port_properties_t --typedef struct _zes_fabric_port_properties_t zes_fabric_port_properties_t; -+//typedef struct _zes_fabric_port_properties_t zes_fabric_port_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_link_type_t --typedef struct _zes_fabric_link_type_t zes_fabric_link_type_t; -+//typedef struct _zes_fabric_link_type_t zes_fabric_link_type_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_port_config_t --typedef struct _zes_fabric_port_config_t zes_fabric_port_config_t; -+//typedef struct _zes_fabric_port_config_t zes_fabric_port_config_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_port_state_t --typedef struct _zes_fabric_port_state_t zes_fabric_port_state_t; -+//typedef struct _zes_fabric_port_state_t zes_fabric_port_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_port_throughput_t --typedef struct _zes_fabric_port_throughput_t zes_fabric_port_throughput_t; -+//typedef struct _zes_fabric_port_throughput_t zes_fabric_port_throughput_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fabric_port_error_counters_t --typedef struct _zes_fabric_port_error_counters_t zes_fabric_port_error_counters_t; -+//typedef struct _zes_fabric_port_error_counters_t zes_fabric_port_error_counters_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fan_speed_t --typedef struct _zes_fan_speed_t zes_fan_speed_t; -+//typedef struct _zes_fan_speed_t zes_fan_speed_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fan_temp_speed_t --typedef struct _zes_fan_temp_speed_t zes_fan_temp_speed_t; -+//typedef struct _zes_fan_temp_speed_t zes_fan_temp_speed_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fan_speed_table_t --typedef struct _zes_fan_speed_table_t zes_fan_speed_table_t; -+//typedef struct _zes_fan_speed_table_t zes_fan_speed_table_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fan_properties_t --typedef struct _zes_fan_properties_t zes_fan_properties_t; -+//typedef struct _zes_fan_properties_t zes_fan_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_fan_config_t --typedef struct _zes_fan_config_t zes_fan_config_t; -+//typedef struct _zes_fan_config_t zes_fan_config_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_firmware_properties_t --typedef struct _zes_firmware_properties_t zes_firmware_properties_t; -+//typedef struct _zes_firmware_properties_t zes_firmware_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_freq_properties_t --typedef struct _zes_freq_properties_t zes_freq_properties_t; -+//typedef struct _zes_freq_properties_t zes_freq_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_freq_range_t --typedef struct _zes_freq_range_t zes_freq_range_t; -+//typedef struct _zes_freq_range_t zes_freq_range_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_freq_state_t --typedef struct _zes_freq_state_t zes_freq_state_t; -+//typedef struct _zes_freq_state_t zes_freq_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_freq_throttle_time_t --typedef struct _zes_freq_throttle_time_t zes_freq_throttle_time_t; -+//typedef struct _zes_freq_throttle_time_t zes_freq_throttle_time_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_oc_capabilities_t --typedef struct _zes_oc_capabilities_t zes_oc_capabilities_t; -+//typedef struct _zes_oc_capabilities_t zes_oc_capabilities_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_led_properties_t --typedef struct _zes_led_properties_t zes_led_properties_t; -+//typedef struct _zes_led_properties_t zes_led_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_led_color_t --typedef struct _zes_led_color_t zes_led_color_t; -+//typedef struct _zes_led_color_t zes_led_color_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_led_state_t --typedef struct _zes_led_state_t zes_led_state_t; -+//typedef struct _zes_led_state_t zes_led_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_mem_properties_t --typedef struct _zes_mem_properties_t zes_mem_properties_t; -+//typedef struct _zes_mem_properties_t zes_mem_properties_t; /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_mem_state_t --typedef struct _zes_mem_state_t zes_mem_state_t; -+//typedef struct _zes_mem_state_t zes_mem_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_mem_bandwidth_t --typedef struct _zes_mem_bandwidth_t zes_mem_bandwidth_t; -+//typedef struct _zes_mem_bandwidth_t zes_mem_bandwidth_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_mem_ext_bandwidth_t --typedef struct _zes_mem_ext_bandwidth_t zes_mem_ext_bandwidth_t; -+//typedef struct _zes_mem_ext_bandwidth_t zes_mem_ext_bandwidth_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_perf_properties_t --typedef struct _zes_perf_properties_t zes_perf_properties_t; -+//typedef struct _zes_perf_properties_t zes_perf_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_properties_t --typedef struct _zes_power_properties_t zes_power_properties_t; -+//typedef struct _zes_power_properties_t zes_power_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_energy_counter_t --typedef struct _zes_power_energy_counter_t zes_power_energy_counter_t; -+//typedef struct _zes_power_energy_counter_t zes_power_energy_counter_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_sustained_limit_t --typedef struct _zes_power_sustained_limit_t zes_power_sustained_limit_t; -+//typedef struct _zes_power_sustained_limit_t zes_power_sustained_limit_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_burst_limit_t --typedef struct _zes_power_burst_limit_t zes_power_burst_limit_t; -+//typedef struct _zes_power_burst_limit_t zes_power_burst_limit_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_peak_limit_t --typedef struct _zes_power_peak_limit_t zes_power_peak_limit_t; -+//typedef struct _zes_power_peak_limit_t zes_power_peak_limit_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_energy_threshold_t --typedef struct _zes_energy_threshold_t zes_energy_threshold_t; -+//typedef struct _zes_energy_threshold_t zes_energy_threshold_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_psu_properties_t --typedef struct _zes_psu_properties_t zes_psu_properties_t; -+//typedef struct _zes_psu_properties_t zes_psu_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_psu_state_t --typedef struct _zes_psu_state_t zes_psu_state_t; -+//typedef struct _zes_psu_state_t zes_psu_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_ras_properties_t --typedef struct _zes_ras_properties_t zes_ras_properties_t; -+//typedef struct _zes_ras_properties_t zes_ras_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_ras_state_t --typedef struct _zes_ras_state_t zes_ras_state_t; -+//typedef struct _zes_ras_state_t zes_ras_state_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_ras_config_t --typedef struct _zes_ras_config_t zes_ras_config_t; -+//typedef struct _zes_ras_config_t zes_ras_config_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_sched_properties_t --typedef struct _zes_sched_properties_t zes_sched_properties_t; -+//typedef struct _zes_sched_properties_t zes_sched_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_sched_timeout_properties_t --typedef struct _zes_sched_timeout_properties_t zes_sched_timeout_properties_t; -+//typedef struct _zes_sched_timeout_properties_t zes_sched_timeout_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_sched_timeslice_properties_t --typedef struct _zes_sched_timeslice_properties_t zes_sched_timeslice_properties_t; -+//typedef struct _zes_sched_timeslice_properties_t zes_sched_timeslice_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_standby_properties_t --typedef struct _zes_standby_properties_t zes_standby_properties_t; -+//typedef struct _zes_standby_properties_t zes_standby_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_temp_properties_t --typedef struct _zes_temp_properties_t zes_temp_properties_t; -+//typedef struct _zes_temp_properties_t zes_temp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_temp_threshold_t --typedef struct _zes_temp_threshold_t zes_temp_threshold_t; -+//typedef struct _zes_temp_threshold_t zes_temp_threshold_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_temp_config_t --typedef struct _zes_temp_config_t zes_temp_config_t; -+//typedef struct _zes_temp_config_t zes_temp_config_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_limit_ext_desc_t --typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; -+//typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_ext_properties_t --typedef struct _zes_power_ext_properties_t zes_power_ext_properties_t; -+//typedef struct _zes_power_ext_properties_t zes_power_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_engine_ext_properties_t --typedef struct _zes_engine_ext_properties_t zes_engine_ext_properties_t; -+//typedef struct _zes_engine_ext_properties_t zes_engine_ext_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_ras_state_exp_t --typedef struct _zes_ras_state_exp_t zes_ras_state_exp_t; -+//typedef struct _zes_ras_state_exp_t zes_ras_state_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_mem_page_offline_state_exp_t --typedef struct _zes_mem_page_offline_state_exp_t zes_mem_page_offline_state_exp_t; -+//typedef struct _zes_mem_page_offline_state_exp_t zes_mem_page_offline_state_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_mem_bandwidth_counter_bits_exp_properties_t --typedef struct _zes_mem_bandwidth_counter_bits_exp_properties_t zes_mem_bandwidth_counter_bits_exp_properties_t; -+//typedef struct _zes_mem_bandwidth_counter_bits_exp_properties_t zes_mem_bandwidth_counter_bits_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_power_domain_exp_properties_t --typedef struct _zes_power_domain_exp_properties_t zes_power_domain_exp_properties_t; -+//typedef struct _zes_power_domain_exp_properties_t zes_power_domain_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_subdevice_exp_properties_t --typedef struct _zes_subdevice_exp_properties_t zes_subdevice_exp_properties_t; -+//typedef struct _zes_subdevice_exp_properties_t zes_subdevice_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_vf_exp_properties_t --typedef struct _zes_vf_exp_properties_t zes_vf_exp_properties_t; -+//typedef struct _zes_vf_exp_properties_t zes_vf_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_vf_util_mem_exp_t --typedef struct _zes_vf_util_mem_exp_t zes_vf_util_mem_exp_t; -+//typedef struct _zes_vf_util_mem_exp_t zes_vf_util_mem_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zes_vf_util_engine_exp_t --typedef struct _zes_vf_util_engine_exp_t zes_vf_util_engine_exp_t; -+//typedef struct _zes_vf_util_engine_exp_t zes_vf_util_engine_exp_t; - - - #if !defined(__GNUC__) - #pragma endregion -diff -u4 -r --new-file include/zet_api.h modified_include/zet_api.h ---- include/zet_api.h 2024-04-02 10:39:40.588915290 -0500 -+++ modified_include/zet_api.h 2024-04-02 13:06:28.056000505 -0500 -@@ -88,14 +88,14 @@ - ZET_STRUCTURE_TYPE_PROFILE_PROPERTIES = 0x5, ///< ::zet_profile_properties_t - ZET_STRUCTURE_TYPE_DEVICE_DEBUG_PROPERTIES = 0x6, ///< ::zet_device_debug_properties_t - ZET_STRUCTURE_TYPE_DEBUG_MEMORY_SPACE_DESC = 0x7, ///< ::zet_debug_memory_space_desc_t - ZET_STRUCTURE_TYPE_DEBUG_REGSET_PROPERTIES = 0x8, ///< ::zet_debug_regset_properties_t -- ZET_STRUCTURE_TYPE_GLOBAL_METRICS_TIMESTAMPS_EXP_PROPERTIES = 0x9, ///< ::zet_metric_global_timestamps_resolution_exp_t. Deprecated, use -- ///< ::ZET_STRUCTURE_TYPE_METRIC_GLOBAL_TIMESTAMPS_RESOLUTION_EXP. -+// ZET_STRUCTURE_TYPE_GLOBAL_METRICS_TIMESTAMPS_EXP_PROPERTIES = 0x9, ///< ::zet_metric_global_timestamps_resolution_exp_t. Deprecated, use -+// ///< ::ZET_STRUCTURE_TYPE_METRIC_GLOBAL_TIMESTAMPS_RESOLUTION_EXP. - ZET_STRUCTURE_TYPE_METRIC_GLOBAL_TIMESTAMPS_RESOLUTION_EXP = 0x9, ///< ::zet_metric_global_timestamps_resolution_exp_t - ZET_STRUCTURE_TYPE_TRACER_EXP_DESC = 0x00010001, ///< ::zet_tracer_exp_desc_t -- ZET_STRUCTURE_TYPE_METRICS_CALCULATE_EXP_DESC = 0x00010002, ///< ::zet_metric_calculate_exp_desc_t. Deprecated, use -- ///< ::ZET_STRUCTURE_TYPE_METRIC_CALCULATE_EXP_DESC. -+// ZET_STRUCTURE_TYPE_METRICS_CALCULATE_EXP_DESC = 0x00010002, ///< ::zet_metric_calculate_exp_desc_t. Deprecated, use -+// ///< ::ZET_STRUCTURE_TYPE_METRIC_CALCULATE_EXP_DESC. - ZET_STRUCTURE_TYPE_METRIC_CALCULATE_EXP_DESC = 0x00010002, ///< ::zet_metric_calculate_exp_desc_t - ZET_STRUCTURE_TYPE_METRIC_PROGRAMMABLE_EXP_PROPERTIES = 0x00010003, ///< ::zet_metric_programmable_exp_properties_t - ZET_STRUCTURE_TYPE_METRIC_PROGRAMMABLE_PARAM_INFO_EXP = 0x00010004, ///< ::zet_metric_programmable_param_info_exp_t - ZET_STRUCTURE_TYPE_METRIC_PROGRAMMABLE_PARAM_VALUE_INFO_EXP = 0x00010005, ///< ::zet_metric_programmable_param_value_info_exp_t -@@ -171,113 +171,113 @@ - /// @brief Enables driver instrumentation and dependencies for program debugging - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_base_properties_t --typedef struct _zet_base_properties_t zet_base_properties_t; -+//typedef struct _zet_base_properties_t zet_base_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_base_desc_t --typedef struct _zet_base_desc_t zet_base_desc_t; -+//typedef struct _zet_base_desc_t zet_base_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_typed_value_t --typedef struct _zet_typed_value_t zet_typed_value_t; -+//typedef struct _zet_typed_value_t zet_typed_value_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_device_debug_properties_t --typedef struct _zet_device_debug_properties_t zet_device_debug_properties_t; -+//typedef struct _zet_device_debug_properties_t zet_device_debug_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_config_t --typedef struct _zet_debug_config_t zet_debug_config_t; -+//typedef struct _zet_debug_config_t zet_debug_config_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_event_info_detached_t --typedef struct _zet_debug_event_info_detached_t zet_debug_event_info_detached_t; -+//typedef struct _zet_debug_event_info_detached_t zet_debug_event_info_detached_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_event_info_module_t --typedef struct _zet_debug_event_info_module_t zet_debug_event_info_module_t; -+//typedef struct _zet_debug_event_info_module_t zet_debug_event_info_module_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_event_info_thread_stopped_t --typedef struct _zet_debug_event_info_thread_stopped_t zet_debug_event_info_thread_stopped_t; -+//typedef struct _zet_debug_event_info_thread_stopped_t zet_debug_event_info_thread_stopped_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_event_info_page_fault_t --typedef struct _zet_debug_event_info_page_fault_t zet_debug_event_info_page_fault_t; -+//typedef struct _zet_debug_event_info_page_fault_t zet_debug_event_info_page_fault_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_event_t --typedef struct _zet_debug_event_t zet_debug_event_t; -+//typedef struct _zet_debug_event_t zet_debug_event_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_memory_space_desc_t --typedef struct _zet_debug_memory_space_desc_t zet_debug_memory_space_desc_t; -+//typedef struct _zet_debug_memory_space_desc_t zet_debug_memory_space_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_debug_regset_properties_t --typedef struct _zet_debug_regset_properties_t zet_debug_regset_properties_t; -+//typedef struct _zet_debug_regset_properties_t zet_debug_regset_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_group_properties_t --typedef struct _zet_metric_group_properties_t zet_metric_group_properties_t; -+//typedef struct _zet_metric_group_properties_t zet_metric_group_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_properties_t --typedef struct _zet_metric_properties_t zet_metric_properties_t; -+//typedef struct _zet_metric_properties_t zet_metric_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_streamer_desc_t --typedef struct _zet_metric_streamer_desc_t zet_metric_streamer_desc_t; -+//typedef struct _zet_metric_streamer_desc_t zet_metric_streamer_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_query_pool_desc_t --typedef struct _zet_metric_query_pool_desc_t zet_metric_query_pool_desc_t; -+//typedef struct _zet_metric_query_pool_desc_t zet_metric_query_pool_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_profile_properties_t --typedef struct _zet_profile_properties_t zet_profile_properties_t; -+//typedef struct _zet_profile_properties_t zet_profile_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_profile_free_register_token_t --typedef struct _zet_profile_free_register_token_t zet_profile_free_register_token_t; -+//typedef struct _zet_profile_free_register_token_t zet_profile_free_register_token_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_profile_register_sequence_t --typedef struct _zet_profile_register_sequence_t zet_profile_register_sequence_t; -+//typedef struct _zet_profile_register_sequence_t zet_profile_register_sequence_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_tracer_exp_desc_t --typedef struct _zet_tracer_exp_desc_t zet_tracer_exp_desc_t; -+//typedef struct _zet_tracer_exp_desc_t zet_tracer_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_global_timestamps_resolution_exp_t --typedef struct _zet_metric_global_timestamps_resolution_exp_t zet_metric_global_timestamps_resolution_exp_t; -+//typedef struct _zet_metric_global_timestamps_resolution_exp_t zet_metric_global_timestamps_resolution_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_calculate_exp_desc_t --typedef struct _zet_metric_calculate_exp_desc_t zet_metric_calculate_exp_desc_t; -+//typedef struct _zet_metric_calculate_exp_desc_t zet_metric_calculate_exp_desc_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_programmable_exp_properties_t --typedef struct _zet_metric_programmable_exp_properties_t zet_metric_programmable_exp_properties_t; -+//typedef struct _zet_metric_programmable_exp_properties_t zet_metric_programmable_exp_properties_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_value_uint64_range_exp_t --typedef struct _zet_value_uint64_range_exp_t zet_value_uint64_range_exp_t; -+//typedef struct _zet_value_uint64_range_exp_t zet_value_uint64_range_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_programmable_param_info_exp_t --typedef struct _zet_metric_programmable_param_info_exp_t zet_metric_programmable_param_info_exp_t; -+//typedef struct _zet_metric_programmable_param_info_exp_t zet_metric_programmable_param_info_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_programmable_param_value_info_exp_t --typedef struct _zet_metric_programmable_param_value_info_exp_t zet_metric_programmable_param_value_info_exp_t; -+//typedef struct _zet_metric_programmable_param_value_info_exp_t zet_metric_programmable_param_value_info_exp_t; - - /////////////////////////////////////////////////////////////////////////////// - /// @brief Forward-declare zet_metric_programmable_param_value_exp_t --typedef struct _zet_metric_programmable_param_value_exp_t zet_metric_programmable_param_value_exp_t; -+//typedef struct _zet_metric_programmable_param_value_exp_t zet_metric_programmable_param_value_exp_t; - - - #if !defined(__GNUC__) - #pragma endregion -@@ -986,10 +986,10 @@ - ZET_METRIC_TYPE_TIMESTAMP = 4, ///< Metric type: timestamp - ZET_METRIC_TYPE_FLAG = 5, ///< Metric type: flag - ZET_METRIC_TYPE_RATIO = 6, ///< Metric type: ratio - ZET_METRIC_TYPE_RAW = 7, ///< Metric type: raw -- ZET_METRIC_TYPE_IP_EXP = 0x7ffffffe, ///< Metric type: instruction pointer. Deprecated, use -- ///< ::ZET_METRIC_TYPE_IP. -+// ZET_METRIC_TYPE_IP_EXP = 0x7ffffffe, ///< Metric type: instruction pointer. Deprecated, use -+// ///< ::ZET_METRIC_TYPE_IP. - ZET_METRIC_TYPE_IP = 0x7ffffffe, ///< Metric type: instruction pointer - ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff - - } zet_metric_type_t; + /// @brief Exported function for getting versions of all components +Binary files include/loader/.ze_loader_api.h.swp and modified_include/loader/.ze_loader_api.h.swp differ diff --git a/backends/ze/include/layers/zel_tracing_register_cb.h b/backends/ze/include/layers/zel_tracing_register_cb.h index f54dbed88..18b795d94 100644 --- a/backends/ze/include/layers/zel_tracing_register_cb.h +++ b/backends/ze/include/layers/zel_tracing_register_cb.h @@ -27,6 +27,177 @@ typedef struct _zel_tracer_handle_t *zel_tracer_handle_t; /// Callback definitions for all API released in LevelZero spec 1.1 or newer /// Callbacks for APIs included in spec 1.0 are contained in ze_api.helper +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeInitDrivers +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_init_drivers_params_t +{ + uint32_t** ppCount; + ze_driver_handle_t** pphDrivers; + ze_init_driver_type_desc_t** pdesc; +} ze_init_drivers_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeInitDrivers +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnInitDriversCb_t)( + ze_init_drivers_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderCreateExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_builder_create_ext_params_t +{ + ze_driver_handle_t* phDriver; + const ze_rtas_builder_ext_desc_t** ppDescriptor; + ze_rtas_builder_ext_handle_t** pphBuilder; +} ze_rtas_builder_create_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderCreateExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASBuilderCreateExtCb_t)( + ze_rtas_builder_create_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderGetBuildPropertiesExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_builder_get_build_properties_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; + const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; + ze_rtas_builder_ext_properties_t** ppProperties; +} ze_rtas_builder_get_build_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderGetBuildPropertiesExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASBuilderGetBuildPropertiesExtCb_t)( + ze_rtas_builder_get_build_properties_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderBuildExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_builder_build_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; + const ze_rtas_builder_build_op_ext_desc_t** ppBuildOpDescriptor; + void** ppScratchBuffer; + size_t* pscratchBufferSizeBytes; + void** ppRtasBuffer; + size_t* prtasBufferSizeBytes; + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; + void** ppBuildUserPtr; + ze_rtas_aabb_ext_t** ppBounds; + size_t** ppRtasBufferSizeBytes; +} ze_rtas_builder_build_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderBuildExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASBuilderBuildExtCb_t)( + ze_rtas_builder_build_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderCommandListAppendCopyExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_builder_command_list_append_copy_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + void** pdstptr; + const void** psrcptr; + size_t* psize; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_rtas_builder_command_list_append_copy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderCommandListAppendCopyExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASBuilderCommandListAppendCopyExtCb_t)( + ze_rtas_builder_command_list_append_copy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASBuilderDestroyExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_builder_destroy_ext_params_t +{ + ze_rtas_builder_ext_handle_t* phBuilder; +} ze_rtas_builder_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASBuilderDestroyExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASBuilderDestroyExtCb_t)( + ze_rtas_builder_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASBuilderCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -140,6 +311,108 @@ typedef void (ZE_APICALL *ze_pfnRTASBuilderDestroyExpCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationCreateExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_parallel_operation_create_ext_params_t +{ + ze_driver_handle_t* phDriver; + ze_rtas_parallel_operation_ext_handle_t** pphParallelOperation; +} ze_rtas_parallel_operation_create_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationCreateExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASParallelOperationCreateExtCb_t)( + ze_rtas_parallel_operation_create_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationGetPropertiesExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_parallel_operation_get_properties_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; + ze_rtas_parallel_operation_ext_properties_t** ppProperties; +} ze_rtas_parallel_operation_get_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationGetPropertiesExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASParallelOperationGetPropertiesExtCb_t)( + ze_rtas_parallel_operation_get_properties_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationJoinExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_parallel_operation_join_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; +} ze_rtas_parallel_operation_join_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationJoinExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASParallelOperationJoinExtCb_t)( + ze_rtas_parallel_operation_join_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeRTASParallelOperationDestroyExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_rtas_parallel_operation_destroy_ext_params_t +{ + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation; +} ze_rtas_parallel_operation_destroy_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeRTASParallelOperationDestroyExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnRTASParallelOperationDestroyExtCb_t)( + ze_rtas_parallel_operation_destroy_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeRTASParallelOperationCreateExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -269,6 +542,33 @@ typedef void (ZE_APICALL *ze_pfnDriverGetExtensionFunctionAddressCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDriverRTASFormatCompatibilityCheckExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_driver_rtas_format_compatibility_check_ext_params_t +{ + ze_driver_handle_t* phDriver; + ze_rtas_format_ext_t* prtasFormatA; + ze_rtas_format_ext_t* prtasFormatB; +} ze_driver_rtas_format_compatibility_check_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDriverRTASFormatCompatibilityCheckExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t)( + ze_driver_rtas_format_compatibility_check_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeDriverGetLastErrorDescription /// @details Each entry is a pointer to the parameter passed to the function; @@ -349,6 +649,85 @@ typedef void (ZE_APICALL *ze_pfnDeviceGetGlobalTimestampsCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDeviceImportExternalSemaphoreExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_device_import_external_semaphore_ext_params_t +{ + ze_device_handle_t* phDevice; + const ze_external_semaphore_ext_desc_t** pdesc; + ze_external_semaphore_ext_handle_t** pphSemaphore; +} ze_device_import_external_semaphore_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDeviceImportExternalSemaphoreExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnDeviceImportExternalSemaphoreExtCb_t)( + ze_device_import_external_semaphore_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDeviceReleaseExternalSemaphoreExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_device_release_external_semaphore_ext_params_t +{ + ze_external_semaphore_ext_handle_t* phSemaphore; +} ze_device_release_external_semaphore_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDeviceReleaseExternalSemaphoreExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExtCb_t)( + ze_device_release_external_semaphore_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDeviceGetVectorWidthPropertiesExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_device_get_vector_width_properties_ext_params_t +{ + ze_device_handle_t* phDevice; + uint32_t** ppCount; + ze_device_vector_width_properties_ext_t** ppVectorWidthProperties; +} ze_device_get_vector_width_properties_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDeviceGetVectorWidthPropertiesExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnDeviceGetVectorWidthPropertiesExtCb_t)( + ze_device_get_vector_width_properties_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeDeviceReserveCacheExt /// @details Each entry is a pointer to the parameter passed to the function; @@ -563,6 +942,125 @@ typedef void (ZE_APICALL *ze_pfnCommandQueueGetIndexCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListGetNextCommandIdWithKernelsExp +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_command_list_get_next_command_id_with_kernels_exp_params_t +{ + ze_command_list_handle_t* phCommandList; + const ze_mutable_command_id_exp_desc_t** pdesc; + uint32_t* pnumKernels; + ze_kernel_handle_t** pphKernels; + uint64_t** ppCommandId; +} ze_command_list_get_next_command_id_with_kernels_exp_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListGetNextCommandIdWithKernelsExp +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t)( + ze_command_list_get_next_command_id_with_kernels_exp_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListUpdateMutableCommandKernelsExp +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_command_list_update_mutable_command_kernels_exp_params_t +{ + ze_command_list_handle_t* phCommandList; + uint32_t* pnumKernels; + uint64_t** ppCommandId; + ze_kernel_handle_t** pphKernels; +} ze_command_list_update_mutable_command_kernels_exp_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListUpdateMutableCommandKernelsExp +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t)( + ze_command_list_update_mutable_command_kernels_exp_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendSignalExternalSemaphoreExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_command_list_append_signal_external_semaphore_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + uint32_t* pnumSemaphores; + ze_external_semaphore_ext_handle_t** pphSemaphores; + ze_external_semaphore_signal_params_ext_t** psignalParams; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_append_signal_external_semaphore_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendSignalExternalSemaphoreExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t)( + ze_command_list_append_signal_external_semaphore_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendWaitExternalSemaphoreExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_command_list_append_wait_external_semaphore_ext_params_t +{ + ze_command_list_handle_t* phCommandList; + uint32_t* pnumSemaphores; + ze_external_semaphore_ext_handle_t** pphSemaphores; + ze_external_semaphore_wait_params_ext_t** pwaitParams; + ze_event_handle_t* phSignalEvent; + uint32_t* pnumWaitEvents; + ze_event_handle_t** pphWaitEvents; +} ze_command_list_append_wait_external_semaphore_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendWaitExternalSemaphoreExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t)( + ze_command_list_append_wait_external_semaphore_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeCommandListAppendImageCopyToMemoryExt /// @details Each entry is a pointer to the parameter passed to the function; @@ -1326,6 +1824,33 @@ typedef void (ZE_APICALL *ze_pfnKernelSetGlobalOffsetExpCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeKernelGetBinaryExp +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_kernel_get_binary_exp_params_t +{ + ze_kernel_handle_t* phKernel; + size_t** ppSize; + uint8_t** ppKernelBinary; +} ze_kernel_get_binary_exp_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeKernelGetBinaryExp +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnKernelGetBinaryExpCb_t)( + ze_kernel_get_binary_exp_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeKernelSchedulingHintExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -1787,6 +2312,14 @@ zelTracerDriverGetRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerInitDriversRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnInitDriversCb_t pfnInitDriversCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDriverGetApiVersionRegisterCallback( zel_tracer_handle_t hTracer, @@ -2931,6 +3464,134 @@ zelTracerKernelSetGlobalOffsetExpRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerKernelGetBinaryExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceImportExternalSemaphoreExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceImportExternalSemaphoreExtCb_t pfnImportExternalSemaphoreExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceReleaseExternalSemaphoreExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceReleaseExternalSemaphoreExtCb_t pfnReleaseExternalSemaphoreExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendSignalExternalSemaphoreExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendSignalExternalSemaphoreExtCb_t pfnAppendSignalExternalSemaphoreExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendWaitExternalSemaphoreExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendWaitExternalSemaphoreExtCb_t pfnAppendWaitExternalSemaphoreExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCreateExtCb_t pfnCreateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderGetBuildPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderGetBuildPropertiesExtCb_t pfnGetBuildPropertiesExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDriverRTASFormatCompatibilityCheckExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDriverRTASFormatCompatibilityCheckExtCb_t pfnRTASFormatCompatibilityCheckExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderBuildExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderBuildExtCb_t pfnBuildExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderCommandListAppendCopyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderCommandListAppendCopyExtCb_t pfnCommandListAppendCopyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASBuilderDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASBuilderDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationCreateExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationCreateExtCb_t pfnCreateExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationGetPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationGetPropertiesExtCb_t pfnGetPropertiesExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationJoinExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationJoinExtCb_t pfnJoinExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerRTASParallelOperationDestroyExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnRTASParallelOperationDestroyExtCb_t pfnDestroyExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetVectorWidthPropertiesExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetVectorWidthPropertiesExtCb_t pfnGetVectorWidthPropertiesExtCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerDeviceReserveCacheExtRegisterCallback( zel_tracer_handle_t hTracer, @@ -3219,6 +3880,14 @@ zelTracerCommandListGetNextCommandIdExpRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListGetNextCommandIdWithKernelsExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListGetNextCommandIdWithKernelsExpCb_t pfnGetNextCommandIdWithKernelsExpCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListUpdateMutableCommandsExpRegisterCallback( zel_tracer_handle_t hTracer, @@ -3243,6 +3912,14 @@ zelTracerCommandListUpdateMutableCommandWaitEventsExpRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListUpdateMutableCommandKernelsExpRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListUpdateMutableCommandKernelsExpCb_t pfnUpdateMutableCommandKernelsExpCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerResetAllCallbacks(zel_tracer_handle_t hTracer); diff --git a/backends/ze/include/loader/ze_loader.h b/backends/ze/include/loader/ze_loader.h index 2d5b75d2e..74a6e0deb 100644 --- a/backends/ze/include/loader/ze_loader.h +++ b/backends/ze/include/loader/ze_loader.h @@ -13,6 +13,7 @@ #endif #include "../ze_api.h" +#include #if defined(__cplusplus) extern "C" { @@ -70,12 +71,65 @@ zelLoaderTranslateHandle( ZE_DLLEXPORT ze_result_t ZE_APICALL zelSetDriverTeardown(); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for informing the loader to delay teardown of its context until the call to zelLoaderContextTeardown().Only applies during static loader usage. +/// NOTE: This function is a work around for legacy stacks that use L0 apis after the application is already in teardown. Unless you need to use the L0 apis during teardown, do not use this function. +ZE_DLLEXPORT void ZE_APICALL +zelSetDelayLoaderContextTeardown(); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for explicitly tearing down the loader's context. Only applies during static loader usage. +/// NOTE: This function is a work around for legacy stacks that use L0 apis after the application is already in teardown. Unless you need to use the L0 apis during teardown, do not use this function. +ZE_DLLEXPORT void ZE_APICALL +zelLoaderContextTeardown(); + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for Enabling the Tracing Layer During Runtime. /// ZE_DLLEXPORT ze_result_t ZE_APICALL zelEnableTracingLayer(); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for Checking if the Loader is torndown. +/// +ZE_DLLEXPORT bool ZE_APICALL +zelCheckIsLoaderInTearDown(); + +typedef void (*zel_loader_teardown_callback_t)(); +typedef void (*zel_application_teardown_callback_t)(uint32_t index); + +/** + * @brief Registers a teardown callback to be invoked during loader teardown. + * + * This function allows the application to register a callback function that will be called + * when the loader is being torn down. The loader will also provide its own callback function + * and assign an index to the registered callback. + * + * The application_callback is required to be a function that takes no arguments and returns void. + * In addition, the application_callback should be thread-safe and not block to prevent deadlocking the + * loader teardown process. + * + * For example, the application_callback used by the static loader is: + * void staticLoaderTeardownCallback() { + * loaderTeardownCallbackReceived = true; + * } + * The application_callback should provide a simple notification to the application that the loader is being torn down. + * + * @param[in] application_callback Application's callback function to be called during loader teardown. + * @param[out] loader_callback Pointer to the loader's callback function. + * @param[out] index Index assigned to the registered callback. + * + * @return + * - ZE_RESULT_SUCCESS if the callback was successfully registered. + * - Appropriate error code otherwise. + */ +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelRegisterTeardownCallback( + zel_loader_teardown_callback_t application_callback, // [in] Application's callback function to be called during loader teardown + zel_application_teardown_callback_t *loader_callback, // [out] Pointer to the loader's callback function + uint32_t *index // [out] Index assigned to the registered callback +); + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for Disabling the Tracing Layer During Runtime. /// @@ -85,4 +139,4 @@ zelDisableTracingLayer(); #if defined(__cplusplus) } // extern "C" #endif -#endif //_ZE_LOADER_H \ No newline at end of file +#endif //_ZE_LOADER_H diff --git a/backends/ze/include/loader/ze_loader_api.h b/backends/ze/include/loader/ze_loader_api.h index d0d48608c..97171c7bd 100644 --- a/backends/ze/include/loader/ze_loader_api.h +++ b/backends/ze/include/loader/ze_loader_api.h @@ -8,23 +8,29 @@ * */ -#include "ze_loader_internal.h" +//#include "ze_loader_internal.h" #include "loader/ze_loader.h" +//Modification +#include "../ze_api.h" +#include +#define HMODULE void * + #define TRACING_COMP_NAME "loader" #if defined(__cplusplus) extern "C" { #endif +// Moved to `ze_loader_api_ze_namespace.h` /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for initializing loader /// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED -ZE_DLLEXPORT ze_result_t ZE_APICALL -zeLoaderInit(); +//ZE_DLLEXPORT ze_result_t ZE_APICALL +//zeLoaderInit(); /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for verifying usable L0 Drivers for Loader to report @@ -32,16 +38,19 @@ zeLoaderInit(); /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED +//ZE_DLLEXPORT ze_result_t ZE_APICALL +//zelLoaderDriverCheck(ze_init_flags_t flags, ze_init_driver_type_desc_t* desc, ze_global_dditable_t *globalInitStored, zes_global_dditable_t *sysmanGlobalInitStored, bool *requireDdiReinit, bool sysmanOnly); ZE_DLLEXPORT ze_result_t ZE_APICALL -//zelLoaderDriverCheck(ze_init_flags_t flags); -zelLoaderDriverCheck(ze_init_flags_t flags, void *globalInitStored, void *sysmanGlobalInitStored, bool *requireDdiReinit, bool sysmanOnly); +zelLoaderDriverCheck(ze_init_flags_t flags, ze_init_driver_type_desc_t* desc, ze_global_dditable_t *globalInitStored, void *sysmanGlobalInitStored, bool *requireDdiReinit, bool sysmanOnly); + /////////////////////////////////////////////////////////////////////////////// -/// @brief Internal function for Setting the ddi tables for the Tracing Layer. +/// @brief Internal function for Setting the ddi table for the Tracing Layer. /// +//ZE_DLLEXPORT ze_result_t ZE_APICALL +//zelLoaderTracingLayerInit(std::atomic &zeDdiTable); ZE_DLLEXPORT ze_result_t ZE_APICALL -//zelLoaderTracingLayerInit(std::atomic &zeDdiTable, std::atomic &zetDdiTable, std::atomic &zesDdiTable); -zelLoaderTracingLayerInit(void *zeDdiTable, void *zetDdiTable, void *zesDdiTable); +zelLoaderTracingLayerInit(void* zeDdiTable); /////////////////////////////////////////////////////////////////////////////// @@ -52,10 +61,21 @@ zelLoaderTracingLayerInit(void *zeDdiTable, void *zetDdiTable, void *zesDdiTable ZE_DLLEXPORT HMODULE ZE_APICALL zeLoaderGetTracingHandle(); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get pointer to Loader Context +/// +/// @returns +/// - ::handle to tracing library +//ZE_DLLEXPORT loader::context_t *ZE_APICALL +//zelLoaderGetContext(); +ZE_DLLEXPORT void *ZE_APICALL +zelLoaderGetContext(); + /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for getting version /// +// Aurora loader doesn't export it for some reason ZE_DLLEXPORT ze_result_t ZE_APICALL zelLoaderGetVersion(zel_component_version_t *version); diff --git a/backends/ze/include/loader/ze_loader_api_ze_namespace.h b/backends/ze/include/loader/ze_loader_api_ze_namespace.h new file mode 100644 index 000000000..a365c4bd6 --- /dev/null +++ b/backends/ze/include/loader/ze_loader_api_ze_namespace.h @@ -0,0 +1,14 @@ +// Manualy created! +// Moving `ze` Namespace here from `ze_loader_api.h` +#include "../ze_api.h" + +// Moved to `ze_loader_api_ze_namespace.h` +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for initializing loader +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeLoaderInit(); + diff --git a/backends/ze/include/loader/ze_loader_internal.h b/backends/ze/include/loader/ze_loader_internal.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/backends/ze/include/ze_api.h b/backends/ze/include/ze_api.h index 2f59f4bbc..03d12d036 100644 --- a/backends/ze/include/ze_api.h +++ b/backends/ze/include/ze_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file ze_api.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_API_H @@ -248,8 +248,16 @@ typedef enum _ze_result_t ZE_RESULT_ERROR_OVERLAPPING_REGIONS = 0x7800001a, ///< [Validation] copy operations do not support overlapping regions of ///< memory ZE_RESULT_WARNING_ACTION_REQUIRED = 0x7800001b, ///< [Sysman] an action is required to complete the desired operation + ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE = 0x7800001c, ///< [Core, Validation] kernel handle is invalid for the operation + ZE_RESULT_EXT_RTAS_BUILD_RETRY = 0x7800001d, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< failed due to insufficient resources, retry with a larger acceleration + ///< structure buffer allocation + ZE_RESULT_EXT_RTAS_BUILD_DEFERRED = 0x7800001e, ///< [Core, Extension] ray tracing acceleration structure build operation + ///< deferred to parallel operation join + ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE = 0x7800001f, ///< [Core, Extension] operands of comparison are not compatible + ZE_RESULT_ERROR_SURVIVABILITY_MODE_DETECTED = 0x78000020, ///< [Sysman] device is in survivability mode, firmware update needed ZE_RESULT_ERROR_UNKNOWN = 0x7ffffffe, ///< [Core] unknown or internal error - ZE_RESULT_FORCE_UINT32 = 0x7fffffff + ZE_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RESULT_* ENUMs } ze_result_t; @@ -342,7 +350,23 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_PITCHED_ALLOC_DEVICE_EXP_PROPERTIES = 0x0002001D, ///< ::ze_device_pitched_alloc_exp_properties_t ZE_STRUCTURE_TYPE_BINDLESS_IMAGE_EXP_DESC = 0x0002001E, ///< ::ze_image_bindless_exp_desc_t ZE_STRUCTURE_TYPE_PITCHED_IMAGE_EXP_DESC = 0x0002001F, ///< ::ze_image_pitched_exp_desc_t - ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_STRUCTURE_TYPE_MUTABLE_GRAPH_ARGUMENT_EXP_DESC = 0x00020020, ///< ::ze_mutable_graph_argument_exp_desc_t + ZE_STRUCTURE_TYPE_INIT_DRIVER_TYPE_DESC = 0x00020021, ///< ::ze_init_driver_type_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_EXT_DESC = 0x00020022, ///< ::ze_external_semaphore_ext_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WIN32_EXT_DESC = 0x00020023, ///< ::ze_external_semaphore_win32_ext_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_FD_EXT_DESC = 0x00020024, ///< ::ze_external_semaphore_fd_ext_desc_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXT = 0x00020025, ///< ::ze_external_semaphore_signal_params_ext_t + ZE_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXT = 0x00020026, ///< ::ze_external_semaphore_wait_params_ext_t + ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES = 0x00020027, ///< ::ze_driver_ddi_handles_ext_properties_t + ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT = 0x00020028, ///< ::ze_device_cache_line_size_ext_t + ZE_STRUCTURE_TYPE_DEVICE_VECTOR_WIDTH_PROPERTIES_EXT = 0x00020029, ///< ::ze_device_vector_width_properties_ext_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC = 0x00020030, ///< ::ze_rtas_builder_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_BUILD_OP_EXT_DESC = 0x00020031, ///< ::ze_rtas_builder_build_op_ext_desc_t + ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_PROPERTIES = 0x00020032, ///< ::ze_rtas_builder_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_PARALLEL_OPERATION_EXT_PROPERTIES = 0x00020033, ///< ::ze_rtas_parallel_operation_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES = 0x00020034, ///< ::ze_rtas_device_ext_properties_t + ZE_STRUCTURE_TYPE_RTAS_GEOMETRY_AABBS_EXT_CB_PARAMS = 0x00020035, ///< ::ze_rtas_geometry_aabbs_ext_cb_params_t + ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_STRUCTURE_TYPE_* ENUMs } ze_structure_type_t; @@ -360,7 +384,7 @@ typedef enum _ze_external_memory_type_flag_t ///< resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP = ZE_BIT(6), ///< an NT handle referring to a Direct3D 12 heap resource ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE = ZE_BIT(7), ///< an NT handle referring to a Direct3D 12 committed resource - ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_MEMORY_TYPE_FLAG_* ENUMs } ze_external_memory_type_flag_t; @@ -371,7 +395,7 @@ typedef enum _ze_bandwidth_unit_t ZE_BANDWIDTH_UNIT_UNKNOWN = 0, ///< The unit used for bandwidth is unknown ZE_BANDWIDTH_UNIT_BYTES_PER_NANOSEC = 1, ///< Bandwidth is provided in bytes/nanosec ZE_BANDWIDTH_UNIT_BYTES_PER_CLOCK = 2, ///< Bandwidth is provided in bytes/clock - ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_BANDWIDTH_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BANDWIDTH_UNIT_* ENUMs } ze_bandwidth_unit_t; @@ -384,7 +408,7 @@ typedef enum _ze_latency_unit_t ZE_LATENCY_UNIT_CLOCK = 2, ///< Latency is provided in clocks ZE_LATENCY_UNIT_HOP = 3, ///< Latency is provided in hops (normalized so that the lowest latency ///< link has a latency of 1 hop) - ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff + ZE_LATENCY_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LATENCY_UNIT_* ENUMs } ze_latency_unit_t; @@ -470,6 +494,10 @@ typedef struct _ze_base_properties_t ze_base_properties_t; /// @brief Forward-declare ze_base_desc_t typedef struct _ze_base_desc_t ze_base_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_init_driver_type_desc_t +typedef struct _ze_init_driver_type_desc_t ze_init_driver_type_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_driver_uuid_t typedef struct _ze_driver_uuid_t ze_driver_uuid_t; @@ -682,6 +710,110 @@ typedef struct _ze_float_atomic_ext_properties_t ze_float_atomic_ext_properties_ /// @brief Forward-declare ze_relaxed_allocation_limits_exp_desc_t typedef struct _ze_relaxed_allocation_limits_exp_desc_t ze_relaxed_allocation_limits_exp_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_driver_ddi_handles_ext_properties_t +typedef struct _ze_driver_ddi_handles_ext_properties_t ze_driver_ddi_handles_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_ext_desc_t +typedef struct _ze_external_semaphore_ext_desc_t ze_external_semaphore_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_win32_ext_desc_t +typedef struct _ze_external_semaphore_win32_ext_desc_t ze_external_semaphore_win32_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_fd_ext_desc_t +typedef struct _ze_external_semaphore_fd_ext_desc_t ze_external_semaphore_fd_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_signal_params_ext_t +typedef struct _ze_external_semaphore_signal_params_ext_t ze_external_semaphore_signal_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_external_semaphore_wait_params_ext_t +typedef struct _ze_external_semaphore_wait_params_ext_t ze_external_semaphore_wait_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_cache_line_size_ext_t +typedef struct _ze_device_cache_line_size_ext_t ze_device_cache_line_size_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_ext_desc_t +typedef struct _ze_rtas_builder_ext_desc_t ze_rtas_builder_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_ext_properties_t +typedef struct _ze_rtas_builder_ext_properties_t ze_rtas_builder_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_parallel_operation_ext_properties_t +typedef struct _ze_rtas_parallel_operation_ext_properties_t ze_rtas_parallel_operation_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_device_ext_properties_t +typedef struct _ze_rtas_device_ext_properties_t ze_rtas_device_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_float3_ext_t +typedef struct _ze_rtas_float3_ext_t ze_rtas_float3_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_column_major_ext_t +typedef struct _ze_rtas_transform_float3x4_column_major_ext_t ze_rtas_transform_float3x4_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_aligned_column_major_ext_t +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t ze_rtas_transform_float3x4_aligned_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_transform_float3x4_row_major_ext_t +typedef struct _ze_rtas_transform_float3x4_row_major_ext_t ze_rtas_transform_float3x4_row_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_aabb_ext_t +typedef struct _ze_rtas_aabb_ext_t ze_rtas_aabb_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_triangle_indices_uint32_ext_t +typedef struct _ze_rtas_triangle_indices_uint32_ext_t ze_rtas_triangle_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_quad_indices_uint32_ext_t +typedef struct _ze_rtas_quad_indices_uint32_ext_t ze_rtas_quad_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_geometry_info_ext_t +typedef struct _ze_rtas_builder_geometry_info_ext_t ze_rtas_builder_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_triangles_geometry_info_ext_t +typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t ze_rtas_builder_triangles_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_quads_geometry_info_ext_t +typedef struct _ze_rtas_builder_quads_geometry_info_ext_t ze_rtas_builder_quads_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_geometry_aabbs_ext_cb_params_t +typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_t ze_rtas_geometry_aabbs_ext_cb_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_procedural_geometry_info_ext_t +typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t ze_rtas_builder_procedural_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_instance_geometry_info_ext_t +typedef struct _ze_rtas_builder_instance_geometry_info_ext_t ze_rtas_builder_instance_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_rtas_builder_build_op_ext_desc_t +typedef struct _ze_rtas_builder_build_op_ext_desc_t ze_rtas_builder_build_op_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_vector_width_properties_ext_t +typedef struct _ze_device_vector_width_properties_ext_t ze_device_vector_width_properties_ext_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_cache_reservation_ext_desc_t typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; @@ -934,6 +1066,10 @@ typedef struct _ze_mutable_group_size_exp_desc_t ze_mutable_group_size_exp_desc_ /// @brief Forward-declare ze_mutable_global_offset_exp_desc_t typedef struct _ze_mutable_global_offset_exp_desc_t ze_mutable_global_offset_exp_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_mutable_graph_argument_exp_desc_t +typedef struct _ze_mutable_graph_argument_exp_desc_t ze_mutable_graph_argument_exp_desc_t; + #if !defined(__GNUC__) #pragma endregion @@ -949,7 +1085,7 @@ typedef enum _ze_init_flag_t { ZE_INIT_FLAG_GPU_ONLY = ZE_BIT(0), ///< only initialize GPU drivers ZE_INIT_FLAG_VPU_ONLY = ZE_BIT(1), ///< only initialize VPU drivers - ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_INIT_FLAG_* ENUMs } ze_init_flag_t; @@ -957,8 +1093,9 @@ typedef enum _ze_init_flag_t /// @brief Initialize the 'oneAPI' driver(s) /// /// @details -/// - The application must call this function before calling any other -/// function. +/// - @deprecated since 1.10. Please use zeInitDrivers() +/// - The application must call this function or zeInitDrivers before +/// calling any other function. /// - If this function is not called then all other functions will return /// ::ZE_RESULT_ERROR_UNINITIALIZED. /// - Only one instance of each driver will be initialized per process. @@ -988,6 +1125,10 @@ zeInit( /// @brief Retrieves driver instances /// /// @details +/// - @deprecated since 1.10. Please use zeInitDrivers() +/// - Usage of zeInitDrivers and zeDriverGet is mutually exclusive and +/// should not be used together. Usage of them together will result in +/// undefined behavior. /// - A driver represents a collection of physical devices. /// - Multiple calls to this function will return identical driver handles, /// in the same order. @@ -1020,6 +1161,105 @@ zeDriverGet( ///< shall only retrieve that number of drivers. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported driver initialization type flags +/// +/// @details +/// - Bit Field which details the driver types to be initialized and +/// returned to the user. +/// - Value Definition: +/// - 0, do not init or retrieve any drivers. +/// - ZE_INIT_DRIVER_TYPE_FLAG_GPU, GPU Drivers are Init and driver handles +/// retrieved. +/// - ZE_INIT_DRIVER_TYPE_FLAG_NPU, NPU Drivers are Init and driver handles +/// retrieved. +/// - ZE_INIT_DRIVER_TYPE_FLAG_GPU | ZE_INIT_DRIVER_TYPE_FLAG_NPU, NPU & GPU +/// Drivers are Init and driver handles retrieved. +/// - UINT32_MAX All Drivers of any type are Init and driver handles +/// retrieved. +typedef uint32_t ze_init_driver_type_flags_t; +typedef enum _ze_init_driver_type_flag_t +{ + ZE_INIT_DRIVER_TYPE_FLAG_GPU = ZE_BIT(0), ///< initialize and retrieve GPU drivers + ZE_INIT_DRIVER_TYPE_FLAG_NPU = ZE_BIT(1), ///< initialize and retrieve NPU drivers + ZE_INIT_DRIVER_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_INIT_DRIVER_TYPE_FLAG_* ENUMs + +} ze_init_driver_type_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Init Driver Type descriptor +typedef struct _ze_init_driver_type_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_init_driver_type_flags_t flags; ///< [in] driver type init flags. + ///< must be a valid combination of ::ze_init_driver_type_flag_t or UINT32_MAX; + ///< driver types are init and retrieved based on these init flags in zeInitDrivers(). + +} ze_init_driver_type_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Initialize the 'oneAPI' driver(s) based on the driver types requested +/// and retrieve the driver handles. +/// +/// @details +/// - The application must call this function or zeInit before calling any +/// other function. (zeInit is [Deprecated] and is replaced by +/// zeInitDrivers) +/// - Calls to zeInit[Deprecated] or InitDrivers will not alter the drivers +/// retrieved through either api. +/// - Drivers init through zeInit[Deprecated] or InitDrivers will not be +/// reInitialized once init in an application. The Loader will determine +/// if the already init driver needs to be delivered to the user through +/// the init type flags. +/// - Already init Drivers will not be uninitialized if the call to +/// InitDrivers does not include that driver's type. Those init drivers +/// which don't match the init flags will not have their driver handles +/// returned to the user in that InitDrivers call. +/// - If this function or zeInit[Deprecated] is not called, then all other +/// functions will return ::ZE_RESULT_ERROR_UNINITIALIZED. +/// - Only one instance of each driver will be initialized per process. +/// - A driver represents a collection of physical devices. +/// - Multiple calls to this function will return identical driver handles, +/// in the same order. +/// - The drivers returned to the caller will be based on the init types +/// which state the drivers to be included. +/// - The application may pass nullptr for pDrivers when only querying the +/// number of drivers. +/// - The application may call this function multiple times with different +/// flags or environment variables enabled. +/// - The application must call this function after forking new processes. +/// Each forked process must call this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe for scenarios +/// where multiple libraries may initialize the driver(s) simultaneously. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +/// + `nullptr == desc` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x0 == desc->flags` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeInitDrivers( + uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. + ///< if count is zero, then the loader shall update the value with the + ///< total number of drivers available. + ///< if count is greater than the number of drivers available, then the + ///< loader shall update the value with the correct number of drivers available. + ze_driver_handle_t* phDrivers, ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. + ///< if count is less than the number of drivers available, then the loader + ///< shall only retrieve that number of drivers. + ze_init_driver_type_desc_t* desc ///< [in] descriptor containing the driver type initialization details + ///< including ::ze_init_driver_type_flag_t combinations. + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Supported API versions /// @@ -1038,11 +1278,21 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_7 = ZE_MAKE_VERSION( 1, 7 ), ///< version 1.7 ZE_API_VERSION_1_8 = ZE_MAKE_VERSION( 1, 8 ), ///< version 1.8 ZE_API_VERSION_1_9 = ZE_MAKE_VERSION( 1, 9 ), ///< version 1.9 - ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 9 ), ///< latest known version - ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_API_VERSION_1_10 = ZE_MAKE_VERSION( 1, 10 ), ///< version 1.10 + ZE_API_VERSION_1_11 = ZE_MAKE_VERSION( 1, 11 ), ///< version 1.11 + ZE_API_VERSION_1_12 = ZE_MAKE_VERSION( 1, 12 ), ///< version 1.12 + ZE_API_VERSION_1_13 = ZE_MAKE_VERSION( 1, 13 ), ///< version 1.13 + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 13 ), ///< latest known version + ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_API_VERSION_* ENUMs } ze_api_version_t; +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_API_VERSION_CURRENT_M +/// @brief Current API version as a macro +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 13 ) +#endif // ZE_API_VERSION_CURRENT_M + /////////////////////////////////////////////////////////////////////////////// /// @brief Returns the API version supported by the specified driver /// @@ -1130,7 +1380,7 @@ typedef enum _ze_ipc_property_flag_t ///< ::zeMemGetIpcHandle. ZE_IPC_PROPERTY_FLAG_EVENT_POOL = ZE_BIT(1), ///< Supports passing event pools between processes. See ///< ::zeEventPoolGetIpcHandle. - ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_PROPERTY_FLAG_* ENUMs } ze_ipc_property_flag_t; @@ -1397,7 +1647,7 @@ typedef enum _ze_device_type_t ZE_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZE_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZE_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_TYPE_* ENUMs } ze_device_type_t; @@ -1430,7 +1680,7 @@ typedef enum _ze_device_property_flag_t ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZE_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_PROPERTY_FLAG_* ENUMs } ze_device_property_flag_t; @@ -1594,7 +1844,7 @@ typedef enum _ze_device_module_flag_t ZE_DEVICE_MODULE_FLAG_FP64 = ZE_BIT(1), ///< Device supports 64-bit floating-point operations ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS = ZE_BIT(2), ///< Device supports 64-bit atomic operations ZE_DEVICE_MODULE_FLAG_DP4A = ZE_BIT(3), ///< Device supports four component dot product and accumulate operations - ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MODULE_FLAG_* ENUMs } ze_device_module_flag_t; @@ -1612,7 +1862,7 @@ typedef enum _ze_device_fp_flag_t ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT = ZE_BIT(6), ///< Supports rounding as defined by IEEE754 for divide and sqrt ///< operations. ZE_DEVICE_FP_FLAG_SOFT_FLOAT = ZE_BIT(7), ///< Uses software implementation for basic floating-point operations. - ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_FLAG_* ENUMs } ze_device_fp_flag_t; @@ -1680,7 +1930,7 @@ typedef enum _ze_command_queue_group_property_flag_t ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS = ZE_BIT(2), ///< Command queue group supports cooperative kernels. ///< See ::zeCommandListAppendLaunchCooperativeKernel for more details. ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS = ZE_BIT(3), ///< Command queue groups supports metric queries. - ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_* ENUMs } ze_command_queue_group_property_flag_t; @@ -1749,7 +1999,7 @@ typedef uint32_t ze_device_memory_property_flags_t; typedef enum _ze_device_memory_property_flag_t { ZE_DEVICE_MEMORY_PROPERTY_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTY_FLAG_* ENUMs } ze_device_memory_property_flag_t; @@ -1825,7 +2075,7 @@ typedef enum _ze_memory_access_cap_flag_t ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC = ZE_BIT(1), ///< Supports atomic access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT = ZE_BIT(2), ///< Supports concurrent access ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC = ZE_BIT(3), ///< Supports concurrent atomic access - ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_CAP_FLAG_* ENUMs } ze_memory_access_cap_flag_t; @@ -1883,7 +2133,7 @@ typedef uint32_t ze_device_cache_property_flags_t; typedef enum _ze_device_cache_property_flag_t { ZE_DEVICE_CACHE_PROPERTY_FLAG_USER_CONTROL = ZE_BIT(0), ///< Device support User Cache Control (i.e. SLM section vs Generic Cache) - ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_CACHE_PROPERTY_FLAG_* ENUMs } ze_device_cache_property_flag_t; @@ -2031,7 +2281,7 @@ typedef enum _ze_device_p2p_property_flag_t { ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS = ZE_BIT(0), ///< Device supports access between peer devices. ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS = ZE_BIT(1), ///< Device supports atomics between peer devices. - ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_P2P_PROPERTY_FLAG_* ENUMs } ze_device_p2p_property_flag_t; @@ -2159,13 +2409,15 @@ zeDeviceGetStatus( /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == hostTimestamp` /// + `nullptr == deviceTimestamp` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + The feature is not supported by the underlying platform. ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps( ze_device_handle_t hDevice, ///< [in] handle of the device uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the - ///< Device's global timestamp value + ///< Device's global timestamp value. uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the - ///< Host's global timestamp value + ///< Host's global timestamp value. ); #if !defined(__GNUC__) @@ -2181,7 +2433,7 @@ typedef uint32_t ze_context_flags_t; typedef enum _ze_context_flag_t { ZE_CONTEXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CONTEXT_FLAG_* ENUMs } ze_context_flag_t; @@ -2336,6 +2588,8 @@ typedef enum _ze_command_queue_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** as flag + ///< ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. ZE_COMMAND_QUEUE_FLAG_IN_ORDER = ZE_BIT(1), ///< To be used only when creating immediate command lists. Commands ///< appended to the immediate command ///< list are executed in-order, with driver implementation enforcing @@ -2345,7 +2599,7 @@ typedef enum _ze_command_queue_flag_t ///< the next to define an in-order list, and application is allowed to ///< pass signal and wait events ///< to each appended command to implement more complex dependency graphs. - ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_FLAG_* ENUMs } ze_command_queue_flag_t; @@ -2358,7 +2612,7 @@ typedef enum _ze_command_queue_mode_t ///< Host thread is blocked using wait on implicit synchronization object ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS = 2, ///< Device execution is scheduled and will complete in future; ///< explicit synchronization object must be used to determine completeness - ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_MODE_* ENUMs } ze_command_queue_mode_t; @@ -2369,7 +2623,7 @@ typedef enum _ze_command_queue_priority_t ZE_COMMAND_QUEUE_PRIORITY_NORMAL = 0, ///< [default] normal priority ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW = 1, ///< lower priority than normal ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH = 2, ///< higher priority than normal - ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_QUEUE_PRIORITY_* ENUMs } ze_command_queue_priority_t; @@ -2382,7 +2636,7 @@ typedef struct _ze_command_queue_desc_t ///< structure (i.e. contains stype and pNext). uint32_t ordinal; ///< [in] command queue group ordinal uint32_t index; ///< [in] command queue index within the group; - ///< must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set + ///< must be zero. ze_command_queue_flags_t flags; ///< [in] usage flags. ///< must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; ///< default behavior may use implicit driver-based heuristics to balance @@ -2613,6 +2867,8 @@ typedef enum _ze_command_list_flag_t ///< work across multiple engines. ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. + ///< This flag is **DEPRECATED** and implementations are not expected to + ///< support this feature. ZE_COMMAND_LIST_FLAG_IN_ORDER = ZE_BIT(3), ///< commands appended to this command list are executed in-order, with ///< driver implementation ///< enforcing dependencies between them. Application is not required to @@ -2624,7 +2880,7 @@ typedef enum _ze_command_list_flag_t ///< more complex dependency graphs. Cannot be combined with ::ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING. ZE_COMMAND_LIST_FLAG_EXP_CLONEABLE = ZE_BIT(4), ///< this command list may be cloned using ::zeCommandListCreateCloneExp ///< after ::zeCommandListClose. - ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_LIST_FLAG_* ENUMs } ze_command_list_flag_t; @@ -3614,7 +3870,7 @@ typedef enum _ze_memory_advice_t ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION = 8, ///< hint that the preferred memory location is host memory ZE_MEMORY_ADVICE_CLEAR_SYSTEM_MEMORY_PREFERRED_LOCATION = 9, ///< removes the effect of ///< ::ZE_MEMORY_ADVICE_SET_SYSTEM_MEMORY_PREFERRED_LOCATION - ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ADVICE_* ENUMs } ze_memory_advice_t; @@ -3682,7 +3938,7 @@ typedef enum _ze_event_pool_flag_t ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP = ZE_BIT(3), ///< Indicates all events in pool will contain kernel timestamps ///< synchronized to host time domain; cannot be combined with ///< ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP - ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_POOL_FLAG_* ENUMs } ze_event_pool_flag_t; @@ -3778,7 +4034,7 @@ typedef enum _ze_event_scope_flag_t ///< device access and peer device access ZE_EVENT_SCOPE_FLAG_HOST = ZE_BIT(2), ///< cache hierarchies are flushed or invalidated sufficient for device and ///< host access - ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_SCOPE_FLAG_* ENUMs } ze_event_scope_flag_t; @@ -4452,7 +4708,7 @@ typedef uint32_t ze_fence_flags_t; typedef enum _ze_fence_flag_t { ZE_FENCE_FLAG_SIGNALED = ZE_BIT(0), ///< fence is created in the signaled state, otherwise not signaled. - ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FENCE_FLAG_* ENUMs } ze_fence_flag_t; @@ -4632,7 +4888,7 @@ typedef enum _ze_image_flag_t { ZE_IMAGE_FLAG_KERNEL_WRITE = ZE_BIT(0), ///< kernels will write contents ZE_IMAGE_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache contents - ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FLAG_* ENUMs } ze_image_flag_t; @@ -4646,7 +4902,7 @@ typedef enum _ze_image_type_t ZE_IMAGE_TYPE_2DARRAY = 3, ///< 2D array ZE_IMAGE_TYPE_3D = 4, ///< 3D ZE_IMAGE_TYPE_BUFFER = 5, ///< Buffer - ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_TYPE_* ENUMs } ze_image_type_t; @@ -4700,7 +4956,7 @@ typedef enum _ze_image_format_layout_t ZE_IMAGE_FORMAT_LAYOUT_8_8_8 = 43, ///< 3-component 8-bit layout ZE_IMAGE_FORMAT_LAYOUT_16_16_16 = 44, ///< 3-component 16-bit layout ZE_IMAGE_FORMAT_LAYOUT_32_32_32 = 45, ///< 3-component 32-bit layout - ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_LAYOUT_* ENUMs } ze_image_format_layout_t; @@ -4713,7 +4969,7 @@ typedef enum _ze_image_format_type_t ZE_IMAGE_FORMAT_TYPE_UNORM = 2, ///< Unsigned normalized integer ZE_IMAGE_FORMAT_TYPE_SNORM = 3, ///< Signed normalized integer ZE_IMAGE_FORMAT_TYPE_FLOAT = 4, ///< Float - ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_TYPE_* ENUMs } ze_image_format_type_t; @@ -4728,7 +4984,7 @@ typedef enum _ze_image_format_swizzle_t ZE_IMAGE_FORMAT_SWIZZLE_0 = 4, ///< Zero ZE_IMAGE_FORMAT_SWIZZLE_1 = 5, ///< One ZE_IMAGE_FORMAT_SWIZZLE_X = 6, ///< Don't care - ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_FORMAT_SWIZZLE_* ENUMs } ze_image_format_swizzle_t; @@ -4793,7 +5049,7 @@ typedef enum _ze_image_sampler_filter_flag_t { ZE_IMAGE_SAMPLER_FILTER_FLAG_POINT = ZE_BIT(0), ///< device supports point filtering ZE_IMAGE_SAMPLER_FILTER_FLAG_LINEAR = ZE_BIT(1), ///< device supports linear filtering - ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_SAMPLER_FILTER_FLAG_* ENUMs } ze_image_sampler_filter_flag_t; @@ -4915,7 +5171,7 @@ typedef enum _ze_device_mem_alloc_flag_t ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(2), ///< optimize shared allocation for first access on the device - ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEM_ALLOC_FLAG_* ENUMs } ze_device_mem_alloc_flag_t; @@ -4943,7 +5199,7 @@ typedef enum _ze_host_mem_alloc_flag_t ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< host should not cache allocation (UC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = ZE_BIT(2), ///< host memory should be allocated write-combined (WC) ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(3), ///< optimize shared allocation for first access on the host - ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_HOST_MEM_ALLOC_FLAG_* ENUMs } ze_host_mem_alloc_flag_t; @@ -5108,8 +5364,11 @@ zeMemAllocHost( /// @details /// - The application must ensure the device is not currently referencing /// the memory before it is freed -/// - The implementation of this function may immediately free all Host and -/// Device allocations associated with this memory +/// - The implementation will use the default and immediate policy to +/// schedule all Host and Device allocations associated with this memory +/// to be freed, without any safety checking. Actual freeing of memory is +/// specific to user mode driver and kernel mode driver implementation and +/// may be done asynchronously. /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -5138,7 +5397,7 @@ typedef enum _ze_memory_type_t ZE_MEMORY_TYPE_HOST = 1, ///< the memory pointed to is a host allocation ZE_MEMORY_TYPE_DEVICE = 2, ///< the memory pointed to is a device allocation ZE_MEMORY_TYPE_SHARED = 3, ///< the memory pointed to is a shared ownership allocation - ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_TYPE_* ENUMs } ze_memory_type_t; @@ -5330,7 +5589,7 @@ typedef enum _ze_ipc_memory_flag_t { ZE_IPC_MEMORY_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) - ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IPC_MEMORY_FLAG_* ENUMs } ze_ipc_memory_flag_t; @@ -5531,7 +5790,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_SYSTEM_ATOMICS = ZE_BIT(6), ///< Concurrent atomics on the pointer from both host and device are ///< allowed. Requires ::ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC ///< returned by ::zeDeviceGetMemoryAccessProperties. - ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ATOMIC_ATTR_EXP_FLAG_* ENUMs } ze_memory_atomic_attr_exp_flag_t; @@ -5545,7 +5804,7 @@ typedef enum _ze_memory_atomic_attr_exp_flag_t /// passed in hDevice, then the atomic attributes are set in all devices /// associated with the allocation. /// - If the atomic access attribute select is not supported by the driver, -/// ::ZE_RESULT_INVALID_ARGUMENT is returned. +/// ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. /// - The atomic access attribute may be only supported at a device-specific /// granularity, such as at a page boundary. In this case, the memory range /// may be expanded such that the start and end of the range satisfy granularity @@ -5624,7 +5883,7 @@ typedef enum _ze_module_format_t { ZE_MODULE_FORMAT_IL_SPIRV = 0, ///< Format is SPIRV IL format ZE_MODULE_FORMAT_NATIVE = 1, ///< Format is device native format - ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_FORMAT_* ENUMs } ze_module_format_t; @@ -5949,7 +6208,7 @@ typedef enum _ze_module_property_flag_t { ZE_MODULE_PROPERTY_FLAG_IMPORTS = ZE_BIT(0), ///< Module has imports (i.e. imported global variables and/or kernels). ///< See ::zeModuleDynamicLink. - ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROPERTY_FLAG_* ENUMs } ze_module_property_flag_t; @@ -5995,7 +6254,7 @@ typedef enum _ze_kernel_flag_t ZE_KERNEL_FLAG_FORCE_RESIDENCY = ZE_BIT(0), ///< force all device allocations to be resident during execution ZE_KERNEL_FLAG_EXPLICIT_RESIDENCY = ZE_BIT(1), ///< application is responsible for all residency of device allocations. ///< driver may disable implicit residency management. - ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_FLAG_* ENUMs } ze_kernel_flag_t; @@ -6223,7 +6482,7 @@ typedef enum _ze_kernel_indirect_access_flag_t ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST = ZE_BIT(0), ///< Indicates that the kernel accesses host allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE = ZE_BIT(1), ///< Indicates that the kernel accesses device allocations indirectly. ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED = ZE_BIT(2), ///< Indicates that the kernel accesses shared allocations indirectly. - ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_INDIRECT_ACCESS_FLAG_* ENUMs } ze_kernel_indirect_access_flag_t; @@ -6305,10 +6564,14 @@ zeKernelGetSourceAttributes( char** pString ///< [in,out][optional] pointer to application-managed character array ///< (string data). ///< If NULL, the string length of the kernel source attributes, including - ///< a null-terminating character, is returned in pSize. - ///< Otherwise, pString must point to valid application memory that is - ///< greater than or equal to *pSize bytes in length, and on return the - ///< pointed-to string will contain a space-separated list of kernel source attributes. + ///< a null-terminating character, is returned in pSize. Otherwise, pString + ///< must point to valid application memory that is greater than or equal + ///< to *pSize bytes in length, and on return the pointed-to string will + ///< contain a space-separated list of kernel source attributes. Note: This + ///< API was originally intended to ship with a char *pString, however this + ///< typo was introduced. Thus the API has to stay this way for backwards + ///< compatible reasons. It can be corrected in v2.0. Suggestion is to + ///< create your own char *pString and then pass to this API with &pString. ); /////////////////////////////////////////////////////////////////////////////// @@ -6318,7 +6581,7 @@ typedef enum _ze_cache_config_flag_t { ZE_CACHE_CONFIG_FLAG_LARGE_SLM = ZE_BIT(0), ///< Large SLM size ZE_CACHE_CONFIG_FLAG_LARGE_DATA = ZE_BIT(1), ///< Large General Data size - ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CACHE_CONFIG_FLAG_* ENUMs } ze_cache_config_flag_t; @@ -6677,7 +6940,7 @@ typedef enum _ze_module_program_exp_version_t { ZE_MODULE_PROGRAM_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_MODULE_PROGRAM_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MODULE_PROGRAM_EXP_VERSION_* ENUMs } ze_module_program_exp_version_t; @@ -6730,7 +6993,7 @@ typedef enum _ze_raytracing_ext_version_t { ZE_RAYTRACING_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RAYTRACING_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_EXT_VERSION_* ENUMs } ze_raytracing_ext_version_t; @@ -6740,7 +7003,7 @@ typedef uint32_t ze_device_raytracing_ext_flags_t; typedef enum _ze_device_raytracing_ext_flag_t { ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY = ZE_BIT(0), ///< Supports rayquery - ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_RAYTRACING_EXT_FLAG_* ENUMs } ze_device_raytracing_ext_flag_t; @@ -6766,7 +7029,7 @@ typedef uint32_t ze_raytracing_mem_alloc_ext_flags_t; typedef enum _ze_raytracing_mem_alloc_ext_flag_t { ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use - ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_* ENUMs } ze_raytracing_mem_alloc_ext_flag_t; @@ -6928,7 +7191,7 @@ typedef enum _ze_sampler_address_mode_t ///< 0.0f, 0.0f, 0.0f) if image format swizzle contains alpha, otherwise ///< (0.0f, 0.0f, 0.0f, 1.0f). ZE_SAMPLER_ADDRESS_MODE_MIRROR = 4, ///< Out-of-bounds coordinates are mirrored starting from edge. - ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_ADDRESS_MODE_* ENUMs } ze_sampler_address_mode_t; @@ -6938,7 +7201,7 @@ typedef enum _ze_sampler_filter_mode_t { ZE_SAMPLER_FILTER_MODE_NEAREST = 0, ///< No coordinate modifications for out of bounds image access. ZE_SAMPLER_FILTER_MODE_LINEAR = 1, ///< Out-of-bounds coordinates are wrapped back around. - ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff + ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SAMPLER_FILTER_MODE_* ENUMs } ze_sampler_filter_mode_t; @@ -7028,7 +7291,7 @@ typedef enum _ze_memory_access_attribute_t ZE_MEMORY_ACCESS_ATTRIBUTE_NONE = 0, ///< Indicates the memory page is inaccessible. ZE_MEMORY_ACCESS_ATTRIBUTE_READWRITE = 1, ///< Indicates the memory page supports read write access. ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY = 2, ///< Indicates the memory page supports read-only access. - ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_ACCESS_ATTRIBUTE_* ENUMs } ze_memory_access_attribute_t; @@ -7134,8 +7397,9 @@ zeVirtualMemQueryPageSize( typedef uint32_t ze_physical_mem_flags_t; typedef enum _ze_physical_mem_flag_t { - ZE_PHYSICAL_MEM_FLAG_TBD = ZE_BIT(0), ///< reserved for future use. - ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_DEVICE = ZE_BIT(0), ///< [default] allocate physical device memory. + ZE_PHYSICAL_MEM_FLAG_ALLOCATE_ON_HOST = ZE_BIT(1), ///< Allocate physical host memory instead. + ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_PHYSICAL_MEM_FLAG_* ENUMs } ze_physical_mem_flag_t; @@ -7147,7 +7411,8 @@ typedef struct _ze_physical_mem_desc_t const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). ze_physical_mem_flags_t flags; ///< [in] creation flags. - ///< must be 0 (default) or a valid combination of ::ze_physical_mem_flag_t. + ///< must be 0 (default) or a valid combination of + ///< ::ze_physical_mem_flag_t; default is to create physical device memory. size_t size; ///< [in] size in bytes to reserve; must be page aligned. } ze_physical_mem_desc_t; @@ -7158,7 +7423,9 @@ typedef struct _ze_physical_mem_desc_t /// @details /// - The application must only use the physical memory object on the /// context for which it was created. -/// - The size must be page aligned. See ::zeVirtualMemQueryPageSize. +/// - The size must be page aligned. For host memory, the operating system +/// page size should be used. For device memory, see +/// ::zeVirtualMemQueryPageSize. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -7175,14 +7442,15 @@ typedef struct _ze_physical_mem_desc_t /// + `nullptr == desc` /// + `nullptr == phPhysicalMemory` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1 < desc->flags` +/// + `0x3 < desc->flags` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE /// + `0 == desc->size` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT ZE_APIEXPORT ze_result_t ZE_APICALL zePhysicalMemCreate( ze_context_handle_t hContext, ///< [in] handle of the context object - ze_device_handle_t hDevice, ///< [in] handle of the device object + ze_device_handle_t hDevice, ///< [in] handle of the device object, can be `nullptr` if creating + ///< physical host memory. ze_physical_mem_desc_t* desc, ///< [in] pointer to physical memory descriptor. ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created ); @@ -7380,7 +7648,7 @@ typedef enum _ze_float_atomics_ext_version_t { ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_FLOAT_ATOMICS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FLOAT_ATOMICS_EXT_VERSION_* ENUMs } ze_float_atomics_ext_version_t; @@ -7395,7 +7663,7 @@ typedef enum _ze_device_fp_atomic_ext_flag_t ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE = ZE_BIT(16), ///< Supports atomic load, store, and exchange ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_ADD = ZE_BIT(17), ///< Supports atomic add and subtract ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX = ZE_BIT(18), ///< Supports atomic min and max - ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_FP_ATOMIC_EXT_FLAG_* ENUMs } ze_device_fp_atomic_ext_flag_t; @@ -7438,7 +7706,7 @@ typedef enum _ze_global_offset_exp_version_t { ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_GLOBAL_OFFSET_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_GLOBAL_OFFSET_EXP_VERSION_* ENUMs } ze_global_offset_exp_version_t; @@ -7487,7 +7755,7 @@ typedef enum _ze_relaxed_allocation_limits_exp_version_t { ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_* ENUMs } ze_relaxed_allocation_limits_exp_version_t; @@ -7498,7 +7766,7 @@ typedef enum _ze_relaxed_allocation_limits_exp_flag_t { ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE = ZE_BIT(0), ///< Allocation size may exceed the `maxMemAllocSize` member of ///< ::ze_device_properties_t. - ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_* ENUMs } ze_relaxed_allocation_limits_exp_flag_t; @@ -7524,70 +7792,221 @@ typedef struct _ze_relaxed_allocation_limits_exp_desc_t #if !defined(__GNUC__) #pragma endregion #endif -// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +// Intel 'oneAPI' Level-Zero Extension for retrieving kernel binary program data. #if !defined(__GNUC__) -#pragma region cacheReservation +#pragma region kernelBinary #endif /////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_CACHE_RESERVATION_EXT_NAME -/// @brief Cache_Reservation Extension Name -#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" -#endif // ZE_CACHE_RESERVATION_EXT_NAME +#ifndef ZE_GET_KERNEL_BINARY_EXP_NAME +/// @brief Get Kernel Binary Extension Name +#define ZE_GET_KERNEL_BINARY_EXP_NAME "ZE_extension_kernel_binary_exp" +#endif // ZE_GET_KERNEL_BINARY_EXP_NAME /////////////////////////////////////////////////////////////////////////////// -/// @brief Cache_Reservation Extension Version(s) -typedef enum _ze_cache_reservation_ext_version_t +/// @brief Get Kernel Binary Extension Version(s) +typedef enum _ze_kernel_get_binary_exp_version_t { - ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_GET_BINARY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_KERNEL_GET_BINARY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_KERNEL_GET_BINARY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_GET_BINARY_EXP_VERSION_* ENUMs -} ze_cache_reservation_ext_version_t; +} ze_kernel_get_binary_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Cache Reservation Region -typedef enum _ze_cache_ext_region_t +/// @brief Retrieves kernel binary program data (ISA GEN format). +/// +/// @details +/// - A valid kernel handle must be created with ::zeKernelCreate. +/// - Returns Intel Graphics Assembly (GEN ISA) format binary program data +/// for kernel handle. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pSize` +/// + `nullptr == pKernelBinary` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeKernelGetBinaryExp( + ze_kernel_handle_t hKernel, ///< [in] Kernel handle. + size_t* pSize, ///< [in,out] pointer to variable with size of GEN ISA binary. + uint8_t* pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for Driver Direct Device Interface (DDI) Handles +#if !defined(__GNUC__) +#pragma region driverDDIHandles +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DRIVER_DDI_HANDLES_EXT_NAME +/// @brief Driver Direct Device Interface (DDI) Handles Extension Name +#define ZE_DRIVER_DDI_HANDLES_EXT_NAME "ZE_extension_driver_ddi_handles" +#endif // ZE_DRIVER_DDI_HANDLES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Driver Direct Device Interface (DDI) Handles Extension Version(s) +typedef enum _ze_driver_ddi_handles_ext_version_t { - ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use - ///< ::ZE_CACHE_EXT_REGION_DEFAULT. - ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use - ///< ::ZE_CACHE_EXT_REGION_RESERVED. - ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use - ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. - ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme - ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region - ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region - ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DRIVER_DDI_HANDLES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DRIVER_DDI_HANDLES_EXT_VERSION_* ENUMs -} ze_cache_ext_region_t; +} ze_driver_ddi_handles_ext_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief CacheReservation structure +/// @brief Driver Direct Device Interface (DDI) Handle Extension Flags +typedef uint32_t ze_driver_ddi_handle_ext_flags_t; +typedef enum _ze_driver_ddi_handle_ext_flag_t +{ + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED = ZE_BIT(0), ///< Driver Supports DDI Handles Extension + ZE_DRIVER_DDI_HANDLE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DRIVER_DDI_HANDLE_EXT_FLAG_* ENUMs + +} ze_driver_ddi_handle_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Driver DDI Handles properties queried using ::zeDriverGetProperties /// /// @details -/// - This structure must be passed to ::zeDeviceGetCacheProperties via the -/// `pNext` member of ::ze_device_cache_properties_t -/// - Used for determining the max cache reservation allowed on device. Size -/// of zero means no reservation available. -typedef struct _ze_cache_reservation_ext_desc_t +/// - This structure may be returned from ::zeDriverGetProperties, via the +/// `pNext` member of ::ze_driver_properties_t. +typedef struct _ze_driver_ddi_handles_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_driver_ddi_handle_ext_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_driver_ddi_handle_ext_flags_t + +} ze_driver_ddi_handles_ext_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for external semaphores +#if !defined(__GNUC__) +#pragma region externalSemaphores +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME +/// @brief External Semaphores Extension Name +#define ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME "ZE_extension_external_semaphores" +#endif // ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphores Extension Version +typedef enum _ze_external_semaphore_ext_version_t +{ + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_* ENUMs + +} ze_external_semaphore_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of external semaphore object +typedef struct _ze_external_semaphore_ext_handle_t *ze_external_semaphore_ext_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphores Type Flags +typedef uint32_t ze_external_semaphore_ext_flags_t; +typedef enum _ze_external_semaphore_ext_flag_t +{ + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_FD = ZE_BIT(0), ///< Semaphore is an Linux opaque file descriptor + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32 = ZE_BIT(1), ///< Semaphore is an opaque Win32 handle for monitored fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_OPAQUE_WIN32_KMT = ZE_BIT(2), ///< Semaphore is an opaque Win32 KMT handle for monitored fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE = ZE_BIT(3), ///< Semaphore is a D3D12 fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D11_FENCE = ZE_BIT(4), ///< Semaphore is a D3D11 fence + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX = ZE_BIT(5), ///< Semaphore is a keyed mutex for Win32 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_KEYED_MUTEX_KMT = ZE_BIT(6), ///< Semaphore is a keyed mutex for Win32 KMT + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_FD = ZE_BIT(7), ///< Semaphore is a Vulkan Timeline semaphore for Linux + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_VK_TIMELINE_SEMAPHORE_WIN32 = ZE_BIT(8), ///< Semaphore is a Vulkan Timeline semaphore for Win32 + ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_* ENUMs + +} ze_external_semaphore_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore Descriptor +typedef struct _ze_external_semaphore_ext_desc_t { ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - size_t maxCacheReservationSize; ///< [out] max cache reservation size + ze_external_semaphore_ext_flags_t flags; ///< [in] The flags describing the type of the semaphore. + ///< must be 0 (default) or a valid combination of ::ze_external_semaphore_ext_flag_t. + ///< When importing a semaphore, pNext should be pointing to one of the + ///< following structures: ::ze_external_semaphore_win32_ext_desc_t or ::ze_external_semaphore_fd_ext_desc_t. -} ze_cache_reservation_ext_desc_t; +} ze_external_semaphore_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Reserve Cache on Device +/// @brief External Semaphore Win32 Descriptor +typedef struct _ze_external_semaphore_win32_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + void* handle; ///< [in] Win32 handle of the semaphore. + ///< Must be a valid Win32 handle. + const char* name; ///< [in] Name of the semaphore. + ///< Must be a valid null-terminated string. + +} ze_external_semaphore_win32_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore FD Descriptor +typedef struct _ze_external_semaphore_fd_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + int fd; ///< [in] File descriptor of the semaphore. + ///< Must be a valid file descriptor. + +} ze_external_semaphore_fd_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore Signal parameters +typedef struct _ze_external_semaphore_signal_params_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t value; ///< [in] [optional] Value to signal. + ///< Specified by user as an expected value with some of semaphore types, + ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. + +} ze_external_semaphore_signal_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief External Semaphore Wait parameters +typedef struct _ze_external_semaphore_wait_params_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t value; ///< [in] [optional] Value to wait for. + ///< Specified by user as an expected value with some of semaphore types, + ///< such as ::ZE_EXTERNAL_SEMAPHORE_EXT_FLAG_D3D12_FENCE. + +} ze_external_semaphore_wait_params_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Import an external semaphore /// /// @details -/// - The application may call this function but may not be successful as -/// some other application may have reserve prior -/// -/// @remarks -/// _Analogues_ -/// - None +/// - Imports an external semaphore. +/// - This function may be called from simultaneous threads with the same +/// device handle. +/// - The implementation of this function should be lock-free. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7597,22 +8016,27 @@ typedef struct _ze_cache_reservation_ext_desc_t /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == phSemaphore` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0x1ff < desc->flags` ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceReserveCacheExt( - ze_device_handle_t hDevice, ///< [in] handle of the device object - size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the - ///< driver shall default to last level of cache and attempt to reserve in - ///< that cache. - size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver - ///< shall remove prior reservation +zeDeviceImportExternalSemaphoreExt( + ze_device_handle_t hDevice, ///< [in] The device handle. + const ze_external_semaphore_ext_desc_t* desc, ///< [in] The pointer to external semaphore descriptor. + ze_external_semaphore_ext_handle_t* phSemaphore ///< [out] The handle of the external semaphore imported. ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Assign VA section to use reserved section +/// @brief Release an external semaphore /// /// @details -/// - The application may call this function to assign VA to particular -/// reservartion region +/// - The application must ensure the device is not currently referencing +/// the semaphore before it is released. +/// - The application must **not** call this function from simultaneous +/// threads with the same semaphore handle. +/// - The implementation of this function must be thread-safe. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7621,13 +8045,1264 @@ zeDeviceReserveCacheExt( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `nullptr == hDevice` -/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == ptr` -/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +/// + `nullptr == hSemaphore` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE ZE_APIEXPORT ze_result_t ZE_APICALL -zeDeviceSetCacheAdviceExt( +zeDeviceReleaseExternalSemaphoreExt( + ze_external_semaphore_ext_handle_t hSemaphore ///< [in] The handle of the external semaphore. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Signal an external semaphore +/// +/// @details +/// - Signals an external semaphore. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phSemaphores` +/// + `nullptr == signalParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == signalParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendSignalExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in][range(0, numSemaphores)] The vector of external semaphore handles + ///< to be appended into command list. + ze_external_semaphore_signal_params_ext_t* signalParams, ///< [in] Signal parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Wait on external semaphores +/// +/// @details +/// - Waits on external semaphores. +/// - This function must only be used with an immediate command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phSemaphores` +/// + `nullptr == waitParams` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +/// + `(nullptr == phSemaphores) && (0 < numSemaphores)` +/// + `(nullptr == waitParams) && (0 < numSemaphores)` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Commandlist handle does not correspond to an immediate command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendWaitExternalSemaphoreExt( + ze_command_list_handle_t hCommandList, ///< [in] The command list handle. + uint32_t numSemaphores, ///< [in] The number of external semaphores. + ze_external_semaphore_ext_handle_t* phSemaphores, ///< [in] [range(0,numSemaphores)] The vector of external semaphore handles + ///< to append into command list. + ze_external_semaphore_wait_params_ext_t* waitParams, ///< [in] Wait parameters. + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for CacheLine Size +#if !defined(__GNUC__) +#pragma region CacheLineSize +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_CACHELINE_SIZE_EXT_NAME +/// @brief CacheLine Size Extension Name +#define ZE_CACHELINE_SIZE_EXT_NAME "ZE_extension_device_cache_line_size" +#endif // ZE_CACHELINE_SIZE_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief CacheLine Size Extension Version(s) +typedef enum _ze_device_cache_line_size_ext_version_t +{ + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_* ENUMs + +} ze_device_cache_line_size_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief CacheLine Size queried using ::zeDeviceGetCacheProperties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetCacheProperties via +/// the `pNext` member of ::ze_device_cache_properties_t. +/// - Used for determining the cache line size supported on a device. +typedef struct _ze_device_cache_line_size_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + size_t cacheLineSize; ///< [out] The cache line size in bytes. + +} ze_device_cache_line_size_ext_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting ray tracing acceleration structure. +#if !defined(__GNUC__) +#pragma region RTAS +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_RTAS_EXT_NAME +/// @brief Ray Tracing Acceleration Structure Extension Name +#define ZE_RTAS_EXT_NAME "ZE_extension_rtas" +#endif // ZE_RTAS_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray Tracing Acceleration Structure Builder Extension Version(s) +typedef enum _ze_rtas_builder_ext_version_t +{ + ZE_RTAS_BUILDER_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_RTAS_BUILDER_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_RTAS_BUILDER_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXT_VERSION_* ENUMs + +} ze_rtas_builder_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure device flags +typedef uint32_t ze_rtas_device_ext_flags_t; +typedef enum _ze_rtas_device_ext_flag_t +{ + ZE_RTAS_DEVICE_EXT_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use + ZE_RTAS_DEVICE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_DEVICE_EXT_FLAG_* ENUMs + +} ze_rtas_device_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure format +/// +/// @details +/// - This is an opaque ray tracing acceleration structure format +/// identifier. +typedef enum _ze_rtas_format_ext_t +{ + ZE_RTAS_FORMAT_EXT_INVALID = 0x0, ///< Invalid acceleration structure format code + ZE_RTAS_FORMAT_EXT_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code + ZE_RTAS_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_FORMAT_EXT_* ENUMs + +} ze_rtas_format_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder flags +typedef uint32_t ze_rtas_builder_ext_flags_t; +typedef enum _ze_rtas_builder_ext_flag_t +{ + ZE_RTAS_BUILDER_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_BUILDER_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXT_FLAG_* ENUMs + +} ze_rtas_builder_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder parallel operation flags +typedef uint32_t ze_rtas_parallel_operation_ext_flags_t; +typedef enum _ze_rtas_parallel_operation_ext_flag_t +{ + ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use + ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXT_FLAG_* ENUMs + +} ze_rtas_parallel_operation_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry flags +typedef uint32_t ze_rtas_builder_geometry_ext_flags_t; +typedef enum _ze_rtas_builder_geometry_ext_flag_t +{ + ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader + ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXT_FLAG_* ENUMs + +} ze_rtas_builder_geometry_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder geometry flags (see +/// ::ze_rtas_builder_geometry_ext_flags_t) +typedef uint8_t ze_rtas_builder_packed_geometry_ext_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance flags +typedef uint32_t ze_rtas_builder_instance_ext_flags_t; +typedef enum _ze_rtas_builder_instance_ext_flag_t +{ + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_CULL_DISABLE = ZE_BIT(0), ///< disables culling of front-facing and back-facing triangles + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = ZE_BIT(1), ///< reverses front and back face of triangles + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_OPAQUE = ZE_BIT(2), ///< forces instanced geometry to be opaque, unless ray flag forces it to + ///< be non-opaque + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it + ///< to be opaque + ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXT_FLAG_* ENUMs + +} ze_rtas_builder_instance_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder instance flags (see +/// ::ze_rtas_builder_instance_ext_flags_t) +typedef uint8_t ze_rtas_builder_packed_instance_ext_flags_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder build operation flags +/// +/// @details +/// - These flags allow the application to tune the acceleration structure +/// build operation. +/// - The acceleration structure builder implementation might choose to use +/// spatial splitting to split large or long primitives into smaller +/// pieces. This may result in any-hit shaders being invoked multiple +/// times for non-opaque primitives, unless +/// ::ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION is specified. +/// - Usage of any of these flags may reduce ray tracing performance. +typedef uint32_t ze_rtas_builder_build_op_ext_flags_t; +typedef enum _ze_rtas_builder_build_op_ext_flag_t +{ + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive + ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXT_FLAG_* ENUMs + +} ze_rtas_builder_build_op_ext_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder build quality hint +/// +/// @details +/// - Depending on use case different quality modes for acceleration +/// structure build are supported. +/// - A low-quality build builds an acceleration structure fast, but at the +/// cost of some reduction in ray tracing performance. This mode is +/// recommended for dynamic content, such as animated characters. +/// - A medium-quality build uses a compromise between build quality and ray +/// tracing performance. This mode should be used by default. +/// - Higher ray tracing performance can be achieved by using a high-quality +/// build, but acceleration structure build performance might be +/// significantly reduced. +typedef enum _ze_rtas_builder_build_quality_hint_ext_t +{ + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW = 0, ///< build low-quality acceleration structure (fast) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH = 2, ///< build high-quality acceleration structure (slow) + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_* ENUMs + +} ze_rtas_builder_build_quality_hint_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry type +typedef enum _ze_rtas_builder_geometry_type_ext_t +{ + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES = 0, ///< triangle mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS = 1, ///< quad mesh geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL = 2, ///< procedural geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE = 3, ///< instance geometry type + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_* ENUMs + +} ze_rtas_builder_geometry_type_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure builder geometry type (see +/// ::ze_rtas_builder_geometry_type_ext_t) +typedef uint8_t ze_rtas_builder_packed_geometry_type_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure data buffer element format +/// +/// @details +/// - Specifies the format of data buffer elements. +/// - Data buffers may contain instancing transform matrices, triangle/quad +/// vertex indices, etc... +typedef enum _ze_rtas_builder_input_data_format_ext_t +{ + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 = 0, ///< 3-component float vector (see ::ze_rtas_float3_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_COLUMN_MAJOR = 1, ///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_column_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ALIGNED_COLUMN_MAJOR = 2,///< 3x4 affine transformation in column-major format (see + ///< ::ze_rtas_transform_float3x4_aligned_column_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3X4_ROW_MAJOR = 3, ///< 3x4 affine transformation in row-major format (see + ///< ::ze_rtas_transform_float3x4_row_major_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_AABB = 4, ///< 3-dimensional axis-aligned bounding-box (see ::ze_rtas_aabb_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see + ///< ::ze_rtas_triangle_indices_uint32_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_ext_t) + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_* ENUMs + +} ze_rtas_builder_input_data_format_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Packed ray tracing acceleration structure data buffer element format +/// (see ::ze_rtas_builder_input_data_format_ext_t) +typedef uint8_t ze_rtas_builder_packed_input_data_format_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder object +typedef struct _ze_rtas_builder_ext_handle_t *ze_rtas_builder_ext_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of ray tracing acceleration structure builder parallel +/// operation object +typedef struct _ze_rtas_parallel_operation_ext_handle_t *ze_rtas_parallel_operation_ext_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder descriptor +typedef struct _ze_rtas_builder_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_builder_ext_version_t builderVersion; ///< [in] ray tracing acceleration structure builder version + +} ze_rtas_builder_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder properties +typedef struct _ze_rtas_builder_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_builder_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder flags + size_t rtasBufferSizeBytesExpected; ///< [out] expected size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is expected to succeed; however, it is possible that the build + ///< may fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY + size_t rtasBufferSizeBytesMaxRequired; ///< [out] worst-case size (in bytes) required for acceleration structure buffer + ///< - When using an acceleration structure buffer of this size, the + ///< build is guaranteed to not run out of memory. + size_t scratchBufferSizeBytes; ///< [out] scratch buffer size (in bytes) required for acceleration + ///< structure build. + +} ze_rtas_builder_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder parallel operation +/// properties +typedef struct _ze_rtas_parallel_operation_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_parallel_operation_ext_flags_t flags; ///< [out] ray tracing acceleration structure builder parallel operation + ///< flags + uint32_t maxConcurrency; ///< [out] maximum number of threads that may join the parallel operation + +} ze_rtas_parallel_operation_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure device properties +/// +/// @details +/// - This structure may be passed to ::zeDeviceGetProperties, via `pNext` +/// member of ::ze_device_properties_t. +/// - The implementation shall populate `format` with a value other than +/// ::ZE_RTAS_FORMAT_EXT_INVALID when the device supports ray tracing. +typedef struct _ze_rtas_device_ext_properties_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_device_ext_flags_t flags; ///< [out] ray tracing acceleration structure device flags + ze_rtas_format_ext_t rtasFormat; ///< [out] ray tracing acceleration structure format + uint32_t rtasBufferAlignment; ///< [out] required alignment of acceleration structure buffer + +} ze_rtas_device_ext_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief A 3-component vector type +typedef struct _ze_rtas_float3_ext_t +{ + float x; ///< [in] x-coordinate of float3 vector + float y; ///< [in] y-coordinate of float3 vector + float z; ///< [in] z-coordinate of float3 vector + +} ze_rtas_float3_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in column-major layout +/// +/// @details +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_column_major_ext_t +{ + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + +} ze_rtas_transform_float3x4_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in column-major layout with aligned column +/// vectors +/// +/// @details +/// - A 3x4 affine transformation in column major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +/// - The column vectors are aligned to 16-bytes and pad members are +/// ignored. +typedef struct _ze_rtas_transform_float3x4_aligned_column_major_ext_t +{ + float vx_x; ///< [in] element 0 of column 0 of 3x4 matrix + float vx_y; ///< [in] element 1 of column 0 of 3x4 matrix + float vx_z; ///< [in] element 2 of column 0 of 3x4 matrix + float pad0; ///< [in] ignored padding + float vy_x; ///< [in] element 0 of column 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of column 1 of 3x4 matrix + float vy_z; ///< [in] element 2 of column 1 of 3x4 matrix + float pad1; ///< [in] ignored padding + float vz_x; ///< [in] element 0 of column 2 of 3x4 matrix + float vz_y; ///< [in] element 1 of column 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of column 2 of 3x4 matrix + float pad2; ///< [in] ignored padding + float p_x; ///< [in] element 0 of column 3 of 3x4 matrix + float p_y; ///< [in] element 1 of column 3 of 3x4 matrix + float p_z; ///< [in] element 2 of column 3 of 3x4 matrix + float pad3; ///< [in] ignored padding + +} ze_rtas_transform_float3x4_aligned_column_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief 3x4 affine transformation in row-major layout +/// +/// @details +/// - A 3x4 affine transformation in row-major layout, consisting of vectors +/// - vx=(vx_x, vx_y, vx_z), +/// - vy=(vy_x, vy_y, vy_z), +/// - vz=(vz_x, vz_y, vz_z), and +/// - p=(p_x, p_y, p_z) +/// - The transformation transforms a point (x, y, z) to: `x*vx + y*vy + +/// z*vz + p`. +typedef struct _ze_rtas_transform_float3x4_row_major_ext_t +{ + float vx_x; ///< [in] element 0 of row 0 of 3x4 matrix + float vy_x; ///< [in] element 1 of row 0 of 3x4 matrix + float vz_x; ///< [in] element 2 of row 0 of 3x4 matrix + float p_x; ///< [in] element 3 of row 0 of 3x4 matrix + float vx_y; ///< [in] element 0 of row 1 of 3x4 matrix + float vy_y; ///< [in] element 1 of row 1 of 3x4 matrix + float vz_y; ///< [in] element 2 of row 1 of 3x4 matrix + float p_y; ///< [in] element 3 of row 1 of 3x4 matrix + float vx_z; ///< [in] element 0 of row 2 of 3x4 matrix + float vy_z; ///< [in] element 1 of row 2 of 3x4 matrix + float vz_z; ///< [in] element 2 of row 2 of 3x4 matrix + float p_z; ///< [in] element 3 of row 2 of 3x4 matrix + +} ze_rtas_transform_float3x4_row_major_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief A 3-dimensional axis-aligned bounding-box with lower and upper bounds +/// in each dimension +typedef struct _ze_rtas_aabb_ext_t +{ + ze_rtas_float3_ext_t lower; ///< [in] lower bounds of AABB + ze_rtas_float3_ext_t upper; ///< [in] upper bounds of AABB + +} ze_rtas_aabb_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Triangle represented using 3 vertex indices +/// +/// @details +/// - Represents a triangle using 3 vertex indices that index into a vertex +/// array that needs to be provided together with the index array. +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_triangle_indices_uint32_ext_t +{ + uint32_t v0; ///< [in] first index pointing to the first triangle vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second triangle vertex in vertex + ///< array + uint32_t v2; ///< [in] third index pointing to the third triangle vertex in vertex array + +} ze_rtas_triangle_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Quad represented using 4 vertex indices +/// +/// @details +/// - Represents a quad composed of 4 indices that index into a vertex array +/// that needs to be provided together with the index array. +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_quad_indices_uint32_ext_t +{ + uint32_t v0; ///< [in] first index pointing to the first quad vertex in vertex array + uint32_t v1; ///< [in] second index pointing to the second quad vertex in vertex array + uint32_t v2; ///< [in] third index pointing to the third quad vertex in vertex array + uint32_t v3; ///< [in] fourth index pointing to the fourth quad vertex in vertex array + +} ze_rtas_quad_indices_uint32_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder geometry info +typedef struct _ze_rtas_builder_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type + +} ze_rtas_builder_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder triangle mesh geometry info +/// +/// @details +/// - The linear barycentric u/v parametrization of the triangle is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, and +/// - (u=0, v=1) at v2 +typedef struct _ze_rtas_builder_triangles_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t triangleFormat; ///< [in] format of triangle buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_TRIANGLE_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 + uint32_t triangleCount; ///< [in] number of triangles in triangle buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t triangleStride; ///< [in] stride (in bytes) of triangles in triangle buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pTriangleBuffer; ///< [in] pointer to array of triangle indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of triangle vertices in specified format + +} ze_rtas_builder_triangles_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder quad mesh geometry info +/// +/// @details +/// - A quad is a triangle pair represented using 4 vertex indices v0, v1, +/// v2, v3. +/// The first triangle is made out of indices v0, v1, v3 and the second triangle +/// from indices v2, v3, v1. The piecewise linear barycentric u/v parametrization +/// of the quad is defined as: +/// - (u=0, v=0) at v0, +/// - (u=1, v=0) at v1, +/// - (u=0, v=1) at v3, and +/// - (u=1, v=1) at v2 +/// This is achieved by correcting the u'/v' coordinates of the second +/// triangle by +/// *u = 1-u'* and *v = 1-v'*, yielding a piecewise linear parametrization. +typedef struct _ze_rtas_builder_quads_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_QUADS + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t quadFormat; ///< [in] format of quad buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_QUAD_INDICES_UINT32 + ze_rtas_builder_packed_input_data_format_ext_t vertexFormat; ///< [in] format of vertex buffer data, must be + ///< ::ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 + uint32_t quadCount; ///< [in] number of quads in quad buffer + uint32_t vertexCount; ///< [in] number of vertices in vertex buffer + uint32_t quadStride; ///< [in] stride (in bytes) of quads in quad buffer + uint32_t vertexStride; ///< [in] stride (in bytes) of vertices in vertex buffer + void* pQuadBuffer; ///< [in] pointer to array of quad indices in specified format + void* pVertexBuffer; ///< [in] pointer to array of quad vertices in specified format + +} ze_rtas_builder_quads_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief AABB callback function parameters +typedef struct _ze_rtas_geometry_aabbs_ext_cb_params_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t primID; ///< [in] first primitive to return bounds for + uint32_t primIDCount; ///< [in] number of primitives to return bounds for + void* pGeomUserPtr; ///< [in] pointer provided through geometry descriptor + void* pBuildUserPtr; ///< [in] pointer provided through ::zeRTASBuilderBuildExt function + ze_rtas_aabb_ext_t* pBoundsOut; ///< [out] destination buffer to write AABB bounds to + +} ze_rtas_geometry_aabbs_ext_cb_params_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function pointer type to return AABBs for a range of +/// procedural primitives +typedef void (*ze_rtas_geometry_aabbs_cb_ext_t)( + ze_rtas_geometry_aabbs_ext_cb_params_t* params ///< [in] callback function parameters structure + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder procedural primitives +/// geometry info +/// +/// @details +/// - A host-side bounds callback function is invoked by the acceleration +/// structure builder to query the bounds of procedural primitives on +/// demand. The callback is passed some `pGeomUserPtr` that can point to +/// an application-side representation of the procedural primitives. +/// Further, a second `pBuildUserPtr`, which is set by a parameter to +/// ::zeRTASBuilderBuildExt, is passed to the callback. This allows the +/// build to change the bounds of the procedural geometry, for example, to +/// build a BVH only over a short time range to implement multi-segment +/// motion blur. +typedef struct _ze_rtas_builder_procedural_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_PROCEDURAL + ze_rtas_builder_packed_geometry_ext_flags_t geometryFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + uint8_t reserved; ///< [in] reserved for future use + uint32_t primCount; ///< [in] number of primitives in geometry + ze_rtas_geometry_aabbs_cb_ext_t pfnGetBoundsCb; ///< [in] pointer to callback function to get the axis-aligned bounding-box + ///< for a range of primitives + void* pGeomUserPtr; ///< [in] user data pointer passed to callback + +} ze_rtas_builder_procedural_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Ray tracing acceleration structure builder instance geometry info +typedef struct _ze_rtas_builder_instance_geometry_info_ext_t +{ + ze_rtas_builder_packed_geometry_type_ext_t geometryType; ///< [in] geometry type, must be + ///< ::ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_INSTANCE + ze_rtas_builder_packed_instance_ext_flags_t instanceFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_geometry_ext_flag_t + ///< bits representing the geometry flags for all primitives of this + ///< geometry + uint8_t geometryMask; ///< [in] 8-bit geometry mask for ray masking + ze_rtas_builder_packed_input_data_format_ext_t transformFormat; ///< [in] format of the specified transformation + uint32_t instanceUserID; ///< [in] user-specified identifier for the instance + void* pTransform; ///< [in] object-to-world instance transformation in specified format + ze_rtas_aabb_ext_t* pBounds; ///< [in] object-space axis-aligned bounding-box of the instanced + ///< acceleration structure + void* pAccelerationStructure; ///< [in] device pointer to acceleration structure to instantiate + +} ze_rtas_builder_instance_geometry_info_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief +typedef struct _ze_rtas_builder_build_op_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_rtas_format_ext_t rtasFormat; ///< [in] ray tracing acceleration structure format + ze_rtas_builder_build_quality_hint_ext_t buildQuality; ///< [in] acceleration structure build quality hint + ze_rtas_builder_build_op_ext_flags_t buildFlags; ///< [in] 0 or some combination of ::ze_rtas_builder_build_op_ext_flag_t + ///< flags + const ze_rtas_builder_geometry_info_ext_t** ppGeometries; ///< [in][optional][range(0, `numGeometries`)] NULL or a valid array of + ///< pointers to geometry infos + uint32_t numGeometries; ///< [in] number of geometries in geometry infos array, can be zero when + ///< `ppGeometries` is NULL + +} ze_rtas_builder_build_op_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a ray tracing acceleration structure builder object +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_extension_rtas extension. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pDescriptor` +/// + `nullptr == phBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_BUILDER_EXT_VERSION_CURRENT < pDescriptor->builderVersion` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + const ze_rtas_builder_ext_desc_t* pDescriptor, ///< [in] pointer to builder descriptor + ze_rtas_builder_ext_handle_t* phBuilder ///< [out] handle of builder object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves ray tracing acceleration structure builder properties +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pProperties` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderGetBuildPropertiesExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + ze_rtas_builder_ext_properties_t* pProperties ///< [in,out] query result for builder properties + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Checks ray tracing acceleration structure format compatibility +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXT_MAX < rtasFormatB` +/// - ::ZE_RESULT_SUCCESS +/// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. +/// - ::ZE_RESULT_EXT_ERROR_OPERANDS_INCOMPATIBLE +/// + An acceleration structure built with `rtasFormatA` is **not** compatible with devices that report `rtasFormatB`. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDriverRTASFormatCompatibilityCheckExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_format_ext_t rtasFormatA, ///< [in] operand A + ze_rtas_format_ext_t rtasFormatB ///< [in] operand B + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Build ray tracing acceleration structure +/// +/// @details +/// - This function builds an acceleration structure of the scene consisting +/// of the specified geometry information and writes the acceleration +/// structure to the provided destination buffer. All types of geometries +/// can get freely mixed inside a scene. +/// - Before an acceleration structure can be built, the user must allocate +/// the memory for the acceleration structure buffer and scratch buffer +/// using sizes queried with the ::zeRTASBuilderGetBuildPropertiesExt function. +/// - When using the "worst-case" size for the acceleration structure +/// buffer, the acceleration structure construction will never fail with ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. +/// - When using the "expected" size for the acceleration structure buffer, +/// the acceleration structure construction may fail with +/// ::ZE_RESULT_EXT_RTAS_BUILD_RETRY. If this happens, the user may resize +/// their acceleration structure buffer using the returned +/// `*pRtasBufferSizeBytes` value, which will be updated with an improved +/// size estimate that will likely result in a successful build. +/// - The acceleration structure construction is run on the host and is +/// synchronous, thus after the function returns with a successful result, +/// the acceleration structure may be used. +/// - All provided data buffers must be host-accessible. The referenced +/// scene data (index- and vertex- buffers) have to be accessible from the +/// host, and will **not** be referenced by the build acceleration structure. +/// - The acceleration structure buffer is typicall a host allocation that +/// is later manually copied to a device allocation. Alternatively one can +/// also use a shared USM allocation as acceration structure buffer and +/// skip the copy. +/// - A successfully constructed acceleration structure is entirely +/// self-contained. There is no requirement for input data to persist +/// beyond build completion. +/// - A successfully constructed acceleration structure is non-copyable. +/// - Acceleration structure construction may be parallelized by passing a +/// valid handle to a parallel operation object and joining that parallel +/// operation using ::zeRTASParallelOperationJoinExt with user-provided +/// worker threads. +/// - A successfully constructed acceleration structure is generally +/// non-copyable. It can only get copied from host to device using the +/// special ::zeRTASBuilderCommandListAppendCopyExt function. +/// - **Additional Notes** +/// - "The geometry infos array, geometry infos, and scratch buffer must +/// all be standard host memory allocations." +/// - "A pointer to a geometry info can be a null pointer, in which case +/// the geometry is treated as empty." +/// - "If no parallel operation handle is provided, the build is run +/// sequentially on the current thread." +/// - "A parallel operation object may only be associated with a single +/// acceleration structure build at a time." +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pBuildOpDescriptor` +/// + `nullptr == pScratchBuffer` +/// + `nullptr == pRtasBuffer` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_RTAS_FORMAT_EXT_MAX < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_HIGH < pBuildOpDescriptor->buildQuality` +/// + `0x3 < pBuildOpDescriptor->buildFlags` +/// - ::ZE_RESULT_EXT_RTAS_BUILD_DEFERRED +/// + Acceleration structure build completion is deferred to parallel operation join. +/// - ::ZE_RESULT_EXT_RTAS_BUILD_RETRY +/// + Acceleration structure build failed due to insufficient resources, retry the build operation with a larger acceleration structure buffer allocation. +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +/// + Acceleration structure build failed due to parallel operation object participation in another build operation. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderBuildExt( + ze_rtas_builder_ext_handle_t hBuilder, ///< [in] handle of builder object + const ze_rtas_builder_build_op_ext_desc_t* pBuildOpDescriptor, ///< [in] pointer to build operation descriptor + void* pScratchBuffer, ///< [in][range(0, `scratchBufferSizeBytes`)] scratch buffer to be used + ///< during acceleration structure construction + size_t scratchBufferSizeBytes, ///< [in] size of scratch buffer, in bytes + void* pRtasBuffer, ///< [in] pointer to destination buffer + size_t rtasBufferSizeBytes, ///< [in] destination buffer size, in bytes + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in][optional] handle to parallel operation object + void* pBuildUserPtr, ///< [in][optional] pointer passed to callbacks + ze_rtas_aabb_ext_t* pBounds, ///< [in,out][optional] pointer to destination address for acceleration + ///< structure bounds + size_t* pRtasBufferSizeBytes ///< [out][optional] updated acceleration structure size requirement, in + ///< bytes + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Copies a ray tracing acceleration structure (RTAS) from host to device +/// memory. +/// +/// @details +/// - The memory pointed to by srcptr must be host memory containing a valid +/// ray tracing acceleration structure. +/// - The number of bytes to copy must be larger or equal to the size of the +/// ray tracing acceleration structure. +/// - The application must ensure the memory pointed to by dstptr and srcptr +/// is accessible by the device on which the command list was created. +/// - The implementation must not access the memory pointed to by dstptr and +/// srcptr as they are free to be modified by either the Host or device up +/// until execution. +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - The application must ensure the command list and events were created, +/// and the memory was allocated, on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == dstptr` +/// + `nullptr == srcptr` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_INVALID_SIZE +/// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderCommandListAppendCopyExt( + ze_command_list_handle_t hCommandList, ///< [in] handle of command list + void* dstptr, ///< [in] pointer to destination in device memory to copy the ray tracing + ///< acceleration structure to + const void* srcptr, ///< [in] pointer to a valid source ray tracing acceleration structure in + ///< host memory to copy from + size_t size, ///< [in] size in bytes to copy + ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion + uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 + ///< if `nullptr == phWaitEvents` + ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait + ///< on before launching + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a ray tracing acceleration structure builder object +/// +/// @details +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this builder. +/// - The application must **not** call this function from simultaneous +/// threads with the same builder handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hBuilder` +/// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASBuilderDestroyExt( + ze_rtas_builder_ext_handle_t hBuilder ///< [in][release] handle of builder object to destroy + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Creates a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// - The implementation must support ::ZE_extension_rtas extension. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDriver` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationCreateExt( + ze_driver_handle_t hDriver, ///< [in] handle of driver object + ze_rtas_parallel_operation_ext_handle_t* phParallelOperation ///< [out] handle of parallel operation object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves ray tracing acceleration structure builder parallel +/// operation properties +/// +/// @details +/// - The application must first bind the parallel operation object to a +/// build operation before it may query the parallel operation properties. +/// In other words, the application must first call +/// ::zeRTASBuilderBuildExt with **hParallelOperation** before calling +/// this function. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pProperties` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationGetPropertiesExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ///< [in] handle of parallel operation object + ze_rtas_parallel_operation_ext_properties_t* pProperties ///< [in,out] query result for parallel operation properties + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Joins a parallel build operation +/// +/// @details +/// - All worker threads return the same error code for the parallel build +/// operation upon build completion +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationJoinExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in] handle of parallel operation object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroys a ray tracing acceleration structure builder parallel +/// operation object +/// +/// @details +/// - The implementation of this function may immediately release any +/// internal Host and Device resources associated with this parallel +/// operation. +/// - The application must **not** call this function from simultaneous +/// threads with the same parallel operation handle. +/// - The implementation of this function must be thread-safe. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hParallelOperation` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeRTASParallelOperationDestroyExt( + ze_rtas_parallel_operation_ext_handle_t hParallelOperation ///< [in][release] handle of parallel operation object to destroy + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for Device Vector Sizes Query +#if !defined(__GNUC__) +#pragma region deviceVectorSizes +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DEVICE_VECTOR_SIZES_EXT_NAME +/// @brief Device Vector Sizes Query Extension Name +#define ZE_DEVICE_VECTOR_SIZES_EXT_NAME "ZE_extension_device_vector_sizes" +#endif // ZE_DEVICE_VECTOR_SIZES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Vector Sizes Query Extension Version(s) +typedef enum _ze_device_vector_sizes_ext_version_t +{ + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_* ENUMs + +} ze_device_vector_sizes_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Vector Width Properties queried using +/// $DeviceGetVectorWidthPropertiesExt +typedef struct _ze_device_vector_width_properties_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t vector_width_size; ///< [out] The associated vector width size supported by the device. + uint32_t preferred_vector_width_char; ///< [out] The preferred vector width size for char type supported by the device. + uint32_t preferred_vector_width_short; ///< [out] The preferred vector width size for short type supported by the device. + uint32_t preferred_vector_width_int; ///< [out] The preferred vector width size for int type supported by the device. + uint32_t preferred_vector_width_long; ///< [out] The preferred vector width size for long type supported by the device. + uint32_t preferred_vector_width_float; ///< [out] The preferred vector width size for float type supported by the device. + uint32_t preferred_vector_width_double; ///< [out] The preferred vector width size for double type supported by the device. + uint32_t preferred_vector_width_half; ///< [out] The preferred vector width size for half type supported by the device. + uint32_t native_vector_width_char; ///< [out] The native vector width size for char type supported by the device. + uint32_t native_vector_width_short; ///< [out] The native vector width size for short type supported by the device. + uint32_t native_vector_width_int; ///< [out] The native vector width size for int type supported by the device. + uint32_t native_vector_width_long; ///< [out] The native vector width size for long type supported by the device. + uint32_t native_vector_width_float; ///< [out] The native vector width size for float type supported by the device. + uint32_t native_vector_width_double; ///< [out] The native vector width size for double type supported by the device. + uint32_t native_vector_width_half; ///< [out] The native vector width size for half type supported by the device. + +} ze_device_vector_width_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves the vector width properties of the device. +/// +/// @details +/// - Properties are reported for each vector width supported by the device. +/// - Multiple calls to this function will return properties in the same +/// order. +/// - The number of vector width properties is reported thru the pCount +/// parameter which is updated by the driver given pCount == 0. +/// - The application may provide a buffer that is larger than the number of +/// properties, but the application must set pCount to the number of +/// properties to retrieve. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceGetVectorWidthPropertiesExt( + ze_device_handle_t hDevice, ///< [in] handle of the device + uint32_t* pCount, ///< [in,out] pointer to the number of vector width properties. + ///< if count is zero, then the driver shall update the value with the + ///< total number of vector width properties available. + ///< if count is greater than the number of vector width properties + ///< available, then the driver shall update the value with the correct + ///< number of vector width properties available. + ze_device_vector_width_properties_ext_t* pVectorWidthProperties ///< [in,out][optional][range(0, *pCount)] array of vector width properties. + ///< if count is less than the number of properties available, then the + ///< driver will return only the number requested. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation +#if !defined(__GNUC__) +#pragma region cacheReservation +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_CACHE_RESERVATION_EXT_NAME +/// @brief Cache_Reservation Extension Name +#define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" +#endif // ZE_CACHE_RESERVATION_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Cache_Reservation Extension Version(s) +typedef enum _ze_cache_reservation_ext_version_t +{ + ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CACHE_RESERVATION_EXT_VERSION_* ENUMs + +} ze_cache_reservation_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Cache Reservation Region +typedef enum _ze_cache_ext_region_t +{ + ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0, ///< [DEPRECATED] utilize driver default scheme. Use + ///< ::ZE_CACHE_EXT_REGION_DEFAULT. + ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1, ///< [DEPRECATED] utilize reserved region. Use + ///< ::ZE_CACHE_EXT_REGION_RESERVED. + ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< [DEPRECATED] utilize non-reserverd region. Use + ///< ::ZE_CACHE_EXT_REGION_NON_RESERVED. + ZE_CACHE_EXT_REGION_DEFAULT = 0, ///< utilize driver default scheme + ZE_CACHE_EXT_REGION_RESERVED = 1, ///< utilize reserved region + ZE_CACHE_EXT_REGION_NON_RESERVED = 2, ///< utilize non-reserverd region + ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CACHE_EXT_REGION_* ENUMs + +} ze_cache_ext_region_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief CacheReservation structure +/// +/// @details +/// - This structure must be passed to ::zeDeviceGetCacheProperties via the +/// `pNext` member of ::ze_device_cache_properties_t +/// - Used for determining the max cache reservation allowed on device. Size +/// of zero means no reservation available. +typedef struct _ze_cache_reservation_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + size_t maxCacheReservationSize; ///< [out] max cache reservation size + +} ze_cache_reservation_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Reserve Cache on Device +/// +/// @details +/// - The application may call this function but may not be successful as +/// some other application may have reserve prior +/// +/// @remarks +/// _Analogues_ +/// - None +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceReserveCacheExt( + ze_device_handle_t hDevice, ///< [in] handle of the device object + size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the + ///< driver shall default to last level of cache and attempt to reserve in + ///< that cache. + size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver + ///< shall remove prior reservation + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Assign VA section to use reserved section +/// +/// @details +/// - The application may call this function to assign VA to particular +/// reservartion region +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == ptr` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_CACHE_EXT_REGION_NON_RESERVED < cacheRegion` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceSetCacheAdviceExt( ze_device_handle_t hDevice, ///< [in] handle of the device object void* ptr, ///< [in] memory pointer to query size_t regionSize, ///< [in] region size, in pages @@ -7653,7 +9328,7 @@ typedef enum _ze_event_query_timestamps_exp_version_t { ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_* ENUMs } ze_event_query_timestamps_exp_version_t; @@ -7720,7 +9395,7 @@ typedef enum _ze_image_memory_properties_exp_version_t { ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_* ENUMs } ze_image_memory_properties_exp_version_t; @@ -7785,7 +9460,7 @@ typedef enum _ze_image_view_ext_version_t { ZE_IMAGE_VIEW_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMAGE_VIEW_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_VIEW_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_EXT_VERSION_* ENUMs } ze_image_view_ext_version_t; @@ -7847,7 +9522,7 @@ typedef enum _ze_image_view_exp_version_t { ZE_IMAGE_VIEW_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMAGE_VIEW_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_EXP_VERSION_* ENUMs } ze_image_view_exp_version_t; @@ -7919,7 +9594,7 @@ typedef enum _ze_image_view_planar_ext_version_t { ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_* ENUMs } ze_image_view_planar_ext_version_t; @@ -7946,7 +9621,7 @@ typedef enum _ze_image_view_planar_exp_version_t { ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_* ENUMs } ze_image_view_planar_exp_version_t; @@ -7957,7 +9632,8 @@ typedef struct _ze_image_view_planar_exp_desc_t ze_structure_type_t stype; ///< [in] type of this structure const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - uint32_t planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) + uint32_t planeIndex; ///< [DEPRECATED] no longer supported, use + ///< ::ze_image_view_planar_ext_desc_t instead } ze_image_view_planar_exp_desc_t; @@ -7980,7 +9656,7 @@ typedef enum _ze_scheduling_hints_exp_version_t { ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_SCHEDULING_HINTS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SCHEDULING_HINTS_EXP_VERSION_* ENUMs } ze_scheduling_hints_exp_version_t; @@ -7992,7 +9668,7 @@ typedef enum _ze_scheduling_hint_exp_flag_t ZE_SCHEDULING_HINT_EXP_FLAG_OLDEST_FIRST = ZE_BIT(0), ///< Hint that the kernel prefers oldest-first scheduling ZE_SCHEDULING_HINT_EXP_FLAG_ROUND_ROBIN = ZE_BIT(1), ///< Hint that the kernel prefers round-robin scheduling ZE_SCHEDULING_HINT_EXP_FLAG_STALL_BASED_ROUND_ROBIN = ZE_BIT(2), ///< Hint that the kernel prefers stall-based round-robin scheduling - ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SCHEDULING_HINT_EXP_FLAG_* ENUMs } ze_scheduling_hint_exp_flag_t; @@ -8079,7 +9755,7 @@ typedef enum _ze_linkonce_odr_ext_version_t { ZE_LINKONCE_ODR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_LINKONCE_ODR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKONCE_ODR_EXT_VERSION_* ENUMs } ze_linkonce_odr_ext_version_t; @@ -8102,7 +9778,7 @@ typedef enum _ze_power_saving_hint_exp_version_t { ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_EXP_VERSION_* ENUMs } ze_power_saving_hint_exp_version_t; @@ -8114,7 +9790,7 @@ typedef enum _ze_power_saving_hint_type_t ///< while executing work submitted to this context. ZE_POWER_SAVING_HINT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to ///< a minimum while executing work submitted to this context. - ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_POWER_SAVING_HINT_TYPE_* ENUMs } ze_power_saving_hint_type_t; @@ -8149,7 +9825,7 @@ typedef enum _ze_subgroup_ext_version_t { ZE_SUBGROUP_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_SUBGROUP_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SUBGROUP_EXT_VERSION_* ENUMs } ze_subgroup_ext_version_t; @@ -8172,7 +9848,7 @@ typedef enum _ze_eu_count_ext_version_t { ZE_EU_COUNT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_EU_COUNT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EU_COUNT_EXT_VERSION_* ENUMs } ze_eu_count_ext_version_t; @@ -8211,7 +9887,7 @@ typedef enum _ze_pci_properties_ext_version_t { ZE_PCI_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_PCI_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_PCI_PROPERTIES_EXT_VERSION_* ENUMs } ze_pci_properties_ext_version_t; @@ -8304,7 +9980,7 @@ typedef enum _ze_srgb_ext_version_t { ZE_SRGB_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_SRGB_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SRGB_EXT_VERSION_* ENUMs } ze_srgb_ext_version_t; @@ -8343,7 +10019,7 @@ typedef enum _ze_image_copy_ext_version_t { ZE_IMAGE_COPY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMAGE_COPY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_COPY_EXT_VERSION_* ENUMs } ze_image_copy_ext_version_t; @@ -8494,7 +10170,7 @@ typedef enum _ze_image_query_alloc_properties_ext_version_t { ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_* ENUMs } ze_image_query_alloc_properties_ext_version_t; @@ -8553,7 +10229,7 @@ typedef enum _ze_linkage_inspection_ext_version_t { ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_LINKAGE_INSPECTION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_VERSION_* ENUMs } ze_linkage_inspection_ext_version_t; @@ -8565,7 +10241,7 @@ typedef enum _ze_linkage_inspection_ext_flag_t ZE_LINKAGE_INSPECTION_EXT_FLAG_IMPORTS = ZE_BIT(0), ///< List all imports of modules ZE_LINKAGE_INSPECTION_EXT_FLAG_UNRESOLVABLE_IMPORTS = ZE_BIT(1), ///< List all imports of modules that do not have a corresponding export ZE_LINKAGE_INSPECTION_EXT_FLAG_EXPORTS = ZE_BIT(2), ///< List all exports of modules - ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_LINKAGE_INSPECTION_EXT_FLAG_* ENUMs } ze_linkage_inspection_ext_flag_t; @@ -8636,7 +10312,7 @@ typedef enum _ze_memory_compression_hints_ext_version_t { ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_* ENUMs } ze_memory_compression_hints_ext_version_t; @@ -8647,7 +10323,7 @@ typedef enum _ze_memory_compression_hints_ext_flag_t { ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_COMPRESSED = ZE_BIT(0), ///< Hint Driver implementation to make allocation compressible ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_UNCOMPRESSED = ZE_BIT(1), ///< Hint Driver implementation to make allocation not compressible - ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_* ENUMs } ze_memory_compression_hints_ext_flag_t; @@ -8691,7 +10367,7 @@ typedef enum _ze_memory_free_policies_ext_version_t { ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_MEMORY_FREE_POLICIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MEMORY_FREE_POLICIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_MEMORY_FREE_POLICIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MEMORY_FREE_POLICIES_EXT_VERSION_* ENUMs } ze_memory_free_policies_ext_version_t; @@ -8700,9 +10376,16 @@ typedef enum _ze_memory_free_policies_ext_version_t typedef uint32_t ze_driver_memory_free_policy_ext_flags_t; typedef enum _ze_driver_memory_free_policy_ext_flag_t { - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE = ZE_BIT(0), ///< blocks until all commands using the memory are complete before freeing - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< schedules the memory to be freed but does not free immediately - ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE = ZE_BIT(0), ///< Blocks until all commands using the memory are complete before + ///< scheduling memory to be freed. Does not guarantee memory is freed upon + ///< return, only that it is safe and is scheduled to be freed. Actual + ///< freeing of memory is specific to user mode driver and kernel mode + ///< driver implementation and may be done asynchronously. + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< Immediately schedules the memory to be freed and returns without + ///< blocking. Memory may be freed after all commands using the memory are + ///< complete. Actual freeing of memory is specific to user mode driver and + ///< kernel mode driver implementation and may be done asynchronously. + ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_* ENUMs } ze_driver_memory_free_policy_ext_flag_t; @@ -8738,11 +10421,13 @@ typedef struct _ze_memory_free_ext_desc_t } ze_memory_free_ext_desc_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Frees allocated host memory, device memory, or shared memory using the -/// specified free policy. +/// @brief Frees allocated host memory, device memory, or shared memory on the +/// context using the specified free policy. /// /// @details -/// - The memory free policy is specified by the memory free descriptor. +/// - Similar to zeMemFree, with added parameter to choose the free policy. +/// - Does not gaurantee memory is freed upon return. See free policy +/// descriptions for details. /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -8841,7 +10526,7 @@ typedef enum _ze_device_luid_ext_version_t { ZE_DEVICE_LUID_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_DEVICE_LUID_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_LUID_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_LUID_EXT_VERSION_* ENUMs } ze_device_luid_ext_version_t; @@ -8913,7 +10598,7 @@ typedef enum _ze_fabric_vertex_exp_type_t ZE_FABRIC_VERTEX_EXP_TYPE_DEVICE = 1, ///< Fabric vertex represents a device ZE_FABRIC_VERTEX_EXP_TYPE_SUBDEVICE = 2, ///< Fabric vertex represents a subdevice ZE_FABRIC_VERTEX_EXP_TYPE_SWITCH = 3, ///< Fabric vertex represents a switch - ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_FABRIC_VERTEX_EXP_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FABRIC_VERTEX_EXP_TYPE_* ENUMs } ze_fabric_vertex_exp_type_t; @@ -8926,7 +10611,7 @@ typedef enum _ze_fabric_edge_exp_duplexity_t ///< one direction at time ZE_FABRIC_EDGE_EXP_DUPLEXITY_FULL_DUPLEX = 2, ///< Fabric edge is full duplex, i.e. stated bandwidth is supported in both ///< directions simultaneously - ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff + ZE_FABRIC_EDGE_EXP_DUPLEXITY_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_FABRIC_EDGE_EXP_DUPLEXITY_* ENUMs } ze_fabric_edge_exp_duplexity_t; @@ -9228,7 +10913,7 @@ typedef enum _ze_device_memory_properties_ext_version_t { ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_* ENUMs } ze_device_memory_properties_ext_version_t; @@ -9258,7 +10943,7 @@ typedef enum _ze_device_memory_ext_type_t ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6 = 19, ///< GDDR6 memory ZE_DEVICE_MEMORY_EXT_TYPE_GDDR6X = 20, ///< GDDR6X memory ZE_DEVICE_MEMORY_EXT_TYPE_GDDR7 = 21, ///< GDDR7 memory - ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_MEMORY_EXT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_MEMORY_EXT_TYPE_* ENUMs } ze_device_memory_ext_type_t; @@ -9302,7 +10987,7 @@ typedef enum _ze_bfloat16_conversions_ext_version_t { ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_* ENUMs } ze_bfloat16_conversions_ext_version_t; @@ -9325,7 +11010,7 @@ typedef enum _ze_device_ip_version_version_t { ZE_DEVICE_IP_VERSION_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_DEVICE_IP_VERSION_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_DEVICE_IP_VERSION_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_DEVICE_IP_VERSION_VERSION_* ENUMs } ze_device_ip_version_version_t; @@ -9365,7 +11050,7 @@ typedef enum _ze_kernel_max_group_size_properties_ext_version_t { ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_* ENUMs } ze_kernel_max_group_size_properties_ext_version_t; @@ -9410,7 +11095,7 @@ typedef enum _ze_sub_allocations_exp_version_t { ZE_SUB_ALLOCATIONS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_SUB_ALLOCATIONS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_SUB_ALLOCATIONS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_SUB_ALLOCATIONS_EXP_VERSION_* ENUMs } ze_sub_allocations_exp_version_t; @@ -9464,7 +11149,7 @@ typedef enum _ze_event_query_kernel_timestamps_ext_version_t { ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_* ENUMs } ze_event_query_kernel_timestamps_ext_version_t; @@ -9475,7 +11160,7 @@ typedef enum _ze_event_query_kernel_timestamps_ext_flag_t { ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_KERNEL = ZE_BIT(0), ///< Kernel timestamp results ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_SYNCHRONIZED = ZE_BIT(1), ///< Device event timestamps synchronized to the host time domain - ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_FLAG_* ENUMs } ze_event_query_kernel_timestamps_ext_flag_t; @@ -9604,7 +11289,7 @@ typedef enum _ze_rtas_builder_exp_version_t { ZE_RTAS_BUILDER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_RTAS_BUILDER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXP_VERSION_* ENUMs } ze_rtas_builder_exp_version_t; @@ -9614,7 +11299,7 @@ typedef uint32_t ze_rtas_device_exp_flags_t; typedef enum _ze_rtas_device_exp_flag_t { ZE_RTAS_DEVICE_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved for future use - ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_DEVICE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_DEVICE_EXP_FLAG_* ENUMs } ze_rtas_device_exp_flag_t; @@ -9627,7 +11312,8 @@ typedef enum _ze_rtas_device_exp_flag_t typedef enum _ze_rtas_format_exp_t { ZE_RTAS_FORMAT_EXP_INVALID = 0, ///< Invalid acceleration structure format - ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_FORMAT_EXP_MAX = 0x7ffffffe, ///< Maximum acceleration structure format code + ZE_RTAS_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_FORMAT_EXP_* ENUMs } ze_rtas_format_exp_t; @@ -9637,7 +11323,7 @@ typedef uint32_t ze_rtas_builder_exp_flags_t; typedef enum _ze_rtas_builder_exp_flag_t { ZE_RTAS_BUILDER_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_EXP_FLAG_* ENUMs } ze_rtas_builder_exp_flag_t; @@ -9647,7 +11333,7 @@ typedef uint32_t ze_rtas_parallel_operation_exp_flags_t; typedef enum _ze_rtas_parallel_operation_exp_flag_t { ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_RESERVED = ZE_BIT(0), ///< Reserved for future use - ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_PARALLEL_OPERATION_EXP_FLAG_* ENUMs } ze_rtas_parallel_operation_exp_flag_t; @@ -9657,7 +11343,7 @@ typedef uint32_t ze_rtas_builder_geometry_exp_flags_t; typedef enum _ze_rtas_builder_geometry_exp_flag_t { ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_NON_OPAQUE = ZE_BIT(0), ///< non-opaque geometries invoke an any-hit shader - ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_EXP_FLAG_* ENUMs } ze_rtas_builder_geometry_exp_flag_t; @@ -9677,7 +11363,7 @@ typedef enum _ze_rtas_builder_instance_exp_flag_t ///< be non-opaque ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_TRIANGLE_FORCE_NON_OPAQUE = ZE_BIT(3),///< forces instanced geometry to be non-opaque, unless ray flag forces it ///< to be opaque - ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_INSTANCE_EXP_FLAG_* ENUMs } ze_rtas_builder_instance_exp_flag_t; @@ -9703,7 +11389,7 @@ typedef enum _ze_rtas_builder_build_op_exp_flag_t { ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_COMPACT = ZE_BIT(0), ///< build more compact acceleration structure ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = ZE_BIT(1), ///< guarantees single any-hit shader invocation per primitive - ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_BUILD_OP_EXP_FLAG_* ENUMs } ze_rtas_builder_build_op_exp_flag_t; @@ -9726,7 +11412,7 @@ typedef enum _ze_rtas_builder_build_quality_hint_exp_t ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW = 0, ///< build low-quality acceleration structure (fast) ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_MEDIUM = 1, ///< build medium-quality acceleration structure (slower) ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH = 2, ///< build high-quality acceleration structure (slow) - ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_* ENUMs } ze_rtas_builder_build_quality_hint_exp_t; @@ -9738,7 +11424,7 @@ typedef enum _ze_rtas_builder_geometry_type_exp_t ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_QUADS = 1, ///< quad mesh geometry type ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_PROCEDURAL = 2, ///< procedural geometry type ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_INSTANCE = 3, ///< instance geometry type - ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_* ENUMs } ze_rtas_builder_geometry_type_exp_t; @@ -9767,7 +11453,7 @@ typedef enum _ze_rtas_builder_input_data_format_exp_t ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_TRIANGLE_INDICES_UINT32 = 5, ///< Unsigned 32-bit triangle indices (see ///< ::ze_rtas_triangle_indices_uint32_exp_t) ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_QUAD_INDICES_UINT32 = 6, ///< Unsigned 32-bit quad indices (see ::ze_rtas_quad_indices_uint32_exp_t) - ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff + ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_* ENUMs } ze_rtas_builder_input_data_format_exp_t; @@ -10216,7 +11902,7 @@ zeRTASBuilderCreateExp( /// + `nullptr == pBuildOpDescriptor` /// + `nullptr == pProperties` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` ZE_APIEXPORT ze_result_t ZE_APICALL @@ -10242,8 +11928,8 @@ zeRTASBuilderGetBuildPropertiesExp( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hDriver` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatA` -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < rtasFormatB` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatA` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < rtasFormatB` /// - ::ZE_RESULT_SUCCESS /// + An acceleration structure built with `rtasFormatA` is compatible with devices that report `rtasFormatB`. /// - ::ZE_RESULT_EXP_ERROR_OPERANDS_INCOMPATIBLE @@ -10318,7 +12004,7 @@ zeDriverRTASFormatCompatibilityCheckExp( /// + `nullptr == pScratchBuffer` /// + `nullptr == pRtasBuffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZE_RTAS_FORMAT_EXP_INVALID < pBuildOpDescriptor->rtasFormat` +/// + `::ZE_RTAS_FORMAT_EXP_MAX < pBuildOpDescriptor->rtasFormat` /// + `::ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_HIGH < pBuildOpDescriptor->buildQuality` /// + `0x3 < pBuildOpDescriptor->buildFlags` /// - ::ZE_RESULT_EXP_RTAS_BUILD_DEFERRED @@ -10487,7 +12173,7 @@ typedef enum _ze_event_pool_counter_based_exp_version_t { ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_* ENUMs } ze_event_pool_counter_based_exp_version_t; @@ -10498,7 +12184,7 @@ typedef enum _ze_event_pool_counter_based_exp_flag_t { ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_IMMEDIATE = ZE_BIT(0), ///< Counter-based event pool is used for immediate command lists (default) ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE = ZE_BIT(1), ///< Counter-based event pool is for non-immediate command lists - ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_* ENUMs } ze_event_pool_counter_based_exp_flag_t; @@ -10537,7 +12223,7 @@ typedef enum _ze_bindless_image_exp_version_t { ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_BINDLESS_IMAGE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_BINDLESS_IMAGE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_BINDLESS_IMAGE_EXP_VERSION_* ENUMs } ze_bindless_image_exp_version_t; @@ -10551,7 +12237,7 @@ typedef enum _ze_image_bindless_exp_flag_t ZE_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE = ZE_BIT(1), ///< Bindless sampled images are created with ::zeImageCreate by combining ///< BINDLESS and SAMPLED_IMAGE. ///< Create sampled image view from bindless unsampled image using SAMPLED_IMAGE. - ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_IMAGE_BINDLESS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMAGE_BINDLESS_EXP_FLAG_* ENUMs } ze_image_bindless_exp_flag_t; @@ -10680,7 +12366,7 @@ typedef enum _ze_command_list_clone_exp_version_t { ZE_COMMAND_LIST_CLONE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_COMMAND_LIST_CLONE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_COMMAND_LIST_CLONE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_COMMAND_LIST_CLONE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_COMMAND_LIST_CLONE_EXP_VERSION_* ENUMs } ze_command_list_clone_exp_version_t; @@ -10737,7 +12423,7 @@ typedef enum _ze_immediate_command_list_append_exp_version_t { ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_* ENUMs } ze_immediate_command_list_append_exp_version_t; @@ -10797,8 +12483,9 @@ zeCommandListImmediateAppendCommandListsExp( typedef enum _ze_mutable_command_list_exp_version_t { ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version + ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_* ENUMs } ze_mutable_command_list_exp_version_t; @@ -10813,7 +12500,9 @@ typedef enum _ze_mutable_command_exp_flag_t ZE_MUTABLE_COMMAND_EXP_FLAG_GLOBAL_OFFSET = ZE_BIT(3), ///< kernel global offset ZE_MUTABLE_COMMAND_EXP_FLAG_SIGNAL_EVENT = ZE_BIT(4), ///< command signal event ZE_MUTABLE_COMMAND_EXP_FLAG_WAIT_EVENTS = ZE_BIT(5), ///< command wait events - ZE_MUTABLE_COMMAND_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION = ZE_BIT(6), ///< command kernel + ZE_MUTABLE_COMMAND_EXP_FLAG_GRAPH_ARGUMENTS = ZE_BIT(7), ///< graph arguments + ZE_MUTABLE_COMMAND_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MUTABLE_COMMAND_EXP_FLAG_* ENUMs } ze_mutable_command_exp_flag_t; @@ -10825,8 +12514,10 @@ typedef struct _ze_mutable_command_id_exp_desc_t const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). ze_mutable_command_exp_flags_t flags; ///< [in] mutable command flags. - ///< - must be 0 (default, equivalent to setting all flags), or a valid - ///< combination of ::ze_mutable_command_exp_flag_t + ///< - must be 0 (default, equivalent to setting all flags bar kernel + ///< instruction), or a valid combination of ::ze_mutable_command_exp_flag_t + ///< - in order to include kernel instruction mutation, + ///< ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included } ze_mutable_command_id_exp_desc_t; @@ -10836,7 +12527,7 @@ typedef uint32_t ze_mutable_command_list_exp_flags_t; typedef enum _ze_mutable_command_list_exp_flag_t { ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_RESERVED = ZE_BIT(0), ///< reserved - ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_MUTABLE_COMMAND_LIST_EXP_FLAG_* ENUMs } ze_mutable_command_list_exp_flag_t; @@ -10929,6 +12620,19 @@ typedef struct _ze_mutable_global_offset_exp_desc_t } ze_mutable_global_offset_exp_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Mutable graph argument descriptor +typedef struct _ze_mutable_graph_argument_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint64_t commandId; ///< [in] command identifier + uint32_t argIndex; ///< [in] graph argument index + const void* pArgValue; ///< [in] pointer to graph argument value + +} ze_mutable_graph_argument_exp_desc_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Returns a unique command identifier for the next command to be /// appended to a command list. @@ -10952,7 +12656,7 @@ typedef struct _ze_mutable_global_offset_exp_desc_t /// + `nullptr == desc` /// + `nullptr == pCommandId` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3f < desc->flags` +/// + `0xff < desc->flags` ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListGetNextCommandIdExp( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -10960,6 +12664,43 @@ zeCommandListGetNextCommandIdExp( uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Returns a unique command identifier for the next command to be +/// appended to a command list. Provides possible kernel handles for +/// kernel mutation when ::ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION +/// flag is present. +/// +/// @details +/// - This function may only be called for a mutable command list. +/// - This function may not be called on a closed command list. +/// - This function may be called from simultaneous threads with the same +/// command list handle. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == desc` +/// + `nullptr == pCommandId` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `0xff < desc->flags` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListGetNextCommandIdWithKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const ze_mutable_command_id_exp_desc_t* desc, ///< [in][out] pointer to mutable command identifier descriptor + uint32_t numKernels, ///< [in][optional] number of entries on phKernels list + ze_kernel_handle_t* phKernels, ///< [in][optional][range(0, numKernels)] list of kernels that user can + ///< switch between using ::zeCommandListUpdateMutableCommandKernelsExp + ///< call + uint64_t* pCommandId ///< [out] pointer to mutable command identifier to be written + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Updates mutable commands. /// @@ -10983,6 +12724,8 @@ zeCommandListGetNextCommandIdExp( /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == desc` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Invalid kernel argument or not matching update descriptor provided ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListUpdateMutableCommandsExp( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -10998,8 +12741,6 @@ zeCommandListUpdateMutableCommandsExp( /// - This function may only be called for a mutable command list. /// - The type, scope and flags of the signal event must match those of the /// source command. -/// - Passing a null pointer as the signal event will update the command to -/// not issue a signal. /// - The application must synchronize mutable command list execution before /// calling this function. /// - The application must close a mutable command list after completing all @@ -11063,6 +12804,44 @@ zeCommandListUpdateMutableCommandWaitEventsExp( ///< on before launching ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Updates the kernel for a mutable command in a mutable command list. +/// +/// @details +/// - This function may only be called for a mutable command list. +/// - The kernel handle must be from the provided list for given command id. +/// - The application must synchronize mutable command list execution before +/// calling this function. +/// - The application must close a mutable command list after completing all +/// updates. +/// - This function must not be called from simultaneous threads with the +/// same command list handle. +/// - This function must be called before updating kernel arguments and +/// dispatch parameters, when kernel is mutated. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCommandId` +/// + `nullptr == phKernels` +/// - ::ZE_RESULT_ERROR_INVALID_KERNEL_HANDLE +/// + Invalid kernel handle provided for the mutation kernel instruction operation. +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListUpdateMutableCommandKernelsExp( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + uint32_t numKernels, ///< [in] the number of kernels to update + uint64_t* pCommandId, ///< [in][range(0, numKernels)] command identifier + ze_kernel_handle_t* phKernels ///< [in][range(0, numKernels)] handle of the kernel for a command + ///< identifier to switch to + ); + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/backends/ze/include/ze_ddi.h b/backends/ze/include/ze_ddi.h index 952cdb036..86f433684 100644 --- a/backends/ze/include/ze_ddi.h +++ b/backends/ze/include/ze_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file ze_ddi.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.1 * */ #ifndef _ZE_DDI_H @@ -19,6 +19,88 @@ extern "C" { #endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExt_t)( + ze_driver_handle_t, + const ze_rtas_builder_ext_desc_t*, + ze_rtas_builder_ext_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderGetBuildPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderGetBuildPropertiesExt_t)( + ze_rtas_builder_ext_handle_t, + const ze_rtas_builder_build_op_ext_desc_t*, + ze_rtas_builder_ext_properties_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderBuildExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderBuildExt_t)( + ze_rtas_builder_ext_handle_t, + const ze_rtas_builder_build_op_ext_desc_t*, + void*, + size_t, + void*, + size_t, + ze_rtas_parallel_operation_ext_handle_t, + void*, + ze_rtas_aabb_ext_t*, + size_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderCommandListAppendCopyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCommandListAppendCopyExt_t)( + ze_command_list_handle_t, + void*, + const void*, + size_t, + ze_event_handle_t, + uint32_t, + ze_event_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASBuilderDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderDestroyExt_t)( + ze_rtas_builder_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of RTASBuilder functions pointers +typedef struct _ze_rtas_builder_dditable_t +{ + ze_pfnRTASBuilderCreateExt_t pfnCreateExt; + ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt; + ze_pfnRTASBuilderBuildExt_t pfnBuildExt; + ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt; + ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt; +} ze_rtas_builder_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASBuilder table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetRTASBuilderProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_builder_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetRTASBuilderProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderProcAddrTable_t)( + ze_api_version_t, + ze_rtas_builder_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASBuilderCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASBuilderCreateExp_t)( @@ -88,6 +170,64 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASBuilderExpProcAddrTable_t)( ze_rtas_builder_exp_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationCreateExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExt_t)( + ze_driver_handle_t, + ze_rtas_parallel_operation_ext_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationGetPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationGetPropertiesExt_t)( + ze_rtas_parallel_operation_ext_handle_t, + ze_rtas_parallel_operation_ext_properties_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationJoinExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationJoinExt_t)( + ze_rtas_parallel_operation_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeRTASParallelOperationDestroyExt +typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationDestroyExt_t)( + ze_rtas_parallel_operation_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of RTASParallelOperation functions pointers +typedef struct _ze_rtas_parallel_operation_dditable_t +{ + ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt; + ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt; + ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt; + ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt; +} ze_rtas_parallel_operation_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's RTASParallelOperation table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zeGetRTASParallelOperationProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + ze_rtas_parallel_operation_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGetRTASParallelOperationProcAddrTable +typedef ze_result_t (ZE_APICALL *ze_pfnGetRTASParallelOperationProcAddrTable_t)( + ze_api_version_t, + ze_rtas_parallel_operation_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zeRTASParallelOperationCreateExp typedef ze_result_t (ZE_APICALL *ze_pfnRTASParallelOperationCreateExp_t)( @@ -152,11 +292,20 @@ typedef ze_result_t (ZE_APICALL *ze_pfnInit_t)( ze_init_flags_t ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeInitDrivers +typedef ze_result_t (ZE_APICALL *ze_pfnInitDrivers_t)( + uint32_t*, + ze_driver_handle_t*, + ze_init_driver_type_desc_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Global functions pointers typedef struct _ze_global_dditable_t { ze_pfnInit_t pfnInit; + ze_pfnInitDrivers_t pfnInitDrivers; } ze_global_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -232,6 +381,14 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDriverGetLastErrorDescription_t)( const char** ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDriverRTASFormatCompatibilityCheckExt +typedef ze_result_t (ZE_APICALL *ze_pfnDriverRTASFormatCompatibilityCheckExt_t)( + ze_driver_handle_t, + ze_rtas_format_ext_t, + ze_rtas_format_ext_t + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Driver functions pointers typedef struct _ze_driver_dditable_t @@ -243,6 +400,7 @@ typedef struct _ze_driver_dditable_t ze_pfnDriverGetExtensionProperties_t pfnGetExtensionProperties; ze_pfnDriverGetExtensionFunctionAddress_t pfnGetExtensionFunctionAddress; ze_pfnDriverGetLastErrorDescription_t pfnGetLastErrorDescription; + ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt; } ze_driver_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -447,6 +605,28 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetRootDevice_t)( ze_device_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDeviceImportExternalSemaphoreExt +typedef ze_result_t (ZE_APICALL *ze_pfnDeviceImportExternalSemaphoreExt_t)( + ze_device_handle_t, + const ze_external_semaphore_ext_desc_t*, + ze_external_semaphore_ext_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDeviceReleaseExternalSemaphoreExt +typedef ze_result_t (ZE_APICALL *ze_pfnDeviceReleaseExternalSemaphoreExt_t)( + ze_external_semaphore_ext_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDeviceGetVectorWidthPropertiesExt +typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetVectorWidthPropertiesExt_t)( + ze_device_handle_t, + uint32_t*, + ze_device_vector_width_properties_ext_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Device functions pointers typedef struct _ze_device_dditable_t @@ -470,6 +650,9 @@ typedef struct _ze_device_dditable_t ze_pfnDeviceSetCacheAdviceExt_t pfnSetCacheAdviceExt; ze_pfnDevicePciGetPropertiesExt_t pfnPciGetPropertiesExt; ze_pfnDeviceGetRootDevice_t pfnGetRootDevice; + ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; + ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; + ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; } ze_device_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -1056,6 +1239,30 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListIsImmediate_t)( ze_bool_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListAppendSignalExternalSemaphoreExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListAppendSignalExternalSemaphoreExt_t)( + ze_command_list_handle_t, + uint32_t, + ze_external_semaphore_ext_handle_t*, + ze_external_semaphore_signal_params_ext_t*, + ze_event_handle_t, + uint32_t, + ze_event_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListAppendWaitExternalSemaphoreExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListAppendWaitExternalSemaphoreExt_t)( + ze_command_list_handle_t, + uint32_t, + ze_external_semaphore_ext_handle_t*, + ze_external_semaphore_wait_params_ext_t*, + ze_event_handle_t, + uint32_t, + ze_event_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of CommandList functions pointers typedef struct _ze_command_list_dditable_t @@ -1094,6 +1301,8 @@ typedef struct _ze_command_list_dditable_t ze_pfnCommandListGetOrdinal_t pfnGetOrdinal; ze_pfnCommandListImmediateGetIndex_t pfnImmediateGetIndex; ze_pfnCommandListIsImmediate_t pfnIsImmediate; + ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt; + ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt; } ze_command_list_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -1168,6 +1377,25 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandWaitEvents ze_event_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListGetNextCommandIdWithKernelsExp +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListGetNextCommandIdWithKernelsExp_t)( + ze_command_list_handle_t, + const ze_mutable_command_id_exp_desc_t*, + uint32_t, + ze_kernel_handle_t*, + uint64_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListUpdateMutableCommandKernelsExp +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandKernelsExp_t)( + ze_command_list_handle_t, + uint32_t, + uint64_t*, + ze_kernel_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of CommandListExp functions pointers typedef struct _ze_command_list_exp_dditable_t @@ -1178,6 +1406,8 @@ typedef struct _ze_command_list_exp_dditable_t ze_pfnCommandListUpdateMutableCommandsExp_t pfnUpdateMutableCommandsExp; ze_pfnCommandListUpdateMutableCommandSignalEventExp_t pfnUpdateMutableCommandSignalEventExp; ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t pfnUpdateMutableCommandWaitEventsExp; + ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp; + ze_pfnCommandListUpdateMutableCommandKernelsExp_t pfnUpdateMutableCommandKernelsExp; } ze_command_list_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2166,12 +2396,21 @@ typedef ze_result_t (ZE_APICALL *ze_pfnKernelSchedulingHintExp_t)( ze_scheduling_hint_exp_desc_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeKernelGetBinaryExp +typedef ze_result_t (ZE_APICALL *ze_pfnKernelGetBinaryExp_t)( + ze_kernel_handle_t, + size_t*, + uint8_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of KernelExp functions pointers typedef struct _ze_kernel_exp_dditable_t { ze_pfnKernelSetGlobalOffsetExp_t pfnSetGlobalOffsetExp; ze_pfnKernelSchedulingHintExp_t pfnSchedulingHintExp; + ze_pfnKernelGetBinaryExp_t pfnGetBinaryExp; } ze_kernel_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2507,7 +2746,9 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGetFabricEdgeExpProcAddrTable_t)( /// @brief Container for all DDI tables typedef struct _ze_dditable_t { + ze_rtas_builder_dditable_t RTASBuilder; ze_rtas_builder_exp_dditable_t RTASBuilderExp; + ze_rtas_parallel_operation_dditable_t RTASParallelOperation; ze_rtas_parallel_operation_exp_dditable_t RTASParallelOperationExp; ze_global_dditable_t Global; ze_driver_dditable_t Driver; @@ -2536,6 +2777,42 @@ typedef struct _ze_dditable_t ze_fabric_vertex_exp_dditable_t FabricVertexExp; ze_fabric_edge_exp_dditable_t FabricEdgeExp; } ze_dditable_t; +/// @brief Container for all DDI tables with version and tables set by the Driver +typedef struct _ze_dditable_driver_t +{ + ze_api_version_t version; + uint8_t isValidFlag; + ze_rtas_builder_dditable_t * RTASBuilder; + ze_rtas_builder_exp_dditable_t * RTASBuilderExp; + ze_rtas_parallel_operation_dditable_t * RTASParallelOperation; + ze_rtas_parallel_operation_exp_dditable_t * RTASParallelOperationExp; + ze_global_dditable_t * Global; + ze_driver_dditable_t * Driver; + ze_driver_exp_dditable_t * DriverExp; + ze_device_dditable_t * Device; + ze_device_exp_dditable_t * DeviceExp; + ze_context_dditable_t * Context; + ze_command_queue_dditable_t * CommandQueue; + ze_command_list_dditable_t * CommandList; + ze_command_list_exp_dditable_t * CommandListExp; + ze_image_dditable_t * Image; + ze_image_exp_dditable_t * ImageExp; + ze_mem_dditable_t * Mem; + ze_mem_exp_dditable_t * MemExp; + ze_fence_dditable_t * Fence; + ze_event_pool_dditable_t * EventPool; + ze_event_dditable_t * Event; + ze_event_exp_dditable_t * EventExp; + ze_module_dditable_t * Module; + ze_module_build_log_dditable_t * ModuleBuildLog; + ze_kernel_dditable_t * Kernel; + ze_kernel_exp_dditable_t * KernelExp; + ze_sampler_dditable_t * Sampler; + ze_physical_mem_dditable_t * PhysicalMem; + ze_virtual_mem_dditable_t * VirtualMem; + ze_fabric_vertex_exp_dditable_t * FabricVertexExp; + ze_fabric_edge_exp_dditable_t * FabricEdgeExp; +} ze_dditable_driver_t; #if defined(__cplusplus) } // extern "C" diff --git a/backends/ze/include/ze_ddi_common.h b/backends/ze/include/ze_ddi_common.h new file mode 100644 index 000000000..ca6eb50ac --- /dev/null +++ b/backends/ze/include/ze_ddi_common.h @@ -0,0 +1,36 @@ +/* + * + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file ze_ddi_common.h + * @version v1.13-r1.13.1 + * + */ +#ifndef _ZE_DDI_COMMON_H +#define _ZE_DDI_COMMON_H +#if defined(__cplusplus) +#pragma once +#endif +#include "ze_ddi.h" +#include "zet_ddi.h" +#include "zes_ddi.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +/// @brief Handle with pointers to Dispatch Tables allocated by the driver at the beginning of every L0 object handle. +typedef struct _ze_handle_t +{ + ze_dditable_driver_t *pCore; // [in] pointer to _ze_dditable_t_ object related to this handle + zet_dditable_driver_t *pTools; // [in] pointer to _zet_dditable_t_ object related to this handle + zes_dditable_driver_t *pSysman; // [in] pointer to _zes_dditable_t_ object related to this handle +} ze_handle_t; + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // _ZE_DDI_COMMON_H \ No newline at end of file diff --git a/backends/ze/include/ze_ddi_ver.h b/backends/ze/include/ze_ddi_ver.h index 82d0ba009..90b31dda7 100644 --- a/backends/ze/include/ze_ddi_ver.h +++ b/backends/ze/include/ze_ddi_ver.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file ze_ddi.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.73 * */ #ifndef _ZE_DDI_VER_H @@ -19,6 +19,18 @@ extern "C" { #endif +/////////////////////////////////////////////////////////////////////////////// +/// [1.13] +/// @brief Table of RTASBuilder functions pointers +typedef struct _ze_rtas_builder_dditable_t_1_13 +{ + ze_pfnRTASBuilderCreateExt_t pfnCreateExt; + ze_pfnRTASBuilderGetBuildPropertiesExt_t pfnGetBuildPropertiesExt; + ze_pfnRTASBuilderBuildExt_t pfnBuildExt; + ze_pfnRTASBuilderCommandListAppendCopyExt_t pfnCommandListAppendCopyExt; + ze_pfnRTASBuilderDestroyExt_t pfnDestroyExt; +} ze_rtas_builder_dditable_t_1_13; + /////////////////////////////////////////////////////////////////////////////// /// [1.7] /// @brief Table of RTASBuilderExp functions pointers @@ -30,6 +42,17 @@ typedef struct _ze_rtas_builder_exp_dditable_t_1_7 ze_pfnRTASBuilderDestroyExp_t pfnDestroyExp; } ze_rtas_builder_exp_dditable_t_1_7; +/////////////////////////////////////////////////////////////////////////////// +/// [1.13] +/// @brief Table of RTASParallelOperation functions pointers +typedef struct _ze_rtas_parallel_operation_dditable_t_1_13 +{ + ze_pfnRTASParallelOperationCreateExt_t pfnCreateExt; + ze_pfnRTASParallelOperationGetPropertiesExt_t pfnGetPropertiesExt; + ze_pfnRTASParallelOperationJoinExt_t pfnJoinExt; + ze_pfnRTASParallelOperationDestroyExt_t pfnDestroyExt; +} ze_rtas_parallel_operation_dditable_t_1_13; + /////////////////////////////////////////////////////////////////////////////// /// [1.7] /// @brief Table of RTASParallelOperationExp functions pointers @@ -42,15 +65,21 @@ typedef struct _ze_rtas_parallel_operation_exp_dditable_t_1_7 } ze_rtas_parallel_operation_exp_dditable_t_1_7; /////////////////////////////////////////////////////////////////////////////// -/// [1.0] +/// [1.0, 1.1] /// @brief Table of Global functions pointers typedef struct _ze_global_dditable_t_1_0 { ze_pfnInit_t pfnInit; } ze_global_dditable_t_1_0; +typedef struct _ze_global_dditable_t_1_1 +{ + ze_pfnInit_t pfnInit; + ze_pfnInitDrivers_t pfnInitDrivers; +} ze_global_dditable_t_1_1; + /////////////////////////////////////////////////////////////////////////////// -/// [1.0, 1.1, 1.6] +/// [1.0, 1.1, 1.13, 1.6] /// @brief Table of Driver functions pointers typedef struct _ze_driver_dditable_t_1_0 { @@ -71,6 +100,17 @@ typedef struct _ze_driver_dditable_t_1_1 ze_pfnDriverGetExtensionFunctionAddress_t pfnGetExtensionFunctionAddress; } ze_driver_dditable_t_1_1; +typedef struct _ze_driver_dditable_t_1_13 +{ + ze_pfnDriverGet_t pfnGet; + ze_pfnDriverGetApiVersion_t pfnGetApiVersion; + ze_pfnDriverGetProperties_t pfnGetProperties; + ze_pfnDriverGetIpcProperties_t pfnGetIpcProperties; + ze_pfnDriverGetExtensionProperties_t pfnGetExtensionProperties; + ze_pfnDriverGetExtensionFunctionAddress_t pfnGetExtensionFunctionAddress; + ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt; +} ze_driver_dditable_t_1_13; + typedef struct _ze_driver_dditable_t_1_6 { ze_pfnDriverGet_t pfnGet; @@ -80,6 +120,7 @@ typedef struct _ze_driver_dditable_t_1_6 ze_pfnDriverGetExtensionProperties_t pfnGetExtensionProperties; ze_pfnDriverGetExtensionFunctionAddress_t pfnGetExtensionFunctionAddress; ze_pfnDriverGetLastErrorDescription_t pfnGetLastErrorDescription; + ze_pfnDriverRTASFormatCompatibilityCheckExt_t pfnRTASFormatCompatibilityCheckExt; } ze_driver_dditable_t_1_6; /////////////////////////////////////////////////////////////////////////////// @@ -91,7 +132,7 @@ typedef struct _ze_driver_exp_dditable_t_1_7 } ze_driver_exp_dditable_t_1_7; /////////////////////////////////////////////////////////////////////////////// -/// [1.0, 1.1, 1.2, 1.3, 1.7] +/// [1.0, 1.1, 1.12, 1.13, 1.2, 1.3, 1.7] /// @brief Table of Device functions pointers typedef struct _ze_device_dditable_t_1_0 { @@ -130,6 +171,49 @@ typedef struct _ze_device_dditable_t_1_1 ze_pfnDeviceGetGlobalTimestamps_t pfnGetGlobalTimestamps; } ze_device_dditable_t_1_1; +typedef struct _ze_device_dditable_t_1_12 +{ + ze_pfnDeviceGet_t pfnGet; + ze_pfnDeviceGetSubDevices_t pfnGetSubDevices; + ze_pfnDeviceGetProperties_t pfnGetProperties; + ze_pfnDeviceGetComputeProperties_t pfnGetComputeProperties; + ze_pfnDeviceGetModuleProperties_t pfnGetModuleProperties; + ze_pfnDeviceGetCommandQueueGroupProperties_t pfnGetCommandQueueGroupProperties; + ze_pfnDeviceGetMemoryProperties_t pfnGetMemoryProperties; + ze_pfnDeviceGetMemoryAccessProperties_t pfnGetMemoryAccessProperties; + ze_pfnDeviceGetCacheProperties_t pfnGetCacheProperties; + ze_pfnDeviceGetImageProperties_t pfnGetImageProperties; + ze_pfnDeviceGetExternalMemoryProperties_t pfnGetExternalMemoryProperties; + ze_pfnDeviceGetP2PProperties_t pfnGetP2PProperties; + ze_pfnDeviceCanAccessPeer_t pfnCanAccessPeer; + ze_pfnDeviceGetStatus_t pfnGetStatus; + ze_pfnDeviceGetGlobalTimestamps_t pfnGetGlobalTimestamps; + ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; + ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; +} ze_device_dditable_t_1_12; + +typedef struct _ze_device_dditable_t_1_13 +{ + ze_pfnDeviceGet_t pfnGet; + ze_pfnDeviceGetSubDevices_t pfnGetSubDevices; + ze_pfnDeviceGetProperties_t pfnGetProperties; + ze_pfnDeviceGetComputeProperties_t pfnGetComputeProperties; + ze_pfnDeviceGetModuleProperties_t pfnGetModuleProperties; + ze_pfnDeviceGetCommandQueueGroupProperties_t pfnGetCommandQueueGroupProperties; + ze_pfnDeviceGetMemoryProperties_t pfnGetMemoryProperties; + ze_pfnDeviceGetMemoryAccessProperties_t pfnGetMemoryAccessProperties; + ze_pfnDeviceGetCacheProperties_t pfnGetCacheProperties; + ze_pfnDeviceGetImageProperties_t pfnGetImageProperties; + ze_pfnDeviceGetExternalMemoryProperties_t pfnGetExternalMemoryProperties; + ze_pfnDeviceGetP2PProperties_t pfnGetP2PProperties; + ze_pfnDeviceCanAccessPeer_t pfnCanAccessPeer; + ze_pfnDeviceGetStatus_t pfnGetStatus; + ze_pfnDeviceGetGlobalTimestamps_t pfnGetGlobalTimestamps; + ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; + ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; + ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; +} ze_device_dditable_t_1_13; + typedef struct _ze_device_dditable_t_1_2 { ze_pfnDeviceGet_t pfnGet; @@ -149,6 +233,9 @@ typedef struct _ze_device_dditable_t_1_2 ze_pfnDeviceGetGlobalTimestamps_t pfnGetGlobalTimestamps; ze_pfnDeviceReserveCacheExt_t pfnReserveCacheExt; ze_pfnDeviceSetCacheAdviceExt_t pfnSetCacheAdviceExt; + ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; + ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; + ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; } ze_device_dditable_t_1_2; typedef struct _ze_device_dditable_t_1_3 @@ -171,6 +258,9 @@ typedef struct _ze_device_dditable_t_1_3 ze_pfnDeviceReserveCacheExt_t pfnReserveCacheExt; ze_pfnDeviceSetCacheAdviceExt_t pfnSetCacheAdviceExt; ze_pfnDevicePciGetPropertiesExt_t pfnPciGetPropertiesExt; + ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; + ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; + ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; } ze_device_dditable_t_1_3; typedef struct _ze_device_dditable_t_1_7 @@ -194,6 +284,9 @@ typedef struct _ze_device_dditable_t_1_7 ze_pfnDeviceSetCacheAdviceExt_t pfnSetCacheAdviceExt; ze_pfnDevicePciGetPropertiesExt_t pfnPciGetPropertiesExt; ze_pfnDeviceGetRootDevice_t pfnGetRootDevice; + ze_pfnDeviceImportExternalSemaphoreExt_t pfnImportExternalSemaphoreExt; + ze_pfnDeviceReleaseExternalSemaphoreExt_t pfnReleaseExternalSemaphoreExt; + ze_pfnDeviceGetVectorWidthPropertiesExt_t pfnGetVectorWidthPropertiesExt; } ze_device_dditable_t_1_7; /////////////////////////////////////////////////////////////////////////////// @@ -254,7 +347,7 @@ typedef struct _ze_command_queue_dditable_t_1_9 } ze_command_queue_dditable_t_1_9; /////////////////////////////////////////////////////////////////////////////// -/// [1.0, 1.3, 1.6, 1.9] +/// [1.0, 1.12, 1.3, 1.6, 1.9] /// @brief Table of CommandList functions pointers typedef struct _ze_command_list_dditable_t_1_0 { @@ -286,6 +379,38 @@ typedef struct _ze_command_list_dditable_t_1_0 ze_pfnCommandListAppendLaunchMultipleKernelsIndirect_t pfnAppendLaunchMultipleKernelsIndirect; } ze_command_list_dditable_t_1_0; +typedef struct _ze_command_list_dditable_t_1_12 +{ + ze_pfnCommandListCreate_t pfnCreate; + ze_pfnCommandListCreateImmediate_t pfnCreateImmediate; + ze_pfnCommandListDestroy_t pfnDestroy; + ze_pfnCommandListClose_t pfnClose; + ze_pfnCommandListReset_t pfnReset; + ze_pfnCommandListAppendWriteGlobalTimestamp_t pfnAppendWriteGlobalTimestamp; + ze_pfnCommandListAppendBarrier_t pfnAppendBarrier; + ze_pfnCommandListAppendMemoryRangesBarrier_t pfnAppendMemoryRangesBarrier; + ze_pfnCommandListAppendMemoryCopy_t pfnAppendMemoryCopy; + ze_pfnCommandListAppendMemoryFill_t pfnAppendMemoryFill; + ze_pfnCommandListAppendMemoryCopyRegion_t pfnAppendMemoryCopyRegion; + ze_pfnCommandListAppendMemoryCopyFromContext_t pfnAppendMemoryCopyFromContext; + ze_pfnCommandListAppendImageCopy_t pfnAppendImageCopy; + ze_pfnCommandListAppendImageCopyRegion_t pfnAppendImageCopyRegion; + ze_pfnCommandListAppendImageCopyToMemory_t pfnAppendImageCopyToMemory; + ze_pfnCommandListAppendImageCopyFromMemory_t pfnAppendImageCopyFromMemory; + ze_pfnCommandListAppendMemoryPrefetch_t pfnAppendMemoryPrefetch; + ze_pfnCommandListAppendMemAdvise_t pfnAppendMemAdvise; + ze_pfnCommandListAppendSignalEvent_t pfnAppendSignalEvent; + ze_pfnCommandListAppendWaitOnEvents_t pfnAppendWaitOnEvents; + ze_pfnCommandListAppendEventReset_t pfnAppendEventReset; + ze_pfnCommandListAppendQueryKernelTimestamps_t pfnAppendQueryKernelTimestamps; + ze_pfnCommandListAppendLaunchKernel_t pfnAppendLaunchKernel; + ze_pfnCommandListAppendLaunchCooperativeKernel_t pfnAppendLaunchCooperativeKernel; + ze_pfnCommandListAppendLaunchKernelIndirect_t pfnAppendLaunchKernelIndirect; + ze_pfnCommandListAppendLaunchMultipleKernelsIndirect_t pfnAppendLaunchMultipleKernelsIndirect; + ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt; + ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt; +} ze_command_list_dditable_t_1_12; + typedef struct _ze_command_list_dditable_t_1_3 { ze_pfnCommandListCreate_t pfnCreate; @@ -316,6 +441,8 @@ typedef struct _ze_command_list_dditable_t_1_3 ze_pfnCommandListAppendLaunchMultipleKernelsIndirect_t pfnAppendLaunchMultipleKernelsIndirect; ze_pfnCommandListAppendImageCopyToMemoryExt_t pfnAppendImageCopyToMemoryExt; ze_pfnCommandListAppendImageCopyFromMemoryExt_t pfnAppendImageCopyFromMemoryExt; + ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt; + ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt; } ze_command_list_dditable_t_1_3; typedef struct _ze_command_list_dditable_t_1_6 @@ -349,6 +476,8 @@ typedef struct _ze_command_list_dditable_t_1_6 ze_pfnCommandListAppendImageCopyToMemoryExt_t pfnAppendImageCopyToMemoryExt; ze_pfnCommandListAppendImageCopyFromMemoryExt_t pfnAppendImageCopyFromMemoryExt; ze_pfnCommandListHostSynchronize_t pfnHostSynchronize; + ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt; + ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt; } ze_command_list_dditable_t_1_6; typedef struct _ze_command_list_dditable_t_1_9 @@ -387,11 +516,19 @@ typedef struct _ze_command_list_dditable_t_1_9 ze_pfnCommandListGetOrdinal_t pfnGetOrdinal; ze_pfnCommandListImmediateGetIndex_t pfnImmediateGetIndex; ze_pfnCommandListIsImmediate_t pfnIsImmediate; + ze_pfnCommandListAppendSignalExternalSemaphoreExt_t pfnAppendSignalExternalSemaphoreExt; + ze_pfnCommandListAppendWaitExternalSemaphoreExt_t pfnAppendWaitExternalSemaphoreExt; } ze_command_list_dditable_t_1_9; /////////////////////////////////////////////////////////////////////////////// -/// [1.9] +/// [1.1, 1.9] /// @brief Table of CommandListExp functions pointers +typedef struct _ze_command_list_exp_dditable_t_1_1 +{ + ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp; + ze_pfnCommandListUpdateMutableCommandKernelsExp_t pfnUpdateMutableCommandKernelsExp; +} ze_command_list_exp_dditable_t_1_1; + typedef struct _ze_command_list_exp_dditable_t_1_9 { ze_pfnCommandListCreateCloneExp_t pfnCreateCloneExp; @@ -400,6 +537,8 @@ typedef struct _ze_command_list_exp_dditable_t_1_9 ze_pfnCommandListUpdateMutableCommandsExp_t pfnUpdateMutableCommandsExp; ze_pfnCommandListUpdateMutableCommandSignalEventExp_t pfnUpdateMutableCommandSignalEventExp; ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t pfnUpdateMutableCommandWaitEventsExp; + ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp; + ze_pfnCommandListUpdateMutableCommandKernelsExp_t pfnUpdateMutableCommandKernelsExp; } ze_command_list_exp_dditable_t_1_9; /////////////////////////////////////////////////////////////////////////////// @@ -675,17 +814,24 @@ typedef struct _ze_kernel_dditable_t_1_0 } ze_kernel_dditable_t_1_0; /////////////////////////////////////////////////////////////////////////////// -/// [1.1, 1.2] +/// [1.1, 1.11, 1.2] /// @brief Table of KernelExp functions pointers typedef struct _ze_kernel_exp_dditable_t_1_1 { ze_pfnKernelSetGlobalOffsetExp_t pfnSetGlobalOffsetExp; } ze_kernel_exp_dditable_t_1_1; +typedef struct _ze_kernel_exp_dditable_t_1_11 +{ + ze_pfnKernelSetGlobalOffsetExp_t pfnSetGlobalOffsetExp; + ze_pfnKernelGetBinaryExp_t pfnGetBinaryExp; +} ze_kernel_exp_dditable_t_1_11; + typedef struct _ze_kernel_exp_dditable_t_1_2 { ze_pfnKernelSetGlobalOffsetExp_t pfnSetGlobalOffsetExp; ze_pfnKernelSchedulingHintExp_t pfnSchedulingHintExp; + ze_pfnKernelGetBinaryExp_t pfnGetBinaryExp; } ze_kernel_exp_dditable_t_1_2; /////////////////////////////////////////////////////////////////////////////// diff --git a/backends/ze/include/zer_ddi_ver.h b/backends/ze/include/zer_ddi_ver.h new file mode 100644 index 000000000..a348e00b4 --- /dev/null +++ b/backends/ze/include/zer_ddi_ver.h @@ -0,0 +1,27 @@ +/* + * + * Copyright (C) 2019-2021 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + * @file zer_ddi.h + * @version v1.13-r1.13.73 + * + */ +#ifndef _ZER_DDI_VER_H +#define _ZER_DDI_VER_H +#if defined(__cplusplus) +#pragma once +#endif +#include "zer_ddi.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // _ZER_DDI_VER_H diff --git a/backends/ze/include/zes_api.h b/backends/ze/include/zes_api.h index 2c7c59862..82f706e07 100644 --- a/backends/ze/include/zes_api.h +++ b/backends/ze/include/zes_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zes_api.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.1 * */ #ifndef _ZES_API_H @@ -158,7 +158,12 @@ typedef enum _zes_structure_type_t ZES_STRUCTURE_TYPE_VF_EXP_PROPERTIES = 0x00020005, ///< ::zes_vf_exp_properties_t ZES_STRUCTURE_TYPE_VF_UTIL_MEM_EXP = 0x00020006, ///< ::zes_vf_util_mem_exp_t ZES_STRUCTURE_TYPE_VF_UTIL_ENGINE_EXP = 0x00020007, ///< ::zes_vf_util_engine_exp_t - ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_STRUCTURE_TYPE_VF_EXP_CAPABILITIES = 0x00020008, ///< ::zes_vf_exp_capabilities_t + ZES_STRUCTURE_TYPE_VF_UTIL_MEM_EXP2 = 0x00020009, ///< ::zes_vf_util_mem_exp2_t + ZES_STRUCTURE_TYPE_VF_UTIL_ENGINE_EXP2 = 0x00020010, ///< ::zes_vf_util_engine_exp2_t + ZES_STRUCTURE_TYPE_VF_EXP2_CAPABILITIES = 0x00020011, ///< ::zes_vf_exp2_capabilities_t + ZES_STRUCTURE_TYPE_DEVICE_ECC_DEFAULT_PROPERTIES_EXT = 0x00020012, ///< ::zes_device_ecc_default_properties_ext_t + ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STRUCTURE_TYPE_* ENUMs } zes_structure_type_t; @@ -504,6 +509,10 @@ typedef struct _zes_temp_threshold_t zes_temp_threshold_t; /// @brief Forward-declare zes_temp_config_t typedef struct _zes_temp_config_t zes_temp_config_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_device_ecc_default_properties_ext_t +typedef struct _zes_device_ecc_default_properties_ext_t zes_device_ecc_default_properties_ext_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare zes_power_limit_ext_desc_t typedef struct _zes_power_limit_ext_desc_t zes_power_limit_ext_desc_t; @@ -548,6 +557,22 @@ typedef struct _zes_vf_util_mem_exp_t zes_vf_util_mem_exp_t; /// @brief Forward-declare zes_vf_util_engine_exp_t typedef struct _zes_vf_util_engine_exp_t zes_vf_util_engine_exp_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_vf_exp_capabilities_t +typedef struct _zes_vf_exp_capabilities_t zes_vf_exp_capabilities_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_vf_exp2_capabilities_t +typedef struct _zes_vf_exp2_capabilities_t zes_vf_exp2_capabilities_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_vf_util_mem_exp2_t +typedef struct _zes_vf_util_mem_exp2_t zes_vf_util_mem_exp2_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_vf_util_engine_exp2_t +typedef struct _zes_vf_util_engine_exp2_t zes_vf_util_engine_exp2_t; + #if !defined(__GNUC__) #pragma endregion @@ -562,7 +587,7 @@ typedef uint32_t zes_init_flags_t; typedef enum _zes_init_flag_t { ZES_INIT_FLAG_PLACEHOLDER = ZE_BIT(0), ///< placeholder for future use - ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_INIT_FLAG_* ENUMs } zes_init_flag_t; @@ -773,7 +798,7 @@ typedef enum _zes_engine_type_flag_t ZES_ENGINE_TYPE_FLAG_MEDIA = ZE_BIT(3), ///< Engines that process media workloads. ZES_ENGINE_TYPE_FLAG_DMA = ZE_BIT(4), ///< Engines that copy blocks of data. ZES_ENGINE_TYPE_FLAG_RENDER = ZE_BIT(5), ///< Engines that can process both 3D content and compute kernels. - ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_TYPE_FLAG_* ENUMs } zes_engine_type_flag_t; @@ -784,7 +809,7 @@ typedef enum _zes_repair_status_t ZES_REPAIR_STATUS_UNSUPPORTED = 0, ///< The device does not support in-field repairs. ZES_REPAIR_STATUS_NOT_PERFORMED = 1, ///< The device has never been repaired. ZES_REPAIR_STATUS_PERFORMED = 2, ///< The device has been repaired. - ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_REPAIR_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_REPAIR_STATUS_* ENUMs } zes_repair_status_t; @@ -796,7 +821,7 @@ typedef enum _zes_reset_reason_flag_t ZES_RESET_REASON_FLAG_WEDGED = ZE_BIT(0), ///< The device needs to be reset because one or more parts of the hardware ///< is wedged ZES_RESET_REASON_FLAG_REPAIR = ZE_BIT(1), ///< The device needs to be reset in order to complete in-field repairs - ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_RESET_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_REASON_FLAG_* ENUMs } zes_reset_reason_flag_t; @@ -807,7 +832,7 @@ typedef enum _zes_reset_type_t ZES_RESET_TYPE_WARM = 0, ///< Apply warm reset ZES_RESET_TYPE_COLD = 1, ///< Apply cold reset ZES_RESET_TYPE_FLR = 2, ///< Apply FLR reset - ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_RESET_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RESET_TYPE_* ENUMs } zes_reset_type_t; @@ -854,7 +879,7 @@ typedef enum _zes_device_type_t ZES_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array ZES_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator ZES_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit - ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_TYPE_* ENUMs } zes_device_type_t; @@ -867,7 +892,7 @@ typedef enum _zes_device_property_flag_t ZES_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. ZES_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. ZES_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. - ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_PROPERTY_FLAG_* ENUMs } zes_device_property_flag_t; @@ -1151,7 +1176,7 @@ typedef enum _zes_pci_link_status_t ZES_PCI_LINK_STATUS_QUALITY_ISSUES = 2, ///< The link is up but has quality and/or bandwidth degradation ZES_PCI_LINK_STATUS_STABILITY_ISSUES = 3, ///< The link has stability issues and preventing workloads making forward ///< progress - ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STATUS_* ENUMs } zes_pci_link_status_t; @@ -1162,7 +1187,7 @@ typedef enum _zes_pci_link_qual_issue_flag_t { ZES_PCI_LINK_QUAL_ISSUE_FLAG_REPLAYS = ZE_BIT(0), ///< A significant number of replays are occurring ZES_PCI_LINK_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the maximum bandwidth of the link - ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_QUAL_ISSUE_FLAG_* ENUMs } zes_pci_link_qual_issue_flag_t; @@ -1172,7 +1197,7 @@ typedef uint32_t zes_pci_link_stab_issue_flags_t; typedef enum _zes_pci_link_stab_issue_flag_t { ZES_PCI_LINK_STAB_ISSUE_FLAG_RETRAINING = ZE_BIT(0), ///< Link retraining has occurred to deal with quality issues - ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_PCI_LINK_STAB_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_LINK_STAB_ISSUE_FLAG_* ENUMs } zes_pci_link_stab_issue_flag_t; @@ -1205,7 +1230,7 @@ typedef enum _zes_pci_bar_type_t ZES_PCI_BAR_TYPE_MMIO = 0, ///< MMIO registers ZES_PCI_BAR_TYPE_ROM = 1, ///< ROM aperture ZES_PCI_BAR_TYPE_MEM = 2, ///< Device memory - ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_PCI_BAR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PCI_BAR_TYPE_* ENUMs } zes_pci_bar_type_t; @@ -1398,7 +1423,7 @@ typedef enum _zes_overclock_domain_t ZES_OVERCLOCK_DOMAIN_GPU_MEDIA = 64, ///< Overclocking a GPU with media assets on its own PLL/VR. ZES_OVERCLOCK_DOMAIN_VRAM = 128, ///< Overclocking device local memory. ZES_OVERCLOCK_DOMAIN_ADM = 256, ///< Overclocking LLC/L4 cache. - ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_DOMAIN_* ENUMs } zes_overclock_domain_t; @@ -1421,7 +1446,7 @@ typedef enum _zes_overclock_control_t ZES_OVERCLOCK_CONTROL_TEMP_LIMIT = 512, ///< This control changes the value of TjMax. ZES_OVERCLOCK_CONTROL_ITD_DISABLE = 1024, ///< This control permits disabling the adaptive voltage feature ITD ZES_OVERCLOCK_CONTROL_ACM_DISABLE = 2048, ///< This control permits disabling the adaptive voltage feature ACM. - ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_CONTROL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_CONTROL_* ENUMs } zes_overclock_control_t; @@ -1435,7 +1460,7 @@ typedef enum _zes_overclock_mode_t ZES_OVERCLOCK_MODE_MODE_UNAVAILABLE = 4, ///< Overclocking is unavailable at this time since the system is running ///< on battery. ZES_OVERCLOCK_MODE_MODE_DISABLED = 5, ///< Overclock mode is disabled. - ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff + ZES_OVERCLOCK_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OVERCLOCK_MODE_* ENUMs } zes_overclock_mode_t; @@ -1448,7 +1473,7 @@ typedef enum _zes_control_state_t ZES_CONTROL_STATE_STATE_ACTIVE = 2, ///< The overclock control has been set and it is active. ZES_CONTROL_STATE_STATE_DISABLED = 3, ///< The overclock control value has been disabled due to the current power ///< configuration (typically when running on DC). - ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff + ZES_CONTROL_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_CONTROL_STATE_* ENUMs } zes_control_state_t; @@ -1461,7 +1486,7 @@ typedef enum _zes_pending_action_t ZES_PENDING_ACTION_PENDING_COLD_RESET = 2, ///< The requested change requires a device cold reset (hotplug, system ///< boot). ZES_PENDING_ACTION_PENDING_WARM_RESET = 3, ///< The requested change requires a device warm reset (PCIe FLR). - ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff + ZES_PENDING_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PENDING_ACTION_* ENUMs } zes_pending_action_t; @@ -1476,7 +1501,7 @@ typedef enum _zes_vf_program_type_t ///< the frequency of those points cannot be changed ZES_VF_PROGRAM_TYPE_VF_VOLT_FIXED = 2, ///< Can only program the frequency for the V-F points that is reads back - ///< the voltage of each point cannot be changed. - ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_PROGRAM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_PROGRAM_TYPE_* ENUMs } zes_vf_program_type_t; @@ -1486,7 +1511,7 @@ typedef enum _zes_vf_type_t { ZES_VF_TYPE_VOLT = 0, ///< VF Voltage point ZES_VF_TYPE_FREQ = 1, ///< VF Frequency point - ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_TYPE_* ENUMs } zes_vf_type_t; @@ -1497,7 +1522,7 @@ typedef enum _zes_vf_array_type_t ZES_VF_ARRAY_TYPE_USER_VF_ARRAY = 0, ///< User V-F array ZES_VF_ARRAY_TYPE_DEFAULT_VF_ARRAY = 1, ///< Default V-F array ZES_VF_ARRAY_TYPE_LIVE_VF_ARRAY = 2, ///< Live V-F array - ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_VF_ARRAY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_ARRAY_TYPE_* ENUMs } zes_vf_array_type_t; @@ -2011,7 +2036,7 @@ typedef enum _zes_diag_result_t ZES_DIAG_RESULT_FAIL_CANT_REPAIR = 2, ///< Diagnostic had problems setting up repairs ZES_DIAG_RESULT_REBOOT_FOR_REPAIR = 3, ///< Diagnostics found errors, setup for repair and reboot is required to ///< complete the process - ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff + ZES_DIAG_RESULT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DIAG_RESULT_* ENUMs } zes_diag_result_t; @@ -2197,7 +2222,7 @@ typedef enum _zes_device_ecc_state_t ZES_DEVICE_ECC_STATE_UNAVAILABLE = 0, ///< None ZES_DEVICE_ECC_STATE_ENABLED = 1, ///< ECC enabled. ZES_DEVICE_ECC_STATE_DISABLED = 2, ///< ECC disabled. - ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_ECC_STATE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ECC_STATE_* ENUMs } zes_device_ecc_state_t; @@ -2209,7 +2234,7 @@ typedef enum _zes_device_action_t ZES_DEVICE_ACTION_WARM_CARD_RESET = 1, ///< Warm reset of the card. ZES_DEVICE_ACTION_COLD_CARD_RESET = 2, ///< Cold reset of the card. ZES_DEVICE_ACTION_COLD_SYSTEM_REBOOT = 3, ///< Cold reboot of the system. - ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff + ZES_DEVICE_ACTION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ACTION_* ENUMs } zes_device_action_t; @@ -2386,7 +2411,7 @@ typedef enum _zes_engine_group_t ///< engines so activity of such an engine may not be indicative of the ///< underlying resource utilization - use ::ZES_ENGINE_GROUP_MEDIA_ALL for ///< that. - ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_GROUP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_GROUP_* ENUMs } zes_engine_group_t; @@ -2554,7 +2579,7 @@ typedef enum _zes_event_type_flag_t ZES_EVENT_TYPE_FLAG_DEVICE_RESET_REQUIRED = ZE_BIT(14), ///< Event is triggered when the device needs to be reset (use ///< ::zesDeviceGetState() to determine the reasons for the reset). ZES_EVENT_TYPE_FLAG_SURVIVABILITY_MODE_DETECTED = ZE_BIT(15), ///< Event is triggered when graphics driver encounter an error condition. - ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_EVENT_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_EVENT_TYPE_FLAG_* ENUMs } zes_event_type_flag_t; @@ -2701,7 +2726,7 @@ typedef enum _zes_fabric_port_status_t ZES_FABRIC_PORT_STATUS_FAILED = 3, ///< Port connection instabilities are preventing workloads making forward ///< progress ZES_FABRIC_PORT_STATUS_DISABLED = 4, ///< The port is configured down - ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_STATUS_* ENUMs } zes_fabric_port_status_t; @@ -2712,7 +2737,7 @@ typedef enum _zes_fabric_port_qual_issue_flag_t { ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_LINK_ERRORS = ZE_BIT(0), ///< Excessive link errors are occurring ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_SPEED = ZE_BIT(1), ///< There is a degradation in the bitrate and/or width of the link - ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_QUAL_ISSUE_FLAG_* ENUMs } zes_fabric_port_qual_issue_flag_t; @@ -2732,7 +2757,7 @@ typedef enum _zes_fabric_port_failure_flag_t ///< period of time. Driver will allow port to continue to train, but will ///< not enable the port for use until the port has been disabled and ///< subsequently re-enabled using ::zesFabricPortSetConfig(). - ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FABRIC_PORT_FAILURE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FABRIC_PORT_FAILURE_FLAG_* ENUMs } zes_fabric_port_failure_flag_t; @@ -3117,7 +3142,7 @@ typedef enum _zes_fan_speed_mode_t ZES_FAN_SPEED_MODE_FIXED = 1, ///< The fan speed is currently set to a fixed value ZES_FAN_SPEED_MODE_TABLE = 2, ///< The fan speed is currently controlled dynamically by hardware based on ///< a temp/speed table - ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff + ZES_FAN_SPEED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_MODE_* ENUMs } zes_fan_speed_mode_t; @@ -3127,7 +3152,7 @@ typedef enum _zes_fan_speed_units_t { ZES_FAN_SPEED_UNITS_RPM = 0, ///< The fan speed is in units of revolutions per minute (rpm) ZES_FAN_SPEED_UNITS_PERCENT = 1, ///< The fan speed is a percentage of the maximum speed of the fan - ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff + ZES_FAN_SPEED_UNITS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FAN_SPEED_UNITS_* ENUMs } zes_fan_speed_units_t; @@ -3574,7 +3599,7 @@ typedef enum _zes_freq_domain_t ZES_FREQ_DOMAIN_GPU = 0, ///< GPU Core Domain. ZES_FREQ_DOMAIN_MEMORY = 1, ///< Local Memory Domain. ZES_FREQ_DOMAIN_MEDIA = 2, ///< GPU Media Domain. - ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_FREQ_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_DOMAIN_* ENUMs } zes_freq_domain_t; @@ -3648,7 +3673,7 @@ typedef enum _zes_freq_throttle_reason_flag_t ZES_FREQ_THROTTLE_REASON_FLAG_SW_RANGE = ZE_BIT(5), ///< frequency throttled due to software supplied frequency range ZES_FREQ_THROTTLE_REASON_FLAG_HW_RANGE = ZE_BIT(6), ///< frequency throttled due to a sub block that has a lower frequency ///< range when it receives clocks - ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_FREQ_THROTTLE_REASON_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FREQ_THROTTLE_REASON_FLAG_* ENUMs } zes_freq_throttle_reason_flag_t; @@ -3720,7 +3745,7 @@ typedef enum _zes_oc_mode_t ///< specified overclock values. This mode disables OVERRIDE and ///< INTERPOLATIVE modes. This mode can damage the part, most of the ///< protections are disabled on this mode. - ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff + ZES_OC_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_OC_MODE_* ENUMs } zes_oc_mode_t; @@ -4512,7 +4537,7 @@ typedef enum _zes_mem_type_t ZES_MEM_TYPE_GDDR6 = 17, ///< GDDR6 memory ZES_MEM_TYPE_GDDR6X = 18, ///< GDDR6X memory ZES_MEM_TYPE_GDDR7 = 19, ///< GDDR7 memory - ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_MEM_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_TYPE_* ENUMs } zes_mem_type_t; @@ -4522,7 +4547,7 @@ typedef enum _zes_mem_loc_t { ZES_MEM_LOC_SYSTEM = 0, ///< System memory ZES_MEM_LOC_DEVICE = 1, ///< On board local device memory - ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff + ZES_MEM_LOC_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_LOC_* ENUMs } zes_mem_loc_t; @@ -4537,7 +4562,7 @@ typedef enum _zes_mem_health_t ZES_MEM_HEALTH_CRITICAL = 3, ///< Operating with reduced memory to cover banks with too many ///< uncorrectable errors. ZES_MEM_HEALTH_REPLACE = 4, ///< Device should be replaced due to excessive uncorrectable errors. - ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff + ZES_MEM_HEALTH_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_HEALTH_* ENUMs } zes_mem_health_t; @@ -4875,7 +4900,7 @@ typedef enum _zes_power_domain_t ZES_POWER_DOMAIN_STACK = 3, ///< The PUnit power domain is a stack-level power domain. ZES_POWER_DOMAIN_MEMORY = 4, ///< The PUnit power domain is a memory-level power domain. ZES_POWER_DOMAIN_GPU = 5, ///< The PUnit power domain is a GPU-level power domain. - ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff + ZES_POWER_DOMAIN_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_* ENUMs } zes_power_domain_t; @@ -4895,7 +4920,7 @@ typedef enum _zes_power_level_t ZES_POWER_LEVEL_INSTANTANEOUS = 4, ///< The PUnit predicts effective power draw using the current device ///< configuration (frequency, voltage, etc...) & throttles proactively to ///< stay within the specified limit. - ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff + ZES_POWER_LEVEL_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LEVEL_* ENUMs } zes_power_level_t; @@ -4907,7 +4932,7 @@ typedef enum _zes_power_source_t ///< battery powered. ZES_POWER_SOURCE_MAINS = 1, ///< Limit active only when the device is mains powered. ZES_POWER_SOURCE_BATTERY = 2, ///< Limit active only when the device is battery powered. - ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff + ZES_POWER_SOURCE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_SOURCE_* ENUMs } zes_power_source_t; @@ -4918,7 +4943,7 @@ typedef enum _zes_limit_unit_t ZES_LIMIT_UNIT_UNKNOWN = 0, ///< The PUnit power monitoring unit cannot be determined. ZES_LIMIT_UNIT_CURRENT = 1, ///< The limit is specified in milliamperes of current drawn. ZES_LIMIT_UNIT_POWER = 2, ///< The limit is specified in milliwatts of power generated. - ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff + ZES_LIMIT_UNIT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_LIMIT_UNIT_* ENUMs } zes_limit_unit_t; @@ -5285,7 +5310,7 @@ typedef enum _zes_psu_voltage_status_t ZES_PSU_VOLTAGE_STATUS_NORMAL = 1, ///< No unusual voltages have been detected ZES_PSU_VOLTAGE_STATUS_OVER = 2, ///< Over-voltage has occurred ZES_PSU_VOLTAGE_STATUS_UNDER = 3, ///< Under-voltage has occurred - ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff + ZES_PSU_VOLTAGE_STATUS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_PSU_VOLTAGE_STATUS_* ENUMs } zes_psu_voltage_status_t; @@ -5414,7 +5439,7 @@ typedef enum _zes_ras_error_type_t { ZES_RAS_ERROR_TYPE_CORRECTABLE = 0, ///< Errors were corrected by hardware ZES_RAS_ERROR_TYPE_UNCORRECTABLE = 1, ///< Error were not corrected - ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_TYPE_* ENUMs } zes_ras_error_type_t; @@ -5433,7 +5458,7 @@ typedef enum _zes_ras_error_cat_t ZES_RAS_ERROR_CAT_CACHE_ERRORS = 5, ///< The number of errors that have occurred in caches (L1/L3/register ///< file/shared local memory/sampler) ZES_RAS_ERROR_CAT_DISPLAY_ERRORS = 6, ///< The number of errors that have occurred in the display - ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_CAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CAT_* ENUMs } zes_ras_error_cat_t; @@ -5688,7 +5713,7 @@ typedef enum _zes_sched_mode_t ///< contexts must wait until the running context completes with no further ///< submitted work. ZES_SCHED_MODE_COMPUTE_UNIT_DEBUG = 3, ///< [DEPRECATED] No longer supported. - ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff + ZES_SCHED_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SCHED_MODE_* ENUMs } zes_sched_mode_t; @@ -6040,7 +6065,7 @@ zesSchedulerSetComputeUnitDebugMode( typedef enum _zes_standby_type_t { ZES_STANDBY_TYPE_GLOBAL = 0, ///< Control the overall standby policy of the device/sub-device - ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff + ZES_STANDBY_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_TYPE_* ENUMs } zes_standby_type_t; @@ -6065,7 +6090,7 @@ typedef enum _zes_standby_promo_mode_t ZES_STANDBY_PROMO_MODE_DEFAULT = 0, ///< Best compromise between performance and energy savings. ZES_STANDBY_PROMO_MODE_NEVER = 1, ///< The device/component will never shutdown. This can improve performance ///< but uses more energy. - ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff + ZES_STANDBY_PROMO_MODE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_STANDBY_PROMO_MODE_* ENUMs } zes_standby_promo_mode_t; @@ -6192,7 +6217,8 @@ typedef enum _zes_temp_sensors_t ZES_TEMP_SENSORS_MEMORY_MIN = 5, ///< The minimum temperature across all sensors in the local device memory ZES_TEMP_SENSORS_GPU_BOARD = 6, ///< The maximum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_GPU_BOARD_MIN = 7, ///< The minimum temperature across all sensors in the GPU Board - ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff + ZES_TEMP_SENSORS_VOLTAGE_REGULATOR = 8, ///< The maximum temperature across all sensors in the Voltage Regulator + ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_TEMP_SENSORS_* ENUMs } zes_temp_sensors_t; @@ -6404,6 +6430,41 @@ zesTemperatureGetState( ///< in degrees Celsius. ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs Device-ECC default properties +#if !defined(__GNUC__) +#pragma region eccState +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME +/// @brief Device ECC default properties Extension Name +#define ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME "ZES_extension_device_ecc_default_properties" +#endif // ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device ECC default properties Extension Version(s) +typedef enum _zes_device_ecc_default_properties_ext_version_t +{ + ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 + ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_* ENUMs + +} zes_device_ecc_default_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief This structure may be passed to ::zesDeviceGetEccState as pNext member +/// of ::zes_device_ecc_properties_t. +typedef struct _zes_device_ecc_default_properties_ext_t +{ + zes_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + zes_device_ecc_state_t defaultState; ///< [out] Default ECC state + +} zes_device_ecc_default_properties_ext_t; + #if !defined(__GNUC__) #pragma endregion #endif @@ -6423,7 +6484,7 @@ typedef enum _zes_power_limits_ext_version_t { ZES_POWER_LIMITS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_LIMITS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_POWER_LIMITS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_LIMITS_EXT_VERSION_* ENUMs } zes_power_limits_ext_version_t; @@ -6563,7 +6624,7 @@ typedef enum _zes_engine_activity_ext_version_t { ZES_ENGINE_ACTIVITY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_ENGINE_ACTIVITY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_ENGINE_ACTIVITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_ENGINE_ACTIVITY_EXT_VERSION_* ENUMs } zes_engine_activity_ext_version_t; @@ -6647,7 +6708,7 @@ typedef enum _zes_ras_state_exp_version_t { ZES_RAS_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_RAS_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_RAS_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_STATE_EXP_VERSION_* ENUMs } zes_ras_state_exp_version_t; @@ -6669,7 +6730,7 @@ typedef enum _zes_ras_error_category_exp_t ZES_RAS_ERROR_CATEGORY_EXP_MEMORY_ERRORS = 7, ///< The number of errors that have occurred in Memory ZES_RAS_ERROR_CATEGORY_EXP_SCALE_ERRORS = 8, ///< The number of errors that have occurred in Scale Fabric ZES_RAS_ERROR_CATEGORY_EXP_L3FABRIC_ERRORS = 9, ///< The number of errors that have occurred in L3 Fabric - ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff + ZES_RAS_ERROR_CATEGORY_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_RAS_ERROR_CATEGORY_EXP_* ENUMs } zes_ras_error_category_exp_t; @@ -6765,7 +6826,7 @@ typedef enum _zes_mem_page_offline_state_exp_version_t { ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_* ENUMs } zes_mem_page_offline_state_exp_version_t; @@ -6805,7 +6866,7 @@ typedef enum _zes_mem_bandwidth_counter_bits_exp_version_t { ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_* ENUMs } zes_mem_bandwidth_counter_bits_exp_version_t; @@ -6847,7 +6908,7 @@ typedef enum _zes_power_domain_properties_exp_version_t { ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_* ENUMs } zes_power_domain_properties_exp_version_t; @@ -6887,7 +6948,7 @@ typedef enum _zes_firmware_security_exp_version_t { ZES_FIRMWARE_SECURITY_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_FIRMWARE_SECURITY_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_FIRMWARE_SECURITY_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_FIRMWARE_SECURITY_EXP_VERSION_* ENUMs } zes_firmware_security_exp_version_t; @@ -6958,7 +7019,7 @@ typedef enum _zes_sysman_device_mapping_exp_version_t { ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_* ENUMs } zes_sysman_device_mapping_exp_version_t; @@ -7052,25 +7113,27 @@ zesDriverGetDeviceByUuidExp( /// @brief Virtual Function Management Extension Version(s) typedef enum _zes_vf_management_exp_version_t { - ZES_VF_MANAGEMENT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZES_VF_MANAGEMENT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZES_VF_MANAGEMENT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 (deprecated) + ZES_VF_MANAGEMENT_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 (deprecated) + ZES_VF_MANAGEMENT_EXP_VERSION_1_2 = ZE_MAKE_VERSION( 1, 2 ), ///< version 1.2 + ZES_VF_MANAGEMENT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 2 ), ///< latest known version + ZES_VF_MANAGEMENT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_MANAGEMENT_EXP_VERSION_* ENUMs } zes_vf_management_exp_version_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Virtual function memory types +/// @brief Virtual function memory types (deprecated) typedef uint32_t zes_vf_info_mem_type_exp_flags_t; typedef enum _zes_vf_info_mem_type_exp_flag_t { ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_SYSTEM = ZE_BIT(0), ///< System memory ZES_VF_INFO_MEM_TYPE_EXP_FLAG_MEM_TYPE_DEVICE = ZE_BIT(1), ///< Device local memory - ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_VF_INFO_MEM_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_MEM_TYPE_EXP_FLAG_* ENUMs } zes_vf_info_mem_type_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Virtual function utilization flag bit fields +/// @brief Virtual function utilization flag bit fields (deprecated) typedef uint32_t zes_vf_info_util_exp_flags_t; typedef enum _zes_vf_info_util_exp_flag_t { @@ -7078,12 +7141,12 @@ typedef enum _zes_vf_info_util_exp_flag_t ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_CPU = ZE_BIT(1), ///< System memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_MEM_GPU = ZE_BIT(2), ///< Device memory utilization associated with virtual function ZES_VF_INFO_UTIL_EXP_FLAG_INFO_ENGINE = ZE_BIT(3), ///< Engine utilization associated with virtual function - ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff + ZES_VF_INFO_UTIL_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZES_VF_INFO_UTIL_EXP_FLAG_* ENUMs } zes_vf_info_util_exp_flag_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Virtual function management properties +/// @brief Virtual function management properties (deprecated) typedef struct _zes_vf_exp_properties_t { zes_structure_type_t stype; ///< [in] type of this structure @@ -7097,7 +7160,7 @@ typedef struct _zes_vf_exp_properties_t } zes_vf_exp_properties_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Provides memory utilization values for a virtual function +/// @brief Provides memory utilization values for a virtual function (deprecated) typedef struct _zes_vf_util_mem_exp_t { zes_structure_type_t stype; ///< [in] type of this structure @@ -7111,7 +7174,7 @@ typedef struct _zes_vf_util_mem_exp_t } zes_vf_util_mem_exp_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Provides engine utilization values for a virtual function +/// @brief Provides engine utilization values for a virtual function (deprecated) typedef struct _zes_vf_util_engine_exp_t { zes_structure_type_t stype; ///< [in] type of this structure @@ -7124,10 +7187,69 @@ typedef struct _zes_vf_util_engine_exp_t } zes_vf_util_engine_exp_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Virtual function management capabilities (deprecated) +typedef struct _zes_vf_exp_capabilities_t +{ + zes_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + zes_pci_address_t address; ///< [out] Virtual function BDF address + uint32_t vfDeviceMemSize; ///< [out] Virtual function memory size in kilo bytes + uint32_t vfID; ///< [out] Virtual Function ID + +} zes_vf_exp_capabilities_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Virtual function management capabilities +typedef struct _zes_vf_exp2_capabilities_t +{ + zes_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + zes_pci_address_t address; ///< [out] Virtual function BDF address + uint64_t vfDeviceMemSize; ///< [out] Virtual function memory size in bytes + uint32_t vfID; ///< [out] Virtual Function ID + +} zes_vf_exp2_capabilities_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Provides memory utilization values for a virtual function +typedef struct _zes_vf_util_mem_exp2_t +{ + zes_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + zes_mem_loc_t vfMemLocation; ///< [out] Location of this memory (system, device) + uint64_t vfMemUtilized; ///< [out] Utilized memory size in bytes. + +} zes_vf_util_mem_exp2_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Provides engine utilization values for a virtual function +/// +/// @details +/// - Percent utilization is calculated by taking two snapshots (s1, s2) and +/// using the equation: %util = (s2.activeCounterValue - +/// s1.activeCounterValue) / (s2.samplingCounterValue - +/// s1.samplingCounterValue) +typedef struct _zes_vf_util_engine_exp2_t +{ + zes_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + zes_engine_group_t vfEngineType; ///< [out] The engine group. + uint64_t activeCounterValue; ///< [out] Represents active counter. + uint64_t samplingCounterValue; ///< [out] Represents counter value when activeCounterValue was sampled. + ///< Refer to the formulae above for calculating the utilization percent + +} zes_vf_util_engine_exp2_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Get handle of virtual function modules /// /// @details +/// - [DEPRECATED] No longer supported. Use ::zesDeviceEnumEnabledVFExp. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -7161,6 +7283,8 @@ zesDeviceEnumActiveVFExp( /// @brief Get virtual function management properties /// /// @details +/// - [DEPRECATED] No longer supported. Use +/// ::zesVFManagementGetVFCapabilitiesExp. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -7185,6 +7309,8 @@ zesVFManagementGetVFPropertiesExp( /// with Virtual Function (VF) /// /// @details +/// - [DEPRECATED] No longer supported. Use +/// ::zesVFManagementGetVFMemoryUtilizationExp2. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -7221,6 +7347,8 @@ zesVFManagementGetVFMemoryUtilizationExp( /// with Virtual Function (VF) /// /// @details +/// - [DEPRECATED] No longer supported. Use +/// ::zesVFManagementGetVFEngineUtilizationExp2. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -7257,6 +7385,7 @@ zesVFManagementGetVFEngineUtilizationExp( /// Virtual Function (VF) /// /// @details +/// - [DEPRECATED] No longer supported. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -7283,6 +7412,7 @@ zesVFManagementSetVFTelemetryModeExp( /// telemetry associated with Virtual Function (VF) /// /// @details +/// - [DEPRECATED] No longer supported. /// - The application may call this function from simultaneous threads. /// - The implementation of this function should be lock-free. /// @@ -7304,6 +7434,157 @@ zesVFManagementSetVFTelemetrySamplingIntervalExp( uint64_t samplingInterval ///< [in] Sampling interval value. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get handle of virtual function modules +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesDeviceEnumEnabledVFExp( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + uint32_t* pCount, ///< [in,out] pointer to the number of components of this type. + ///< if count is zero, then the driver shall update the value with the + ///< total number of components of this type that are available. + ///< if count is greater than the number of components of this type that + ///< are available, then the driver shall update the value with the correct + ///< number of components. + zes_vf_handle_t* phVFhandle ///< [in,out][optional][range(0, *pCount)] array of handle of components of + ///< this type. + ///< if count is less than the number of components of this type that are + ///< available, then the driver shall only retrieve that number of + ///< component handles. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get virtual function management capabilities +/// +/// @details +/// - [DEPRECATED] No longer supported. Use +/// ::zesVFManagementGetVFCapabilitiesExp2. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVFhandle` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCapability` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesVFManagementGetVFCapabilitiesExp( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp_capabilities_t* pCapability ///< [in,out] Will contain VF capability. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get memory activity stats for each available memory types associated +/// with Virtual Function (VF) +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// - If VF is disable/pause/not active, utilization will give zero value. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVFhandle` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesVFManagementGetVFMemoryUtilizationExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF memory stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of memory stats available. + ///< - if count is greater than the total number of memory stats + ///< available, the driver shall update the value with the correct number + ///< of memory stats available. + zes_vf_util_mem_exp2_t* pMemUtil ///< [in,out][optional][range(0, *pCount)] array of memory group activity counters. + ///< - if count is less than the total number of memory stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< memory stats. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get engine activity stats for each available engine group associated +/// with Virtual Function (VF) +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// - If VF is disable/pause/not active, utilization will give zero value. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVFhandle` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesVFManagementGetVFEngineUtilizationExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the component. + uint32_t* pCount, ///< [in,out] Pointer to the number of VF engine stats descriptors. + ///< - if count is zero, the driver shall update the value with the total + ///< number of engine stats available. + ///< - if count is greater than the total number of engine stats + ///< available, the driver shall update the value with the correct number + ///< of engine stats available. + zes_vf_util_engine_exp2_t* pEngineUtil ///< [in,out][optional][range(0, *pCount)] array of engine group activity counters. + ///< - if count is less than the total number of engine stats available, + ///< then driver shall only retrieve that number of stats. + ///< - the implementation shall populate the vector pCount-1 number of VF + ///< engine stats. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get virtual function management capabilities +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hVFhandle` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCapability` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesVFManagementGetVFCapabilitiesExp2( + zes_vf_handle_t hVFhandle, ///< [in] Sysman handle for the VF component. + zes_vf_exp2_capabilities_t* pCapability ///< [in,out] Will contain VF capability. + ); + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/backends/ze/include/zes_ddi.h b/backends/ze/include/zes_ddi.h index a33e838f1..24b533568 100644 --- a/backends/ze/include/zes_ddi.h +++ b/backends/ze/include/zes_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zes_ddi.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.1 * */ #ifndef _ZES_DDI_H @@ -418,12 +418,21 @@ typedef ze_result_t (ZE_APICALL *zes_pfnDeviceEnumActiveVFExp_t)( zes_vf_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesDeviceEnumEnabledVFExp +typedef ze_result_t (ZE_APICALL *zes_pfnDeviceEnumEnabledVFExp_t)( + zes_device_handle_t, + uint32_t*, + zes_vf_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of DeviceExp functions pointers typedef struct _zes_device_exp_dditable_t { zes_pfnDeviceGetSubDevicePropertiesExp_t pfnGetSubDevicePropertiesExp; zes_pfnDeviceEnumActiveVFExp_t pfnEnumActiveVFExp; + zes_pfnDeviceEnumEnabledVFExp_t pfnEnumEnabledVFExp; } zes_device_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -1886,6 +1895,36 @@ typedef ze_result_t (ZE_APICALL *zes_pfnVFManagementSetVFTelemetrySamplingInterv uint64_t ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesVFManagementGetVFCapabilitiesExp +typedef ze_result_t (ZE_APICALL *zes_pfnVFManagementGetVFCapabilitiesExp_t)( + zes_vf_handle_t, + zes_vf_exp_capabilities_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesVFManagementGetVFMemoryUtilizationExp2 +typedef ze_result_t (ZE_APICALL *zes_pfnVFManagementGetVFMemoryUtilizationExp2_t)( + zes_vf_handle_t, + uint32_t*, + zes_vf_util_mem_exp2_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesVFManagementGetVFEngineUtilizationExp2 +typedef ze_result_t (ZE_APICALL *zes_pfnVFManagementGetVFEngineUtilizationExp2_t)( + zes_vf_handle_t, + uint32_t*, + zes_vf_util_engine_exp2_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesVFManagementGetVFCapabilitiesExp2 +typedef ze_result_t (ZE_APICALL *zes_pfnVFManagementGetVFCapabilitiesExp2_t)( + zes_vf_handle_t, + zes_vf_exp2_capabilities_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of VFManagementExp functions pointers typedef struct _zes_vf_management_exp_dditable_t @@ -1895,6 +1934,10 @@ typedef struct _zes_vf_management_exp_dditable_t zes_pfnVFManagementGetVFEngineUtilizationExp_t pfnGetVFEngineUtilizationExp; zes_pfnVFManagementSetVFTelemetryModeExp_t pfnSetVFTelemetryModeExp; zes_pfnVFManagementSetVFTelemetrySamplingIntervalExp_t pfnSetVFTelemetrySamplingIntervalExp; + zes_pfnVFManagementGetVFCapabilitiesExp_t pfnGetVFCapabilitiesExp; + zes_pfnVFManagementGetVFMemoryUtilizationExp2_t pfnGetVFMemoryUtilizationExp2; + zes_pfnVFManagementGetVFEngineUtilizationExp2_t pfnGetVFEngineUtilizationExp2; + zes_pfnVFManagementGetVFCapabilitiesExp2_t pfnGetVFCapabilitiesExp2; } zes_vf_management_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -1948,6 +1991,36 @@ typedef struct _zes_dditable_t zes_diagnostics_dditable_t Diagnostics; zes_vf_management_exp_dditable_t VFManagementExp; } zes_dditable_t; +/// @brief Container for all DDI tables with version and tables set by the Driver +typedef struct _zes_dditable_driver_t +{ + ze_api_version_t version; + uint8_t isValidFlag; + zes_global_dditable_t * Global; + zes_device_dditable_t * Device; + zes_device_exp_dditable_t * DeviceExp; + zes_driver_dditable_t * Driver; + zes_driver_exp_dditable_t * DriverExp; + zes_overclock_dditable_t * Overclock; + zes_scheduler_dditable_t * Scheduler; + zes_performance_factor_dditable_t * PerformanceFactor; + zes_power_dditable_t * Power; + zes_frequency_dditable_t * Frequency; + zes_engine_dditable_t * Engine; + zes_standby_dditable_t * Standby; + zes_firmware_dditable_t * Firmware; + zes_firmware_exp_dditable_t * FirmwareExp; + zes_memory_dditable_t * Memory; + zes_fabric_port_dditable_t * FabricPort; + zes_temperature_dditable_t * Temperature; + zes_psu_dditable_t * Psu; + zes_fan_dditable_t * Fan; + zes_led_dditable_t * Led; + zes_ras_dditable_t * Ras; + zes_ras_exp_dditable_t * RasExp; + zes_diagnostics_dditable_t * Diagnostics; + zes_vf_management_exp_dditable_t * VFManagementExp; +} zes_dditable_driver_t; #if defined(__cplusplus) } // extern "C" diff --git a/backends/ze/include/zes_ddi_ver.h b/backends/ze/include/zes_ddi_ver.h index 0f68736a4..1578e60d3 100644 --- a/backends/ze/include/zes_ddi_ver.h +++ b/backends/ze/include/zes_ddi_ver.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zes_ddi.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.73 * */ #ifndef _ZES_DDI_VER_H @@ -174,12 +174,18 @@ typedef struct _zes_device_dditable_t_1_7 } zes_device_dditable_t_1_7; /////////////////////////////////////////////////////////////////////////////// -/// [1.9] +/// [1.1, 1.9] /// @brief Table of DeviceExp functions pointers +typedef struct _zes_device_exp_dditable_t_1_1 +{ + zes_pfnDeviceEnumEnabledVFExp_t pfnEnumEnabledVFExp; +} zes_device_exp_dditable_t_1_1; + typedef struct _zes_device_exp_dditable_t_1_9 { zes_pfnDeviceGetSubDevicePropertiesExp_t pfnGetSubDevicePropertiesExp; zes_pfnDeviceEnumActiveVFExp_t pfnEnumActiveVFExp; + zes_pfnDeviceEnumEnabledVFExp_t pfnEnumEnabledVFExp; } zes_device_exp_dditable_t_1_9; /////////////////////////////////////////////////////////////////////////////// @@ -468,8 +474,23 @@ typedef struct _zes_diagnostics_dditable_t_1_0 } zes_diagnostics_dditable_t_1_0; /////////////////////////////////////////////////////////////////////////////// -/// [1.9] +/// [1.1, 1.12, 1.9] /// @brief Table of VFManagementExp functions pointers +typedef struct _zes_vf_management_exp_dditable_t_1_1 +{ + zes_pfnVFManagementGetVFCapabilitiesExp_t pfnGetVFCapabilitiesExp; + zes_pfnVFManagementGetVFMemoryUtilizationExp2_t pfnGetVFMemoryUtilizationExp2; + zes_pfnVFManagementGetVFEngineUtilizationExp2_t pfnGetVFEngineUtilizationExp2; +} zes_vf_management_exp_dditable_t_1_1; + +typedef struct _zes_vf_management_exp_dditable_t_1_12 +{ + zes_pfnVFManagementGetVFCapabilitiesExp_t pfnGetVFCapabilitiesExp; + zes_pfnVFManagementGetVFMemoryUtilizationExp2_t pfnGetVFMemoryUtilizationExp2; + zes_pfnVFManagementGetVFEngineUtilizationExp2_t pfnGetVFEngineUtilizationExp2; + zes_pfnVFManagementGetVFCapabilitiesExp2_t pfnGetVFCapabilitiesExp2; +} zes_vf_management_exp_dditable_t_1_12; + typedef struct _zes_vf_management_exp_dditable_t_1_9 { zes_pfnVFManagementGetVFPropertiesExp_t pfnGetVFPropertiesExp; @@ -477,6 +498,10 @@ typedef struct _zes_vf_management_exp_dditable_t_1_9 zes_pfnVFManagementGetVFEngineUtilizationExp_t pfnGetVFEngineUtilizationExp; zes_pfnVFManagementSetVFTelemetryModeExp_t pfnSetVFTelemetryModeExp; zes_pfnVFManagementSetVFTelemetrySamplingIntervalExp_t pfnSetVFTelemetrySamplingIntervalExp; + zes_pfnVFManagementGetVFCapabilitiesExp_t pfnGetVFCapabilitiesExp; + zes_pfnVFManagementGetVFMemoryUtilizationExp2_t pfnGetVFMemoryUtilizationExp2; + zes_pfnVFManagementGetVFEngineUtilizationExp2_t pfnGetVFEngineUtilizationExp2; + zes_pfnVFManagementGetVFCapabilitiesExp2_t pfnGetVFCapabilitiesExp2; } zes_vf_management_exp_dditable_t_1_9; diff --git a/backends/ze/include/zet_api.h b/backends/ze/include/zet_api.h index a202fde6c..13b8ea01e 100644 --- a/backends/ze/include/zet_api.h +++ b/backends/ze/include/zet_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zet_api.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.1 * */ #ifndef _ZET_API_H @@ -99,7 +99,10 @@ typedef enum _zet_structure_type_t ZET_STRUCTURE_TYPE_METRIC_PROGRAMMABLE_EXP_PROPERTIES = 0x00010003, ///< ::zet_metric_programmable_exp_properties_t ZET_STRUCTURE_TYPE_METRIC_PROGRAMMABLE_PARAM_INFO_EXP = 0x00010004, ///< ::zet_metric_programmable_param_info_exp_t ZET_STRUCTURE_TYPE_METRIC_PROGRAMMABLE_PARAM_VALUE_INFO_EXP = 0x00010005, ///< ::zet_metric_programmable_param_value_info_exp_t - ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_STRUCTURE_TYPE_METRIC_GROUP_TYPE_EXP = 0x00010006, ///< ::zet_metric_group_type_exp_t + ZET_STRUCTURE_TYPE_EXPORT_DMA_EXP_PROPERTIES = 0x00010007, ///< ::zet_export_dma_buf_exp_properties_t + ZET_STRUCTURE_TYPE_METRIC_TRACER_EXP_DESC = 0x00010008, ///< ::zet_metric_tracer_exp_desc_t + ZET_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_STRUCTURE_TYPE_* ENUMs } zet_structure_type_t; @@ -135,7 +138,7 @@ typedef enum _zet_value_type_t ZET_VALUE_TYPE_STRING = 5, ///< C string ZET_VALUE_TYPE_UINT8 = 6, ///< 8-bit unsigned-integer ZET_VALUE_TYPE_UINT16 = 7, ///< 16-bit unsigned-integer - ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_VALUE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_VALUE_TYPE_* ENUMs } zet_value_type_t; @@ -250,6 +253,26 @@ typedef struct _zet_profile_register_sequence_t zet_profile_register_sequence_t; /// @brief Forward-declare zet_tracer_exp_desc_t typedef struct _zet_tracer_exp_desc_t zet_tracer_exp_desc_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_tracer_exp_desc_t +typedef struct _zet_metric_tracer_exp_desc_t zet_metric_tracer_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_entry_exp_t +typedef struct _zet_metric_entry_exp_t zet_metric_entry_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_group_type_exp_t +typedef struct _zet_metric_group_type_exp_t zet_metric_group_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_export_dma_buf_exp_properties_t +typedef struct _zet_export_dma_buf_exp_properties_t zet_export_dma_buf_exp_properties_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_metric_source_id_exp_t +typedef struct _zet_metric_source_id_exp_t zet_metric_source_id_exp_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare zet_metric_global_timestamps_resolution_exp_t typedef struct _zet_metric_global_timestamps_resolution_exp_t zet_metric_global_timestamps_resolution_exp_t; @@ -266,6 +289,10 @@ typedef struct _zet_metric_programmable_exp_properties_t zet_metric_programmable /// @brief Forward-declare zet_value_uint64_range_exp_t typedef struct _zet_value_uint64_range_exp_t zet_value_uint64_range_exp_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zet_value_fp64_range_exp_t +typedef struct _zet_value_fp64_range_exp_t zet_value_fp64_range_exp_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare zet_metric_programmable_param_info_exp_t typedef struct _zet_metric_programmable_param_info_exp_t zet_metric_programmable_param_info_exp_t; @@ -312,7 +339,7 @@ typedef struct _zet_metric_programmable_param_value_exp_t zet_metric_programmabl typedef enum _zet_module_debug_info_format_t { ZET_MODULE_DEBUG_INFO_FORMAT_ELF_DWARF = 0, ///< Format is ELF/DWARF - ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff + ZET_MODULE_DEBUG_INFO_FORMAT_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_MODULE_DEBUG_INFO_FORMAT_* ENUMs } zet_module_debug_info_format_t; @@ -360,7 +387,7 @@ typedef uint32_t zet_device_debug_property_flags_t; typedef enum _zet_device_debug_property_flag_t { ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH = ZE_BIT(0), ///< the device supports attaching for debug - ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEVICE_DEBUG_PROPERTY_FLAG_* ENUMs } zet_device_debug_property_flag_t; @@ -457,7 +484,7 @@ typedef enum _zet_debug_event_flag_t { ZET_DEBUG_EVENT_FLAG_NEED_ACK = ZE_BIT(0), ///< The event needs to be acknowledged by calling ///< ::zetDebugAcknowledgeEvent. - ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_EVENT_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_FLAG_* ENUMs } zet_debug_event_flag_t; @@ -474,7 +501,7 @@ typedef enum _zet_debug_event_type_t ZET_DEBUG_EVENT_TYPE_THREAD_STOPPED = 6, ///< The thread stopped due to a device exception ZET_DEBUG_EVENT_TYPE_THREAD_UNAVAILABLE = 7, ///< The thread is not available to be stopped ZET_DEBUG_EVENT_TYPE_PAGE_FAULT = 8, ///< A page request could not be completed on the device - ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_EVENT_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_EVENT_TYPE_* ENUMs } zet_debug_event_type_t; @@ -484,7 +511,7 @@ typedef enum _zet_debug_detach_reason_t { ZET_DEBUG_DETACH_REASON_INVALID = 0, ///< The detach reason is not valid ZET_DEBUG_DETACH_REASON_HOST_EXIT = 1, ///< The host process exited - ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_DETACH_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_DETACH_REASON_* ENUMs } zet_debug_detach_reason_t; @@ -524,7 +551,7 @@ typedef enum _zet_debug_page_fault_reason_t ZET_DEBUG_PAGE_FAULT_REASON_INVALID = 0, ///< The page fault reason is not valid ZET_DEBUG_PAGE_FAULT_REASON_MAPPING_ERROR = 1, ///< The address is not mapped ZET_DEBUG_PAGE_FAULT_REASON_PERMISSION_ERROR = 2, ///< Invalid access permissions - ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_PAGE_FAULT_REASON_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_PAGE_FAULT_REASON_* ENUMs } zet_debug_page_fault_reason_t; @@ -652,7 +679,8 @@ typedef enum _zet_debug_memory_space_type_t { ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT = 0, ///< default memory space (attribute may be omitted) ZET_DEBUG_MEMORY_SPACE_TYPE_SLM = 1, ///< shared local memory space (GPU-only) - ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_MEMORY_SPACE_TYPE_ELF = 2, ///< ELF file memory space + ZET_DEBUG_MEMORY_SPACE_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_MEMORY_SPACE_TYPE_* ENUMs } zet_debug_memory_space_type_t; @@ -687,7 +715,7 @@ typedef struct _zet_debug_memory_space_desc_t /// + `nullptr == desc` /// + `nullptr == buffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZET_DEBUG_MEMORY_SPACE_TYPE_SLM < desc->type` +/// + `::ZET_DEBUG_MEMORY_SPACE_TYPE_ELF < desc->type` /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE /// + the thread is running or unavailable /// + the memory cannot be accessed from the supplied thread @@ -719,7 +747,7 @@ zetDebugReadMemory( /// + `nullptr == desc` /// + `nullptr == buffer` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `::ZET_DEBUG_MEMORY_SPACE_TYPE_SLM < desc->type` +/// + `::ZET_DEBUG_MEMORY_SPACE_TYPE_ELF < desc->type` /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE /// + the thread is running or unavailable /// + the memory cannot be accessed from the supplied thread @@ -739,7 +767,7 @@ typedef enum _zet_debug_regset_flag_t { ZET_DEBUG_REGSET_FLAG_READABLE = ZE_BIT(0), ///< register set is readable ZET_DEBUG_REGSET_FLAG_WRITEABLE = ZE_BIT(1), ///< register set is writeable - ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_DEBUG_REGSET_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_DEBUG_REGSET_FLAG_* ENUMs } zet_debug_regset_flag_t; @@ -844,8 +872,8 @@ zetDebugReadRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to read; start+count must be less than or - ///< equal to the `count` member of ::zet_debug_register_group_properties_t - ///< for the type + ///< equal to the `count` member of ::zet_debug_regset_properties_t for the + ///< type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -871,8 +899,8 @@ zetDebugWriteRegisters( ///< than the `count` member of ::zet_debug_regset_properties_t for the ///< type uint32_t count, ///< [in] the number of registers to write; start+count must be less than - ///< or equal to the `count` member of - ///< ::zet_debug_register_group_properties_t for the type + ///< or equal to the `count` member of ::zet_debug_regset_properties_t for + ///< the type void* pRegisterValues ///< [in,out][optional][range(0, count)] buffer of register values ); @@ -932,7 +960,8 @@ typedef enum _zet_metric_group_sampling_type_flag_t { ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EVENT_BASED = ZE_BIT(0), ///< Event based sampling ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_TIME_BASED = ZE_BIT(1), ///< Time based sampling - ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_EXP_TRACER_BASED = ZE_BIT(2), ///< Experimental Tracer based sampling + ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_SAMPLING_TYPE_FLAG_* ENUMs } zet_metric_group_sampling_type_flag_t; @@ -987,10 +1016,17 @@ typedef enum _zet_metric_type_t ZET_METRIC_TYPE_FLAG = 5, ///< Metric type: flag ZET_METRIC_TYPE_RATIO = 6, ///< Metric type: ratio ZET_METRIC_TYPE_RAW = 7, ///< Metric type: raw + ZET_METRIC_TYPE_EVENT_EXP_TIMESTAMP = 0x7ffffff9, ///< Metric type: event with only timestamp and value has no meaning + ZET_METRIC_TYPE_EVENT_EXP_START = 0x7ffffffa, ///< Metric type: the first event of a start/end event pair + ZET_METRIC_TYPE_EVENT_EXP_END = 0x7ffffffb, ///< Metric type: the second event of a start/end event pair + ZET_METRIC_TYPE_EVENT_EXP_MONOTONIC_WRAPS_VALUE = 0x7ffffffc, ///< Metric type: value of the event is a monotonically increasing value + ///< that can wrap around + ZET_METRIC_TYPE_EXP_EXPORT_DMA_BUF = 0x7ffffffd, ///< Metric which exports linux dma_buf, which could be imported/mapped to + ///< the host process ZET_METRIC_TYPE_IP_EXP = 0x7ffffffe, ///< Metric type: instruction pointer. Deprecated, use ///< ::ZET_METRIC_TYPE_IP. ZET_METRIC_TYPE_IP = 0x7ffffffe, ///< Metric type: instruction pointer - ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_TYPE_* ENUMs } zet_metric_type_t; @@ -1000,7 +1036,7 @@ typedef enum _zet_metric_group_calculation_type_t { ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES = 0, ///< Calculated metric values from raw data. ZET_METRIC_GROUP_CALCULATION_TYPE_MAX_METRIC_VALUES = 1, ///< Maximum metric values. - ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_GROUP_CALCULATION_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_CALCULATION_TYPE_* ENUMs } zet_metric_group_calculation_type_t; @@ -1316,7 +1352,7 @@ typedef enum _zet_metric_query_pool_type_t { ZET_METRIC_QUERY_POOL_TYPE_PERFORMANCE = 0, ///< Performance metric query pool. ZET_METRIC_QUERY_POOL_TYPE_EXECUTION = 1, ///< Skips workload execution between begin/end calls. - ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_QUERY_POOL_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_QUERY_POOL_TYPE_* ENUMs } zet_metric_query_pool_type_t; @@ -1594,7 +1630,7 @@ typedef enum _zet_profile_flag_t ZET_PROFILE_FLAG_REGISTER_REALLOCATION = ZE_BIT(0), ///< request the compiler attempt to minimize register usage as much as ///< possible to allow for instrumentation ZET_PROFILE_FLAG_FREE_REGISTER_INFO = ZE_BIT(1), ///< request the compiler generate free register info - ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff + ZET_PROFILE_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_FLAG_* ENUMs } zet_profile_flag_t; @@ -1616,7 +1652,7 @@ typedef struct _zet_profile_properties_t typedef enum _zet_profile_token_type_t { ZET_PROFILE_TOKEN_TYPE_FREE_REGISTER = 0, ///< GRF info - ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff + ZET_PROFILE_TOKEN_TYPE_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_PROFILE_TOKEN_TYPE_* ENUMs } zet_profile_token_type_t; @@ -1689,7 +1725,7 @@ typedef enum _zet_api_tracing_exp_version_t { ZET_API_TRACING_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZET_API_TRACING_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZET_API_TRACING_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_API_TRACING_EXP_VERSION_* ENUMs } zet_api_tracing_exp_version_t; @@ -1839,6 +1875,599 @@ zetTracerExpSetEnabled( ze_bool_t enable ///< [in] enable the tracer if true; disable if false ); +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension to get Concurrent Metric Groups +#if !defined(__GNUC__) +#pragma region concurrentMetricGroup +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME +/// @brief Concurrent Metric Groups Experimental Extension Name +#define ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME "ZET_experimental_concurrent_metric_groups" +#endif // ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Concurrent Metric Groups Experimental Extension Version(s) +typedef enum _zet_concurrent_metric_groups_exp_version_t +{ + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_* ENUMs + +} zet_concurrent_metric_groups_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get sets of metric groups which could be collected concurrently. +/// +/// @details +/// - Re-arrange the input metric groups to provide sets of concurrent +/// metric groups. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// + `nullptr == phMetricGroups` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetDeviceGetConcurrentMetricGroupsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t * phMetricGroups, ///< [in,out] metrics groups to be re-arranged to be sets of concurrent + ///< groups + uint32_t * pMetricGroupsCountPerConcurrentGroup, ///< [in,out][optional][*pConcurrentGroupCount] count of metric groups per + ///< concurrent group. + uint32_t * pConcurrentGroupCount ///< [out] number of concurrent groups. + ///< The value of this parameter could be used to determine the number of + ///< replays necessary. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Metrics Tracer +#if !defined(__GNUC__) +#pragma region metricTracer +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_METRICS_TRACER_EXP_NAME +/// @brief Metric Tracer Experimental Extension Name +#define ZET_METRICS_TRACER_EXP_NAME "ZET_experimental_metric_tracer" +#endif // ZET_METRICS_TRACER_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric Tracer Experimental Extension Version(s) +typedef enum _zet_metric_tracer_exp_version_t +{ + ZET_METRIC_TRACER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_METRIC_TRACER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_METRIC_TRACER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_TRACER_EXP_VERSION_* ENUMs + +} zet_metric_tracer_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of metric tracer's object +typedef struct _zet_metric_tracer_exp_handle_t *zet_metric_tracer_exp_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Handle of metric decoder's object +typedef struct _zet_metric_decoder_exp_handle_t *zet_metric_decoder_exp_handle_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric tracer descriptor +typedef struct _zet_metric_tracer_exp_desc_t +{ + zet_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t notifyEveryNBytes; ///< [in,out] number of collected bytes after which notification event will + ///< be signaled. If the requested value is not supported exactly, then the + ///< driver may use a value that is the closest supported approximation and + ///< shall update this member during ::zetMetricTracerCreateExp. + +} zet_metric_tracer_exp_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Decoded metric entry +typedef struct _zet_metric_entry_exp_t +{ + zet_value_t value; ///< [out] value of the decodable metric entry or event. Number is + ///< meaningful based on the metric type. + uint64_t timeStamp; ///< [out] timestamp at which the event happened. + uint32_t metricIndex; ///< [out] index to the decodable metric handle in the input array + ///< (phMetric) in ::zetMetricTracerDecodeExp(). + ze_bool_t onSubdevice; ///< [out] True if the event occurred on a sub-device; false means the + ///< device on which the metric tracer was opened does not have + ///< sub-devices. + uint32_t subdeviceId; ///< [out] If onSubdevice is true, this gives the ID of the sub-device. + +} zet_metric_entry_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create a metric tracer for a device. +/// +/// @details +/// - The notification event must have been created from an event pool that +/// was created using ::ZE_EVENT_POOL_FLAG_HOST_VISIBLE flag. +/// - The duration of the signal event created from an event pool that was +/// created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. +/// However, for consistency and orthogonality the event will report +/// correctly as signaled when used by other event API functionality. +/// - The application must **not** call this function from simultaneous +/// threads with the same device handle. +/// - The metric tracer is created in disabled state +/// - Metric groups must support sampling type +/// ZET_METRIC_SAMPLING_TYPE_EXP_FLAG_TRACER_BASED +/// - All metric groups must be first activated +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hContext` +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phMetricGroups` +/// + `nullptr == desc` +/// + `nullptr == phMetricTracer` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerCreateExp( + zet_context_handle_t hContext, ///< [in] handle of the context object + zet_device_handle_t hDevice, ///< [in] handle of the device + uint32_t metricGroupCount, ///< [in] metric group count + zet_metric_group_handle_t* phMetricGroups, ///< [in][range(0, metricGroupCount )] handles of the metric groups to + ///< trace + zet_metric_tracer_exp_desc_t* desc, ///< [in,out] metric tracer descriptor + ze_event_handle_t hNotificationEvent, ///< [in][optional] event used for report availability notification. Note: + ///< If buffer is not drained when the event it flagged, there is a risk of + ///< HW event buffer being overrun + zet_metric_tracer_exp_handle_t* phMetricTracer ///< [out] handle of the metric tracer + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroy a metric tracer. +/// +/// @details +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hMetricTracer` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerDestroyExp( + zet_metric_tracer_exp_handle_t hMetricTracer ///< [in] handle of the metric tracer + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Start events collection +/// +/// @details +/// - Driver implementations must make this API call have as minimal +/// overhead as possible, to allow applications start/stop event +/// collection at any point during execution +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hMetricTracer` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerEnableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_NOT_READY will be returned + ///< when the tracer is inactive. ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Stop events collection +/// +/// @details +/// - Driver implementations must make this API call have as minimal +/// overhead as possible, to allow applications start/stop event +/// collection at any point during execution +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hMetricTracer` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerDisableExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + ze_bool_t synchronous ///< [in] request synchronous behavior. Confirmation of successful + ///< asynchronous operation is done by calling ::zetMetricTracerReadDataExp() + ///< and checking the return status: ::ZE_RESULT_SUCCESS will be returned + ///< when the tracer is active or when it is inactive but still has data. + ///< ::ZE_RESULT_NOT_READY will be returned when the tracer is inactive and + ///< has no more data to be retrieved. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Read data from the metric tracer +/// +/// @details +/// - The application must **not** call this function from simultaneous +/// threads with the same metric tracer handle. +/// - Data can be retrieved after tracer is disabled. When buffers are +/// drained ::ZE_RESULT_NOT_READY will be returned +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hMetricTracer` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawDataSize` +/// - ::ZE_RESULT_WARNING_DROPPED_DATA +/// + Metric tracer data may have been dropped. +/// - ::ZE_RESULT_NOT_READY +/// + Metric tracer is disabled and no data is available to read. +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerReadDataExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + size_t* pRawDataSize, ///< [in,out] pointer to size in bytes of raw data requested to read. + ///< if size is zero, then the driver will update the value with the total + ///< size in bytes needed for all data available. + ///< if size is non-zero, then driver will only retrieve that amount of + ///< data. + ///< if size is larger than size needed for all data, then driver will + ///< update the value with the actual size needed. + uint8_t* pRawData ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create a metric decoder for a given metric tracer. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hMetricTracer` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phMetricDecoder` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricDecoderCreateExp( + zet_metric_tracer_exp_handle_t hMetricTracer, ///< [in] handle of the metric tracer + zet_metric_decoder_exp_handle_t* phMetricDecoder ///< [out] handle of the metric decoder object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Destroy a metric decoder. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == phMetricDecoder` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricDecoderDestroyExp( + zet_metric_decoder_exp_handle_t phMetricDecoder ///< [in] handle of the metric decoder object + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Return the list of the decodable metrics from the decoder. +/// +/// @details +/// - The decodable metrics handles returned by this API are defined by the +/// metric groups in the tracer on which the decoder was created. +/// - The decodable metrics handles returned by this API are only valid to +/// decode metrics raw data with ::zetMetricTracerDecodeExp(). Decodable +/// metric handles are not valid to compare with metrics handles included +/// in metric groups. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hMetricDecoder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pCount` +/// + `nullptr == phMetrics` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricDecoderGetDecodableMetricsExp( + zet_metric_decoder_exp_handle_t hMetricDecoder, ///< [in] handle of the metric decoder object + uint32_t* pCount, ///< [in,out] pointer to number of decodable metric in the hMetricDecoder + ///< handle. If count is zero, then the driver shall + ///< update the value with the total number of decodable metrics available + ///< in the decoder. if count is greater than zero + ///< but less than the total number of decodable metrics available in the + ///< decoder, then only that number will be returned. + ///< if count is greater than the number of decodable metrics available in + ///< the decoder, then the driver shall update the + ///< value with the actual number of decodable metrics available. + zet_metric_handle_t* phMetrics ///< [in,out] [range(0, *pCount)] array of handles of decodable metrics in + ///< the hMetricDecoder handle provided. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Decode raw events collected from a tracer. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == phMetricDecoder` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pRawDataSize` +/// + `nullptr == phMetrics` +/// + `nullptr == pSetCount` +/// + `nullptr == pMetricEntriesCount` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricTracerDecodeExp( + zet_metric_decoder_exp_handle_t phMetricDecoder, ///< [in] handle of the metric decoder object + size_t* pRawDataSize, ///< [in,out] size in bytes of raw data buffer. If pMetricEntriesCount is + ///< greater than zero but less than total number of + ///< decodable metrics available in the raw data buffer, then driver shall + ///< update this value with actual number of raw + ///< data bytes processed. + uint8_t* pRawData, ///< [in,out][optional][range(0, *pRawDataSize)] buffer containing tracer + ///< data in raw format + uint32_t metricsCount, ///< [in] number of decodable metrics in the tracer for which the + ///< hMetricDecoder handle was provided. See + ///< ::zetMetricDecoderGetDecodableMetricsExp(). If metricCount is greater + ///< than zero but less than the number decodable + ///< metrics available in the raw data buffer, then driver shall only + ///< decode those. + zet_metric_handle_t* phMetrics, ///< [in] [range(0, metricsCount)] array of handles of decodable metrics in + ///< the decoder for which the hMetricDecoder handle was + ///< provided. Metrics handles are expected to be for decodable metrics, + ///< see ::zetMetricDecoderGetDecodableMetricsExp() + uint32_t* pSetCount, ///< [in,out] pointer to number of metric sets. If count is zero, then the + ///< driver shall update the value with the total + ///< number of metric sets to be decoded. If count is greater than the + ///< number available in the raw data buffer, then the + ///< driver shall update the value with the actual number of metric sets to + ///< be decoded. There is a 1:1 relation between + ///< the number of sets and sub-devices returned in the decoded entries. + uint32_t* pMetricEntriesCountPerSet, ///< [in,out][optional][range(0, *pSetCount)] buffer of metric entries + ///< counts per metric set, one value per set. + uint32_t* pMetricEntriesCount, ///< [in,out] pointer to the total number of metric entries decoded, for + ///< all metric sets. If count is zero, then the + ///< driver shall update the value with the total number of metric entries + ///< to be decoded. If count is greater than zero + ///< but less than the total number of metric entries available in the raw + ///< data, then user provided number will be decoded. + ///< If count is greater than the number available in the raw data buffer, + ///< then the driver shall update the value with + ///< the actual number of decodable metric entries decoded. If set to null, + ///< then driver will only update the value of + ///< pSetCount. + zet_metric_entry_exp_t* pMetricEntries ///< [in,out][optional][range(0, *pMetricEntriesCount)] buffer containing + ///< decoded metric entries + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Metrics/Metric Groups which export Memory +#if !defined(__GNUC__) +#pragma region metricExportMemory +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Metric group type +typedef uint32_t zet_metric_group_type_exp_flags_t; +typedef enum _zet_metric_group_type_exp_flag_t +{ + ZET_METRIC_GROUP_TYPE_EXP_FLAG_EXPORT_DMA_BUF = ZE_BIT(0), ///< Metric group and metrics exports memory using linux dma-buf, which + ///< could be imported/mapped to the host process. Properties of the + ///< dma_buf could be queried using ::zet_export_dma_buf_exp_properties_t. + ZET_METRIC_GROUP_TYPE_EXP_FLAG_USER_CREATED = ZE_BIT(1), ///< Metric group created using ::zetDeviceCreateMetricGroupsFromMetricsExp + ZET_METRIC_GROUP_TYPE_EXP_FLAG_OTHER = ZE_BIT(2), ///< Metric group which has a collection of metrics + ZET_METRIC_GROUP_TYPE_EXP_FLAG_MARKER = ZE_BIT(3), ///< Metric group is capable of generating Marker metric + ZET_METRIC_GROUP_TYPE_EXP_FLAG_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_TYPE_EXP_FLAG_* ENUMs + +} zet_metric_group_type_exp_flag_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query the metric group type using `pNext` of +/// ::zet_metric_group_properties_t +typedef struct _zet_metric_group_type_exp_t +{ + zet_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + zet_metric_group_type_exp_flags_t type; ///< [out] metric group type. + ///< returns a combination of ::zet_metric_group_type_exp_flags_t. + +} zet_metric_group_type_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported dma_buf properties queried using `pNext` of +/// ::zet_metric_group_properties_t or ::zet_metric_properties_t +typedef struct _zet_export_dma_buf_exp_properties_t +{ + zet_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + int fd; ///< [out] the file descriptor handle that could be used to import the + ///< memory by the host process. + size_t size; ///< [out] size in bytes of the dma_buf + +} zet_export_dma_buf_exp_properties_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension to support Markers using MetricGroup +#if !defined(__GNUC__) +#pragma region metricGroupMarker +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_METRIC_GROUP_MARKER_EXP_NAME +/// @brief Marker Support Using MetricGroup Experimental Extension Name +#define ZET_METRIC_GROUP_MARKER_EXP_NAME "ZET_experimental_metric_group_marker" +#endif // ZET_METRIC_GROUP_MARKER_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Marker Support Using MetricGroup Experimental Extension Version(s) +typedef enum _zet_metric_group_marker_exp_version_t +{ + ZET_METRIC_GROUP_MARKER_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_METRIC_GROUP_MARKER_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_METRIC_GROUP_MARKER_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_GROUP_MARKER_EXP_VERSION_* ENUMs + +} zet_metric_group_marker_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Query the metric source unique identifier using `pNext` of +/// ::zet_metric_group_properties_t +typedef struct _zet_metric_source_id_exp_t +{ + zet_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t sourceId; ///< [out] unique number representing the Metric Source. + +} zet_metric_source_id_exp_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Append a Marker based on the Metric source of the Metric Group, to a +/// Command List. +/// +/// @details +/// - This function appends a Marker based on the Metric source of the +/// Metric Group, to Command List. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hMetricGroup` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetCommandListAppendMarkerExp( + zet_command_list_handle_t hCommandList, ///< [in] handle to the command list + zet_metric_group_handle_t hMetricGroup, ///< [in] handle to the marker metric group. + ///< ::zet_metric_group_type_exp_flags_t could be used to check whether + ///< marker is supoported by the metric group. + uint32_t value ///< [in] marker value + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Tool Experimental Extension for Runtime Enabling and Disabling metrics +#if !defined(__GNUC__) +#pragma region metricRuntimeEnableDisable +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME +/// @brief Runtime Enabling and Disabling Metrics Extension Name +#define ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME "ZET_experimental_metrics_runtime_enable_disable" +#endif // ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Runtime Enabling and Disabling Metrics Extension Version(s) +typedef enum _zet_metrics_runtime_enable_disable_exp_version_t +{ + ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_* ENUMs + +} zet_metrics_runtime_enable_disable_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Enable Metrics collection during runtime. +/// +/// @details +/// - This API enables metric collection for a device/sub-device if not +/// already enabled. +/// - if ZET_ENABLE_METRICS=1 was already set, then calling this api would +/// be a NOP. +/// - This api should be called after calling zeInit(). +/// - If device is a root-device handle, then its sub-devices are also +/// enabled. +/// - ::zetDeviceDisableMetricsExp need not be called if if this api returns +/// error. +/// - This API can be used as runtime alternative to setting +/// ZET_ENABLE_METRICS=1. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetDeviceEnableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be enabled. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Disable Metrics collection during runtime, if it was already enabled. +/// +/// @details +/// - This API disables metrics collection for a device/sub-device, if it +/// was previously enabled. +/// - If device is a root-device handle, then its sub-devices are also +/// disabled. +/// - The application has to ensure that all metric operations are complete +/// and all metric resources are released before this API is called. +/// - If there are metric operations in progress or metric resources are not +/// released, then ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE is returned. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +ZE_APIEXPORT ze_result_t ZE_APICALL +zetDeviceDisableMetricsExp( + zet_device_handle_t hDevice ///< [in] handle of the device where metrics collection has to be disabled + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -1858,7 +2487,7 @@ typedef enum _ze_calculate_multiple_metrics_exp_version_t { ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version - ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_* ENUMs } ze_calculate_multiple_metrics_exp_version_t; @@ -1936,7 +2565,7 @@ typedef enum _ze_metric_global_timestamps_exp_version_t { ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_* ENUMs } ze_metric_global_timestamps_exp_version_t; @@ -2005,7 +2634,7 @@ typedef enum _zet_export_metric_data_exp_version_t { ZET_EXPORT_METRIC_DATA_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 ZET_EXPORT_METRIC_DATA_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_EXPORT_METRIC_DATA_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZET_EXPORT_METRIC_DATA_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_EXPORT_METRIC_DATA_EXP_VERSION_* ENUMs } zet_export_metric_data_exp_version_t; @@ -2141,9 +2770,9 @@ zetMetricGroupCalculateMetricExportDataExp( /// @brief Programmable Metrics Experimental Extension Version(s) typedef enum _zet_metric_programmable_exp_version_t { - ZET_METRIC_PROGRAMMABLE_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZET_METRIC_PROGRAMMABLE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZET_METRIC_PROGRAMMABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 1 ), ///< latest known version + ZET_METRIC_PROGRAMMABLE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_PROGRAMMABLE_EXP_VERSION_* ENUMs } zet_metric_programmable_exp_version_t; @@ -2159,6 +2788,12 @@ typedef enum _zet_metric_programmable_exp_version_t #define ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP 256 #endif // ZET_MAX_PROGRAMMABLE_METRICS_ELEMENT_DESCRIPTION_EXP +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP +/// @brief Maximum count of characters in metric group name prefix +#define ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP 64 +#endif // ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP + /////////////////////////////////////////////////////////////////////////////// #ifndef ZET_MAX_METRIC_PROGRAMMABLE_NAME_EXP /// @brief Maximum metric programmable name string size @@ -2184,10 +2819,16 @@ typedef enum _zet_metric_programmable_exp_version_t #endif // ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP /////////////////////////////////////////////////////////////////////////////// -#ifndef ZET_MAX_VALUE_INFO_CSTRING_EXP -/// @brief Maximum value information string size -#define ZET_MAX_VALUE_INFO_CSTRING_EXP 128 -#endif // ZET_MAX_VALUE_INFO_CSTRING_EXP +#ifndef ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP +/// @brief Maximum value for programmable value description +#define ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP 128 +#endif // ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_MAX_METRIC_GROUP_NAME_PREFIX +/// @brief Maximum value metric group name prefix +#define ZE_MAX_METRIC_GROUP_NAME_PREFIX 64 +#endif // ZE_MAX_METRIC_GROUP_NAME_PREFIX /////////////////////////////////////////////////////////////////////////////// /// @brief Handle of metric programmable's object @@ -2224,7 +2865,9 @@ typedef enum _zet_metric_programmable_param_type_exp_t ///< instance_count. ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_AVERAGE = 3, ///< Produces normalization using raw_metric / HW instance_count. ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_RATE = 4, ///< Produces normalization average using raw_metric / timestamp. - ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_FORCE_UINT32 = 0x7fffffff + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_NORMALIZATION_BYTES = 5, ///< Produces normalization average using raw_metric * n bytes. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_GENERIC = 6, ///< Generic Parameter type. Please refer the parameter's description. + ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_* ENUMs } zet_metric_programmable_param_type_exp_t; @@ -2237,11 +2880,11 @@ typedef enum _zet_value_info_type_exp_t ZET_VALUE_INFO_TYPE_EXP_FLOAT32 = 2, ///< 32-bit floating-point ZET_VALUE_INFO_TYPE_EXP_FLOAT64 = 3, ///< 64-bit floating-point ZET_VALUE_INFO_TYPE_EXP_BOOL8 = 4, ///< 8-bit boolean - ZET_VALUE_INFO_TYPE_EXP_CSTRING = 5, ///< C string - ZET_VALUE_INFO_TYPE_EXP_UINT8 = 6, ///< 8-bit unsigned-integer - ZET_VALUE_INFO_TYPE_EXP_UINT16 = 7, ///< 16-bit unsigned-integer - ZET_VALUE_INFO_TYPE_EXP_UINT64_RANGE = 8, ///< 64-bit unsigned-integer range (minimum and maximum) - ZET_VALUE_INFO_TYPE_EXP_FORCE_UINT32 = 0x7fffffff + ZET_VALUE_INFO_TYPE_EXP_UINT8 = 5, ///< 8-bit unsigned-integer + ZET_VALUE_INFO_TYPE_EXP_UINT16 = 6, ///< 16-bit unsigned-integer + ZET_VALUE_INFO_TYPE_EXP_UINT64_RANGE = 7, ///< 64-bit unsigned-integer range (minimum and maximum) + ZET_VALUE_INFO_TYPE_EXP_FLOAT64_RANGE = 8, ///< 64-bit floating point range (minimum and maximum) + ZET_VALUE_INFO_TYPE_EXP_FORCE_UINT32 = 0x7fffffff, ///< Value marking end of ZET_VALUE_INFO_TYPE_EXP_* ENUMs } zet_value_info_type_exp_t; @@ -2250,10 +2893,19 @@ typedef enum _zet_value_info_type_exp_t typedef struct _zet_value_uint64_range_exp_t { uint64_t ui64Min; ///< [out] minimum value of the range - uint64_t ui64Max; ///< [out] max value of the range + uint64_t ui64Max; ///< [out] maximum value of the range } zet_value_uint64_range_exp_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Value info of type float64 range +typedef struct _zet_value_fp64_range_exp_t +{ + double fp64Min; ///< [out] minimum value of the range + double fp64Max; ///< [out] maximum value of the range + +} zet_value_fp64_range_exp_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Union of value information typedef union _zet_value_info_exp_t @@ -2265,8 +2917,8 @@ typedef union _zet_value_info_exp_t ze_bool_t b8; ///< [out] 8-bit boolean uint8_t ui8; ///< [out] 8-bit unsigned integer uint16_t ui16; ///< [out] 16-bit unsigned integer - char cString[ZET_MAX_VALUE_INFO_CSTRING_EXP]; ///< [out] cString zet_value_uint64_range_exp_t ui64Range; ///< [out] minimum and maximum value of the range + zet_value_fp64_range_exp_t fp64Range; ///< [out] minimum and maximum value of the range } zet_value_info_exp_t; @@ -2275,7 +2927,7 @@ typedef union _zet_value_info_exp_t typedef struct _zet_metric_programmable_param_info_exp_t { zet_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). zet_metric_programmable_param_type_exp_t type; ///< [out] programmable parameter type char name[ZET_MAX_METRIC_PROGRAMMABLE_PARAMETER_NAME_EXP]; ///< [out] metric programmable parameter name @@ -2290,9 +2942,10 @@ typedef struct _zet_metric_programmable_param_info_exp_t typedef struct _zet_metric_programmable_param_value_info_exp_t { zet_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). zet_value_info_exp_t valueInfo; ///< [out] information about the parameter value + char description[ZET_MAX_METRIC_PROGRAMMABLE_VALUE_DESCRIPTION_EXP]; ///< [out] description about the value } zet_metric_programmable_param_value_info_exp_t; @@ -2431,7 +3084,7 @@ zetMetricProgrammableGetParamValueInfoExp( /// - If parameterCount = 0, the default value of the metric programmable /// would be used for all parameters. /// - The implementation can post-fix a C string to the metric name and -/// description, based on the parmeter values chosen. +/// description, based on the parameter values chosen. /// - ::zetMetricProgrammableGetParamInfoExp() returns a list of parameters /// in a defined order. /// - Therefore, the list of values passed in to the API should respect the @@ -2451,6 +3104,48 @@ zetMetricProgrammableGetParamValueInfoExp( /// + `nullptr == pDescription` /// + `nullptr == pMetricHandleCount` ZE_APIEXPORT ze_result_t ZE_APICALL +zetMetricCreateFromProgrammableExp2( + zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable + uint32_t parameterCount, ///< [in] Count of parameters to set. + zet_metric_programmable_param_value_exp_t* pParameterValues, ///< [in] list of parameter values to be set. + const char* pName, ///< [in] pointer to metric name to be used. Must point to a + ///< null-terminated character array no longer than ::ZET_MAX_METRIC_NAME. + const char* pDescription, ///< [in] pointer to metric description to be used. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_DESCRIPTION. + uint32_t* pMetricHandleCount, ///< [in,out] Pointer to the number of metric handles. + ///< if count is zero, then the driver shall update the value with the + ///< number of metric handles available for this programmable. + ///< if count is greater than the number of metric handles available, then + ///< the driver shall update the value with the correct number of metric + ///< handles available. + zet_metric_handle_t* phMetricHandles ///< [in,out][optional][range(0,*pMetricHandleCount)] array of handle of metrics. + ///< if count is less than the number of metrics available, then driver + ///< shall only retrieve that number of metric handles. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create metric handles by applying parameter values on the metric +/// programmable handle. +/// +/// @details +/// - This API is deprecated. Please use +/// ::zetMetricCreateFromProgrammableExp2() +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hMetricProgrammable` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pParameterValues` +/// + `nullptr == pName` +/// + `nullptr == pDescription` +/// + `nullptr == pMetricHandleCount` +ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricCreateFromProgrammableExp( zet_metric_programmable_exp_handle_t hMetricProgrammable, ///< [in] handle of the metric programmable zet_metric_programmable_param_value_exp_t* pParameterValues, ///< [in] list of parameter values to be set. @@ -2471,12 +3166,59 @@ zetMetricCreateFromProgrammableExp( ///< shall only retrieve that number of metric handles. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Create multiple metric group handles from metric handles. +/// +/// @details +/// - Creates multiple metric groups from metrics which were created using +/// ::zetMetricCreateFromProgrammableExp2(). +/// - Metrics whose Hardware resources do not overlap are added to same +/// metric group. +/// - The metric groups created using this API are managed by the +/// application and cannot be retrieved using ::zetMetricGroupGet(). +/// - The created metric groups are ready for activation and collection. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// + `nullptr == phMetrics` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + metricGroupCount is lesser than the number of metric group handles that could be created. +ZE_APIEXPORT ze_result_t ZE_APICALL +zetDeviceCreateMetricGroupsFromMetricsExp( + zet_device_handle_t hDevice, ///< [in] handle of the device. + uint32_t metricCount, ///< [in] number of metric handles. + zet_metric_handle_t * phMetrics, ///< [in] metric handles to be added to the metric groups. + const char * pMetricGroupNamePrefix, ///< [in] prefix to the name created for the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_NAME_PREFIX_EXP. + const char * pDescription, ///< [in] pointer to description of the metric groups. Must point to a + ///< null-terminated character array no longer than + ///< ::ZET_MAX_METRIC_GROUP_DESCRIPTION. + uint32_t * pMetricGroupCount, ///< [in,out] pointer to the number of metric group handles to be created. + ///< if pMetricGroupCount is zero, then the driver shall update the value + ///< with the maximum possible number of metric group handles that could be created. + ///< if pMetricGroupCount is greater than the number of metric group + ///< handles that could be created, then the driver shall update the value + ///< with the correct number of metric group handles generated. + ///< if pMetricGroupCount is lesser than the number of metric group handles + ///< that could be created, then ::ZE_RESULT_ERROR_INVALID_ARGUMENT is returned. + zet_metric_group_handle_t* phMetricGroup ///< [in,out][optional][range(0, *pMetricGroupCount)] array of handle of + ///< metric group handles. + ///< Created Metric group handles. + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Create metric group handle. /// /// @details -/// - Metrics from ::zetMetricCreateFromProgrammableExp() could be added to -/// the created metric group. +/// - This API is deprecated. Please use +/// ::zetDeviceCreateMetricGroupsFromMetricsExp /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2491,7 +3233,7 @@ zetMetricCreateFromProgrammableExp( /// + `nullptr == pDescription` /// + `nullptr == phMetricGroup` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x3 < samplingType` +/// + `0x7 < samplingType` ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGroupCreateExp( zet_device_handle_t hDevice, ///< [in] handle of the device @@ -2506,7 +3248,7 @@ zetMetricGroupCreateExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Add a metric handle to the metric group handle created using -/// ::zetMetricGroupCreateExp. +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details /// - Reasons for failing to add the metric could be queried using @@ -2547,7 +3289,7 @@ zetMetricGroupAddMetricExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Remove a metric from the metric group handle created using -/// ::zetMetricGroupCreateExp. +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details /// - Remove an already added metric handle from the metric group. @@ -2573,8 +3315,9 @@ zetMetricGroupRemoveMetricExp( ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Closes a created metric group using ::zetMetricGroupCreateExp, so that -/// it can be activated. +/// @brief Closes a created metric group using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp, so that it can be +/// activated. /// /// @details /// - Finalizes the ::zetMetricGroupAddMetricExp and @@ -2608,14 +3351,17 @@ zetMetricGroupCloseExp( ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric group created using ::zetMetricGroupCreateExp. +/// @brief Destroy a metric group created using +/// ::zetDeviceCreateMetricGroupsFromMetricsExp. /// /// @details -/// - Metric handles created using ::zetMetricCreateFromProgrammableExp and +/// - Metric handles created using ::zetMetricCreateFromProgrammableExp2 and /// are part of the metricGroup are not destroyed. /// - It is necessary to call ::zetMetricDestroyExp for each of the metric -/// handles (created from ::zetMetricCreateFromProgrammableExp) to destroy -/// them. +/// handles (created from ::zetMetricCreateFromProgrammableExp2) to +/// destroy them. +/// - It is not necessary to remove the metrics in the metricGroup before +/// destroying it. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -2635,7 +3381,7 @@ zetMetricGroupDestroyExp( ); /////////////////////////////////////////////////////////////////////////////// -/// @brief Destroy a metric created using ::zetMetricCreateFromProgrammableExp. +/// @brief Destroy a metric created using ::zetMetricCreateFromProgrammableExp2. /// /// @details /// - If a metric is added to a metric group, the metric has to be removed diff --git a/backends/ze/include/zet_ddi.h b/backends/ze/include/zet_ddi.h index 876df64aa..bf7f56c02 100644 --- a/backends/ze/include/zet_ddi.h +++ b/backends/ze/include/zet_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zet_ddi.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.1 * */ #ifndef _ZET_DDI_H @@ -83,6 +83,146 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetMetricProgrammableExpProcAddrTable_t) zet_metric_programmable_exp_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricTracerCreateExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricTracerCreateExp_t)( + zet_context_handle_t, + zet_device_handle_t, + uint32_t, + zet_metric_group_handle_t*, + zet_metric_tracer_exp_desc_t*, + ze_event_handle_t, + zet_metric_tracer_exp_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricTracerDestroyExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricTracerDestroyExp_t)( + zet_metric_tracer_exp_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricTracerEnableExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricTracerEnableExp_t)( + zet_metric_tracer_exp_handle_t, + ze_bool_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricTracerDisableExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricTracerDisableExp_t)( + zet_metric_tracer_exp_handle_t, + ze_bool_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricTracerReadDataExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricTracerReadDataExp_t)( + zet_metric_tracer_exp_handle_t, + size_t*, + uint8_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricTracerDecodeExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricTracerDecodeExp_t)( + zet_metric_decoder_exp_handle_t, + size_t*, + uint8_t*, + uint32_t, + zet_metric_handle_t*, + uint32_t*, + uint32_t*, + uint32_t*, + zet_metric_entry_exp_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of MetricTracerExp functions pointers +typedef struct _zet_metric_tracer_exp_dditable_t +{ + zet_pfnMetricTracerCreateExp_t pfnCreateExp; + zet_pfnMetricTracerDestroyExp_t pfnDestroyExp; + zet_pfnMetricTracerEnableExp_t pfnEnableExp; + zet_pfnMetricTracerDisableExp_t pfnDisableExp; + zet_pfnMetricTracerReadDataExp_t pfnReadDataExp; + zet_pfnMetricTracerDecodeExp_t pfnDecodeExp; +} zet_metric_tracer_exp_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's MetricTracerExp table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zetGetMetricTracerExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_metric_tracer_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetGetMetricTracerExpProcAddrTable +typedef ze_result_t (ZE_APICALL *zet_pfnGetMetricTracerExpProcAddrTable_t)( + ze_api_version_t, + zet_metric_tracer_exp_dditable_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricDecoderCreateExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricDecoderCreateExp_t)( + zet_metric_tracer_exp_handle_t, + zet_metric_decoder_exp_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricDecoderDestroyExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricDecoderDestroyExp_t)( + zet_metric_decoder_exp_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricDecoderGetDecodableMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnMetricDecoderGetDecodableMetricsExp_t)( + zet_metric_decoder_exp_handle_t, + uint32_t*, + zet_metric_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of MetricDecoderExp functions pointers +typedef struct _zet_metric_decoder_exp_dditable_t +{ + zet_pfnMetricDecoderCreateExp_t pfnCreateExp; + zet_pfnMetricDecoderDestroyExp_t pfnDestroyExp; + zet_pfnMetricDecoderGetDecodableMetricsExp_t pfnGetDecodableMetricsExp; +} zet_metric_decoder_exp_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's MetricDecoderExp table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zetGetMetricDecoderExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_metric_decoder_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetGetMetricDecoderExpProcAddrTable +typedef ze_result_t (ZE_APICALL *zet_pfnGetMetricDecoderExpProcAddrTable_t)( + ze_api_version_t, + zet_metric_decoder_exp_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zetDeviceGetDebugProperties typedef ze_result_t (ZE_APICALL *zet_pfnDeviceGetDebugProperties_t)( @@ -119,6 +259,72 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetDeviceProcAddrTable_t)( zet_device_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceGetConcurrentMetricGroupsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceGetConcurrentMetricGroupsExp_t)( + zet_device_handle_t, + uint32_t, + zet_metric_group_handle_t *, + uint32_t *, + uint32_t * + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceCreateMetricGroupsFromMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t)( + zet_device_handle_t, + uint32_t, + zet_metric_handle_t *, + const char *, + const char *, + uint32_t *, + zet_metric_group_handle_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceEnableMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceEnableMetricsExp_t)( + zet_device_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetDeviceDisableMetricsExp +typedef ze_result_t (ZE_APICALL *zet_pfnDeviceDisableMetricsExp_t)( + zet_device_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of DeviceExp functions pointers +typedef struct _zet_device_exp_dditable_t +{ + zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp; + zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp; + zet_pfnDeviceEnableMetricsExp_t pfnEnableMetricsExp; + zet_pfnDeviceDisableMetricsExp_t pfnDisableMetricsExp; +} zet_device_exp_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's DeviceExp table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zetGetDeviceExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_device_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetGetDeviceExpProcAddrTable +typedef ze_result_t (ZE_APICALL *zet_pfnGetDeviceExpProcAddrTable_t)( + ze_api_version_t, + zet_device_exp_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zetContextActivateMetricGroups typedef ze_result_t (ZE_APICALL *zet_pfnContextActivateMetricGroups_t)( @@ -220,6 +426,43 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListProcAddrTable_t)( zet_command_list_dditable_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetCommandListAppendMarkerExp +typedef ze_result_t (ZE_APICALL *zet_pfnCommandListAppendMarkerExp_t)( + zet_command_list_handle_t, + zet_metric_group_handle_t, + uint32_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Table of CommandListExp functions pointers +typedef struct _zet_command_list_exp_dditable_t +{ + zet_pfnCommandListAppendMarkerExp_t pfnAppendMarkerExp; +} zet_command_list_exp_dditable_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's CommandListExp table +/// with current process' addresses +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION +ZE_DLLEXPORT ze_result_t ZE_APICALL +zetGetCommandListExpProcAddrTable( + ze_api_version_t version, ///< [in] API version requested + zet_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetGetCommandListExpProcAddrTable +typedef ze_result_t (ZE_APICALL *zet_pfnGetCommandListExpProcAddrTable_t)( + ze_api_version_t, + zet_command_list_exp_dditable_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for zetModuleGetDebugInfo typedef ze_result_t (ZE_APICALL *zet_pfnModuleGetDebugInfo_t)( @@ -357,12 +600,25 @@ typedef ze_result_t (ZE_APICALL *zet_pfnMetricDestroyExp_t)( zet_metric_handle_t ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zetMetricCreateFromProgrammableExp2 +typedef ze_result_t (ZE_APICALL *zet_pfnMetricCreateFromProgrammableExp2_t)( + zet_metric_programmable_exp_handle_t, + uint32_t, + zet_metric_programmable_param_value_exp_t*, + const char*, + const char*, + uint32_t*, + zet_metric_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of MetricExp functions pointers typedef struct _zet_metric_exp_dditable_t { zet_pfnMetricCreateFromProgrammableExp_t pfnCreateFromProgrammableExp; zet_pfnMetricDestroyExp_t pfnDestroyExp; + zet_pfnMetricCreateFromProgrammableExp2_t pfnCreateFromProgrammableExp2; } zet_metric_exp_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -943,9 +1199,13 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetDebugProcAddrTable_t)( typedef struct _zet_dditable_t { zet_metric_programmable_exp_dditable_t MetricProgrammableExp; + zet_metric_tracer_exp_dditable_t MetricTracerExp; + zet_metric_decoder_exp_dditable_t MetricDecoderExp; zet_device_dditable_t Device; + zet_device_exp_dditable_t DeviceExp; zet_context_dditable_t Context; zet_command_list_dditable_t CommandList; + zet_command_list_exp_dditable_t CommandListExp; zet_module_dditable_t Module; zet_kernel_dditable_t Kernel; zet_metric_dditable_t Metric; @@ -958,6 +1218,31 @@ typedef struct _zet_dditable_t zet_tracer_exp_dditable_t TracerExp; zet_debug_dditable_t Debug; } zet_dditable_t; +/// @brief Container for all DDI tables with version and tables set by the Driver +typedef struct _zet_dditable_driver_t +{ + ze_api_version_t version; + uint8_t isValidFlag; + zet_metric_programmable_exp_dditable_t * MetricProgrammableExp; + zet_metric_tracer_exp_dditable_t * MetricTracerExp; + zet_metric_decoder_exp_dditable_t * MetricDecoderExp; + zet_device_dditable_t * Device; + zet_device_exp_dditable_t * DeviceExp; + zet_context_dditable_t * Context; + zet_command_list_dditable_t * CommandList; + zet_command_list_exp_dditable_t * CommandListExp; + zet_module_dditable_t * Module; + zet_kernel_dditable_t * Kernel; + zet_metric_dditable_t * Metric; + zet_metric_exp_dditable_t * MetricExp; + zet_metric_group_dditable_t * MetricGroup; + zet_metric_group_exp_dditable_t * MetricGroupExp; + zet_metric_streamer_dditable_t * MetricStreamer; + zet_metric_query_pool_dditable_t * MetricQueryPool; + zet_metric_query_dditable_t * MetricQuery; + zet_tracer_exp_dditable_t * TracerExp; + zet_debug_dditable_t * Debug; +} zet_dditable_driver_t; #if defined(__cplusplus) } // extern "C" diff --git a/backends/ze/include/zet_ddi_ver.h b/backends/ze/include/zet_ddi_ver.h index a2c0ffac9..eb294d1bd 100644 --- a/backends/ze/include/zet_ddi_ver.h +++ b/backends/ze/include/zet_ddi_ver.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zet_ddi.h - * @version v1.9-r1.9.3 + * @version v1.13-r1.13.73 * */ #ifndef _ZET_DDI_VER_H @@ -30,6 +30,29 @@ typedef struct _zet_metric_programmable_exp_dditable_t_1_9 zet_pfnMetricProgrammableGetParamValueInfoExp_t pfnGetParamValueInfoExp; } zet_metric_programmable_exp_dditable_t_1_9; +/////////////////////////////////////////////////////////////////////////////// +/// [1.1] +/// @brief Table of MetricTracerExp functions pointers +typedef struct _zet_metric_tracer_exp_dditable_t_1_1 +{ + zet_pfnMetricTracerCreateExp_t pfnCreateExp; + zet_pfnMetricTracerDestroyExp_t pfnDestroyExp; + zet_pfnMetricTracerEnableExp_t pfnEnableExp; + zet_pfnMetricTracerDisableExp_t pfnDisableExp; + zet_pfnMetricTracerReadDataExp_t pfnReadDataExp; + zet_pfnMetricTracerDecodeExp_t pfnDecodeExp; +} zet_metric_tracer_exp_dditable_t_1_1; + +/////////////////////////////////////////////////////////////////////////////// +/// [1.1] +/// @brief Table of MetricDecoderExp functions pointers +typedef struct _zet_metric_decoder_exp_dditable_t_1_1 +{ + zet_pfnMetricDecoderCreateExp_t pfnCreateExp; + zet_pfnMetricDecoderDestroyExp_t pfnDestroyExp; + zet_pfnMetricDecoderGetDecodableMetricsExp_t pfnGetDecodableMetricsExp; +} zet_metric_decoder_exp_dditable_t_1_1; + /////////////////////////////////////////////////////////////////////////////// /// [1.0] /// @brief Table of Device functions pointers @@ -38,6 +61,23 @@ typedef struct _zet_device_dditable_t_1_0 zet_pfnDeviceGetDebugProperties_t pfnGetDebugProperties; } zet_device_dditable_t_1_0; +/////////////////////////////////////////////////////////////////////////////// +/// [1.1, 1.13] +/// @brief Table of DeviceExp functions pointers +typedef struct _zet_device_exp_dditable_t_1_1 +{ + zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp; + zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp; +} zet_device_exp_dditable_t_1_1; + +typedef struct _zet_device_exp_dditable_t_1_13 +{ + zet_pfnDeviceGetConcurrentMetricGroupsExp_t pfnGetConcurrentMetricGroupsExp; + zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t pfnCreateMetricGroupsFromMetricsExp; + zet_pfnDeviceEnableMetricsExp_t pfnEnableMetricsExp; + zet_pfnDeviceDisableMetricsExp_t pfnDisableMetricsExp; +} zet_device_exp_dditable_t_1_13; + /////////////////////////////////////////////////////////////////////////////// /// [1.0] /// @brief Table of Context functions pointers @@ -57,6 +97,14 @@ typedef struct _zet_command_list_dditable_t_1_0 zet_pfnCommandListAppendMetricMemoryBarrier_t pfnAppendMetricMemoryBarrier; } zet_command_list_dditable_t_1_0; +/////////////////////////////////////////////////////////////////////////////// +/// [1.13] +/// @brief Table of CommandListExp functions pointers +typedef struct _zet_command_list_exp_dditable_t_1_13 +{ + zet_pfnCommandListAppendMarkerExp_t pfnAppendMarkerExp; +} zet_command_list_exp_dditable_t_1_13; + /////////////////////////////////////////////////////////////////////////////// /// [1.0] /// @brief Table of Module functions pointers @@ -83,12 +131,18 @@ typedef struct _zet_metric_dditable_t_1_0 } zet_metric_dditable_t_1_0; /////////////////////////////////////////////////////////////////////////////// -/// [1.9] +/// [1.11, 1.9] /// @brief Table of MetricExp functions pointers +typedef struct _zet_metric_exp_dditable_t_1_11 +{ + zet_pfnMetricCreateFromProgrammableExp2_t pfnCreateFromProgrammableExp2; +} zet_metric_exp_dditable_t_1_11; + typedef struct _zet_metric_exp_dditable_t_1_9 { zet_pfnMetricCreateFromProgrammableExp_t pfnCreateFromProgrammableExp; zet_pfnMetricDestroyExp_t pfnDestroyExp; + zet_pfnMetricCreateFromProgrammableExp2_t pfnCreateFromProgrammableExp2; } zet_metric_exp_dditable_t_1_9; /////////////////////////////////////////////////////////////////////////////// diff --git a/backends/ze/utils_spec_update/check_metadata.py b/backends/ze/utils_spec_update/check_metadata.py new file mode 100644 index 000000000..297ed4c47 --- /dev/null +++ b/backends/ze/utils_spec_update/check_metadata.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +""" +Verify that all functions in ze_api.yaml with pointer parameters +have corresponding entries in ze_meta_parameters.yaml. +""" + +import sys +import yaml + + +def load_yaml(path): + with open(path) as f: + return yaml.safe_load(f) + + +IGNORED_PARAMS = {"ptr", "pDdiTable"} + + +def get_pointer_params(func): + return [ + param["name"] + for param in func.get("params", []) + if param.get("type", {}).get("kind") == "pointer" + and param["name"] not in IGNORED_PARAMS + ] + + +def main(): + api_path, meta_path = sys.argv[1], sys.argv[2] + + api = load_yaml(api_path) + meta = load_yaml(meta_path) + + meta_keys = set(meta.get("meta_parameters", {}).keys()) + + # Build {func_name: [pointer_param_names]} for functions that have pointer params + needs_meta = { + func["name"]: get_pointer_params(func) + for func in api.get("functions", []) + if get_pointer_params(func) + } + + missing = {name: params for name, params in needs_meta.items() if name not in meta_keys} + + if missing: + print(f"❌ {len(missing)} function(s) with pointer params are missing metadata:\n") + for func_name, params in missing.items(): + print(f" {func_name}:") + for p in params: + print(f" - {p}") + sys.exit(1) + else: + print(f"✅ All {len(needs_meta)} function(s) with pointer params have metadata.") + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/backends/ze/utils_spec_update/query_ze_version.cpp b/backends/ze/utils_spec_update/query_ze_version.cpp new file mode 100644 index 000000000..ee302e6b4 --- /dev/null +++ b/backends/ze/utils_spec_update/query_ze_version.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include + +int main() { + // Initialize Level Zero + zeInit(ZE_INIT_FLAG_GPU_ONLY); + + // Get the driver + uint32_t driverCount = 1; + ze_driver_handle_t driver; + zeDriverGet(&driverCount, &driver); + + // Query driver properties + ze_driver_properties_t driverProps{.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES}; + zeDriverGetProperties(driver, &driverProps); + + std::cout << "Driver version: " << ZE_MAJOR_VERSION(driverProps.driverVersion) << "." + << ZE_MINOR_VERSION(driverProps.driverVersion) << std::endl; + + // Compare with header version + std::cout << "API version: " << ZE_MAJOR_VERSION(ZE_API_VERSION_CURRENT) << "." + << ZE_MINOR_VERSION(ZE_API_VERSION_CURRENT) << std::endl; + + // Query loader component versions + size_t numElems = 0; + zelLoaderGetVersions(&numElems, nullptr); + std::vector versions(numElems); + zelLoaderGetVersions(&numElems, versions.data()); + + std::cout << "Loader component versions:" << std::endl; + for (size_t i = 0; i < numElems; ++i) { + std::cout << " [" << i << "] Name: " << versions[i].component_name << std::endl + << " Spec: " << ZE_MAJOR_VERSION(versions[i].spec_version) << "." + << ZE_MINOR_VERSION(versions[i].spec_version) << std::endl + << " Lib version: " << versions[i].component_lib_version.major << "." + << versions[i].component_lib_version.minor << "." + << versions[i].component_lib_version.patch << std::endl; + } + + return 0; +} diff --git a/backends/ze/utils_spec_update/test_symbol_exported.sh b/backends/ze/utils_spec_update/test_symbol_exported.sh new file mode 100644 index 000000000..f6a9920f3 --- /dev/null +++ b/backends/ze/utils_spec_update/test_symbol_exported.sh @@ -0,0 +1,5 @@ +get_funcs() { + readelf -W --dyn-syms "$1" | awk '/GLOBAL/ && /DEFAULT/ && /FUNC/ && $8 ~ /^ze/ {print $8}' | LC_COLLATE=C sort +} + +diff -u --label "$1" --label "$2" <(get_funcs $1) <(get_funcs $2) diff --git a/backends/ze/ze.h.include b/backends/ze/ze.h.include index cf36afc7a..208a429c2 100644 --- a/backends/ze/ze.h.include +++ b/backends/ze/ze.h.include @@ -7,11 +7,13 @@ #include #include #include +#ifdef NEW_VERSION_WITH_ZER +#include +#include +#endif #include #include #include #include #include -#define HMODULE void * -#include #endif diff --git a/backends/ze/ze_meta_parameters.yaml b/backends/ze/ze_meta_parameters.yaml index 354dc6920..80553794c 100644 --- a/backends/ze/ze_meta_parameters.yaml +++ b/backends/ze/ze_meta_parameters.yaml @@ -336,3 +336,31 @@ meta_parameters: - [ InScalar, desc ] zeCommandListUpdateMutableCommandWaitEventsExp: - [ InArray, phWaitEvents, numWaitEvents ] + zeInitDrivers: + - [ InScalar, desc ] + - [ InOutScalar, pCount ] + - [ OutArray, phDrivers, pCount ] + zeKernelGetBinaryExp: + - [ InOutScalar, pSize ] + - [ OutArray, pKernelBinary, pSize ] + zeDeviceImportExternalSemaphoreExt: + - [ InScalar, desc ] + - [ OutScalar, phSemaphore ] + zeCommandListAppendSignalExternalSemaphoreExt: + - [ InArray, phSemaphores, numSemaphores ] + - [ InArray, signalParams, numSemaphores ] + - [ InArray, phWaitEvents, numWaitEvents ] + zeCommandListAppendWaitExternalSemaphoreExt: + - [ InArray, phSemaphores, numSemaphores ] + - [ InArray, waitParams, numSemaphores ] + - [ InArray, phWaitEvents, numWaitEvents ] + zeDeviceGetVectorWidthPropertiesExt: + - [ InOutScalar, pCount ] + - [ OutArray, pVectorWidthProperties, pCount ] + zeCommandListGetNextCommandIdWithKernelsExp: + - [ InOutScalar, desc ] # Yep, it's special https://oneapi-src.github.io/level-zero-spec/level-zero/1.11/core/api.html#zecommandlistgetnextcommandidwithkernelsexp + - [ InArray, phKernels, numKernels ] + - [ OutScalar, pCommandId ] + zeCommandListUpdateMutableCommandKernelsExp: + - [ InArray, pCommandId, numKernels ] + - [ InArray, phKernels, numKernels ] diff --git a/backends/ze/ze_model.rb b/backends/ze/ze_model.rb index 8fd4e5b12..28dd55208 100644 --- a/backends/ze/ze_model.rb +++ b/backends/ze/ze_model.rb @@ -14,22 +14,26 @@ $zet_api_yaml = YAML.load_file('zet_api.yaml') $zes_api_yaml = YAML.load_file('zes_api.yaml') $zel_api_yaml = YAML.load_file('zel_api.yaml') +# $zer_api_yaml = YAML.load_file('zer_api.yaml') +$zer_api_yaml = { 'typedefs' => [], 'structs' => [], 'functions' => [] } $zex_api_yaml = YAML.load_file('zex_api.yaml') $ze_api = YAMLCAst.from_yaml_ast($ze_api_yaml) $zet_api = YAMLCAst.from_yaml_ast($zet_api_yaml) $zes_api = YAMLCAst.from_yaml_ast($zes_api_yaml) $zel_api = YAMLCAst.from_yaml_ast($zel_api_yaml) +$zer_api = YAMLCAst.from_yaml_ast($zer_api_yaml) $zex_api = YAMLCAst.from_yaml_ast($zex_api_yaml) ze_funcs_e = $ze_api['functions'] zet_funcs_e = $zet_api['functions'] zes_funcs_e = $zes_api['functions'] zel_funcs_e = $zel_api['functions'] +zer_funcs_e = $zer_api['functions'] zex_funcs_e = $zex_api['functions'] -typedefs = $ze_api['typedefs'] + $zet_api['typedefs'] + $zes_api['typedefs'] + $zel_api['typedefs'] + $zex_api['typedefs'] -structs = $ze_api['structs'] + $zet_api['structs'] + $zes_api['structs'] + $zel_api['structs'] + $zex_api['structs'] +typedefs = $ze_api['typedefs'] + $zet_api['typedefs'] + $zes_api['typedefs'] + $zel_api['typedefs'] + $zer_api['typedefs'] + $zex_api['typedefs'] +structs = $ze_api['structs'] + $zet_api['structs'] + $zes_api['structs'] + $zel_api['structs'] + $zer_api['structs'] + $zex_api['structs'] find_all_types(typedefs) gen_struct_map(typedefs, structs) @@ -47,10 +51,14 @@ 'ZE_STRUCTURE_TYPE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT' => 'ZE_STRUCTURE_TYPE_KERNEL_MAX_GROUP_SIZE_EXT_PROPERTIES', 'ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_WIN32_HANDLE' => 'ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_WIN32', 'ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_WIN32_HANDLE' => 'ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_WIN32', + 'ZE_STRUCTURE_TYPE_COMMAND_LIST_APPEND_LAUNCH_KERNEL_PARAM_COOPERATIVE_DESC' => 'ZE_STRUCTURE_TYPE_COMMAND_LIST_APPEND_PARAM_COOPERATIVE_DESC', + 'ZE_STRUCTURE_TYPE_DEVICE_CACHE_LINE_SIZE_EXT' => 'ZE_STRUCTURE_TYPE_DEVICE_CACHELINE_SIZE_EXT', + 'ZE_STRUCTURE_TYPE_KERNEL_ALLOCATION_EXP_PROPERTIES' => 'ZE_STRUCTURE_TYPE_KERNEL_ALLOCATION_PROPERTIES', + 'ZET_STRUCTURE_TYPE_EXPORT_DMA_BUF_EXP_PROPERTIES' => 'ZET_STRUCTURE_TYPE_EXPORT_DMA_EXP_PROPERTIES', 'ZES_STRUCTURE_TYPE_MEM_PAGE_OFFLINE_STATE_EXP' => 'ZES_STRUCTURE_TYPE_MEMORY_PAGE_OFFLINE_STATE_EXP', } -$struct_type_reject = Set.new([]) +$struct_type_reject = Set.new(['zet_metric_source_id_exp_t']) $ze_meta_parameters = YAML.load_file(File.join(SRC_DIR, 'ze_meta_parameters.yaml')) $ze_meta_parameters['meta_parameters'].each do |func, list| @@ -79,6 +87,13 @@ end end +# $zer_meta_parameters = YAML.load_file(File.join(SRC_DIR, 'zer_meta_parameters.yaml')) +# $zer_meta_parameters['meta_parameters'].each do |func, list| +# list.each do |type, *args| +# register_meta_parameter func, Kernel.const_get(type), *args +# end +# end + $zex_meta_parameters = YAML.load_file(File.join(SRC_DIR, 'zex_meta_parameters.yaml')) $zex_meta_parameters['meta_parameters'].each do |func, list| list.each do |type, *args| @@ -102,6 +117,10 @@ Command.new(func) end +$zer_commands = zer_funcs_e.collect do |func| + Command.new(func) +end + $zex_commands = zex_funcs_e.collect do |func| Command.new(func) end @@ -110,7 +129,7 @@ def upper_snake_case(str) str.gsub(/([A-Z][A-Z0-9]*)/, '_\1').upcase end -ze_pointer_names = ($ze_commands + $zet_commands + $zes_commands + $zel_commands).collect do |c| +ze_pointer_names = ($ze_commands + $zet_commands + $zes_commands + $zel_commands + $zer_commands).collect do |c| [c, upper_snake_case(c.pointer_name)] end ze_pointer_names += $zex_commands.collect do |c| @@ -375,8 +394,8 @@ def upper_snake_case(str) } EOF -($ze_commands + $zet_commands + $zes_commands + $zel_commands).select do |c| - c.name.match(/(ze|zet|zes|zel)Get.*ProcAddrTable/) +($ze_commands + $zet_commands + $zes_commands + $zel_commands + $zer_commands).select do |c| + c.name.match(/(ze|zet|zes|zel|zer)Get.*ProcAddrTable/) end.each do |c| parent_type = c['pDdiTable'].type.type.to_s + '_' child_types = STRUCT_MAP.select { |k, _| k.match(parent_type) } diff --git a/backends/ze/zer_meta_parameters.yaml b/backends/ze/zer_meta_parameters.yaml new file mode 100644 index 000000000..0f7807372 --- /dev/null +++ b/backends/ze/zer_meta_parameters.yaml @@ -0,0 +1,4 @@ +--- +meta_parameters: + zerGetLastErrorDescription: + - [ OutPtrString, ppString] diff --git a/utils/get_missing_metadata.py b/utils/get_missing_metadata.py new file mode 100644 index 000000000..3f3ceebbe --- /dev/null +++ b/utils/get_missing_metadata.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +import sys +import yaml + +def main(): + if len(sys.argv) != 3: + print(f"Usage: {sys.argv[0]} ") + sys.exit(1) + + with open(sys.argv[1]) as f: + meta = yaml.safe_load(f)["meta_parameters"] + + with open(sys.argv[2]) as f: + model = yaml.safe_load(f)["functions"] + + for fn in model: + name = fn["name"] + + # Only pointer-typed params matter + ptr_params = [ + p["name"] for p in fn.get("params", []) + if p["type"]["kind"] == "pointer" + ] + + if not ptr_params: + continue + + # Param names covered by metadata (index 1 of each [Tag, paramName, ...] entry) + covered = {entry[1] for entry in meta.get(name, [])} + + missing = [p for p in ptr_params if p not in covered] + + if missing: + print(f"{name}:") + for p in missing: + print(f" - {p}") + +if __name__ == "__main__": + main() diff --git a/xprof/xprof.rb.in b/xprof/xprof.rb.in index 9d07a2c2d..9de81bad9 100755 --- a/xprof/xprof.rb.in +++ b/xprof/xprof.rb.in @@ -423,6 +423,7 @@ class SyncDaemon < SpawnDaemon end def initialize + super daemon_type = env_fetch_first('THAPI_SYNC_DAEMON') daemon = case daemon_type when nil @@ -499,6 +500,7 @@ class SamplingDaemon < SpawnDaemon end def initialize(h = {}) + super() daemon_path = "#{BINDIR}/thapi_sampling_daemon" raise "No sampling_daemon binary found at #{daemon_path}" unless File.exist?(daemon_path) @@ -563,6 +565,7 @@ def enable_events_ze(channel_name, tracing_mode: 'default', profiling: true) exec("#{lttng_enable} lttng_ust_ze_properties:*") exec("#{lttng_enable} lttng_ust_ze:*") exec("#{lttng_enable} lttng_ust_zes:*") + exec("#{lttng_enable} lttng_ust_zer:*") exec("#{lttng_enable} lttng_ust_zet:*") exec("#{lttng_enable} lttng_ust_zex:*") when 'default' @@ -626,6 +629,7 @@ end def enable_events_hip(channel_name, tracing_mode: 'default', profiling: true) lttng_enable = "lttng enable-event --userspace --session=#{lttng_session_uuid} --channel=#{channel_name}" exec("#{lttng_enable} lttng_ust_hip:*") + LOGGER.debug('Profiling is ignored for hip') if profiling LOGGER.debug("Tracing mode #{tracing_mode} similar to default for hip") unless tracing_mode == 'default' end @@ -640,6 +644,7 @@ def enable_events_omp(channel_name, tracing_mode: 'default', profiling: true) else raise("Tracing mode #{tracing_mode} not supported") end + LOGGER.debug('Profiling is ignored for omp') if profiling end def enable_events_mpi(channel_name, tracing_mode: 'default', profiling: true) @@ -653,6 +658,7 @@ def enable_events_mpi(channel_name, tracing_mode: 'default', profiling: true) else raise("Tracing mode #{tracing_mode} not supported") end + LOGGER.debug('Profiling is ignored for mpi') if profiling exec("#{lttng_enable} lttng_ust_mpi_type:*") end @@ -662,11 +668,14 @@ def enable_events_itt(channel_name, tracing_mode: 'default', profiling: true) lttng_enable = "lttng enable-event --userspace --session=#{lttng_session_uuid} --channel=#{channel_name}" exec("#{lttng_enable} lttng_ust_itt:*") exec("#{lttng_enable} lttng_ust_itt_metadata:*") + LOGGER.debug('Profiling is ignored for itt') if profiling LOGGER.debug("Tracing mode #{tracing_mode} similar to default for itt") unless tracing_mode == 'default' end def enable_events_metadata(channel_name, tracing_mode: 'default', profiling: true) lttng_enable = "lttng enable-event --userspace --session=#{lttng_session_uuid} --channel=#{channel_name}" + LOGGER.debug('Profiling is ignored for metadata') if profiling + LOGGER.debug("#{tracing_mode} is ignored for metadata") exec("#{lttng_enable} lttng_ust_thapi:*") end @@ -731,7 +740,7 @@ module LocalMaster # /!\ If babeltrace moved the file the `lttng_trace_dir_tmp` no longer exist LOGGER.debug("Deleting #{lttng_trace_dir_tmp}") - FileUtils.remove_dir(lttng_trace_dir_tmp) if File.exist?(lttng_trace_dir_tmp) + FileUtils.rm_rf(lttng_trace_dir_tmp) end end