Skip to content

Commit 3c2be30

Browse files
aelovikov-intelRossBrunton
authored andcommitted
Revert "[UR] Consolidate platform and adapter backend enums into one." (#17604)
Reverts intel/llvm#16173
1 parent 4c042ee commit 3c2be30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+400
-283
lines changed

examples/codegen/codegen.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ std::vector<ur_adapter_handle_t>
4949
get_supported_adapters(std::vector<ur_adapter_handle_t> &adapters) {
5050
std::vector<ur_adapter_handle_t> supported_adapters;
5151
for (auto adapter : adapters) {
52-
ur_backend_t backend;
52+
ur_adapter_backend_t backend;
5353
ur_check(urAdapterGetInfo(adapter, UR_ADAPTER_INFO_BACKEND,
54-
sizeof(ur_backend_t), &backend, nullptr));
54+
sizeof(ur_adapter_backend_t), &backend, nullptr));
5555

56-
if (backend == UR_BACKEND_LEVEL_ZERO) {
56+
if (backend == UR_ADAPTER_BACKEND_LEVEL_ZERO) {
5757
supported_adapters.push_back(adapter);
5858
}
5959
}

include/ur_api.h

Lines changed: 46 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

include/ur_print.h

Lines changed: 20 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

include/ur_print.hpp

Lines changed: 72 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/YaML.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,8 @@ namespace ur {
838838
* A manifest requires the following scalar fields: {`name`, `backend`}
839839
- `name` must be a string unique to the adapter.
840840
- `name` should be identical to how the name appears in the adapter's library name. E.g. `libur_adapter_my_adapter` should have the name string `my_adapter`.
841-
- `backend` must be an etor of `$x_backend_t`.
842-
- `backend` must not be `$X_BACKEND_UNKNOWN`.
841+
- `backend` must be an etor of `$x_adapter_backend_t`.
842+
- `backend` must not be `$X_ADAPTER_BACKEND_UNKNOWN`.
843843
* a manifest requires the following sequence of scalars: {`device_types`}
844844
- `device_types` must be an etor of `$x_device_type_t`
845845

scripts/core/adapter.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ name: $x_adapter_info_t
130130
typed_etors: True
131131
etors:
132132
- name: BACKEND
133-
desc: "[$x_backend_t] Identifies the native backend supported by the adapter."
133+
desc: "[$x_adapter_backend_t] Identifies the native backend supported by the adapter."
134134
- name: REFERENCE_COUNT
135135
desc: |
136136
[uint32_t] Reference count of the adapter.
@@ -182,3 +182,27 @@ returns:
182182
- "`pPropValue == NULL && pPropSizeRet == NULL`"
183183
- $X_RESULT_ERROR_OUT_OF_RESOURCES
184184
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
185+
--- #--------------------------------------------------------------------------
186+
type: enum
187+
desc: "Identifies backend of the adapter"
188+
class: $x
189+
name: $x_adapter_backend_t
190+
etors:
191+
- name: UNKNOWN
192+
value: "0"
193+
desc: "The backend is not a recognized one"
194+
- name: LEVEL_ZERO
195+
value: "1"
196+
desc: "The backend is Level Zero"
197+
- name: OPENCL
198+
value: "2"
199+
desc: "The backend is OpenCL"
200+
- name: CUDA
201+
value: "3"
202+
desc: "The backend is CUDA"
203+
- name: HIP
204+
value: "4"
205+
desc: "The backend is HIP"
206+
- name: NATIVE_CPU
207+
value: "5"
208+
desc: "The backend is Native CPU"

0 commit comments

Comments
 (0)