From 1000c260bd13e32c543371b0599395cfa2be3fa2 Mon Sep 17 00:00:00 2001 From: Alberto Cabrera Date: Thu, 13 Jul 2023 09:34:27 +0100 Subject: [PATCH 1/2] [UR] Added Native CPU adapter constants --- include/ur.py | 1 + include/ur_api.h | 1 + scripts/core/platform.yml | 3 +++ source/common/ur_params.hpp | 5 +++++ 4 files changed, 10 insertions(+) diff --git a/include/ur.py b/include/ur.py index 4fcfc40da6..286ae6228c 100644 --- a/include/ur.py +++ b/include/ur.py @@ -530,6 +530,7 @@ class ur_platform_backend_v(IntEnum): OPENCL = 2 ## The backend is OpenCL CUDA = 3 ## The backend is CUDA HIP = 4 ## The backend is HIP + NATIVE_CPU = 5 ## The backend is Native CPU class ur_platform_backend_t(c_int): def __str__(self): diff --git a/include/ur_api.h b/include/ur_api.h index 360cfe05d0..3e319c5b8e 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -858,6 +858,7 @@ typedef enum ur_platform_backend_t { UR_PLATFORM_BACKEND_OPENCL = 2, ///< The backend is OpenCL UR_PLATFORM_BACKEND_CUDA = 3, ///< The backend is CUDA UR_PLATFORM_BACKEND_HIP = 4, ///< The backend is HIP + UR_PLATFORM_BACKEND_NATIVE_CPU = 5, ///< The backend is Native CPU /// @cond UR_PLATFORM_BACKEND_FORCE_UINT32 = 0x7fffffff /// @endcond diff --git a/scripts/core/platform.yml b/scripts/core/platform.yml index 9dab95a68a..69e9ac3665 100644 --- a/scripts/core/platform.yml +++ b/scripts/core/platform.yml @@ -291,3 +291,6 @@ etors: - name: HIP value: "4" desc: "The backend is HIP" + - name: NATIVE_CPU + value: "5" + desc: "The backend is Native CPU" diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index e3e17281d4..a9d49ea35b 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -2052,6 +2052,11 @@ inline std::ostream &operator<<(std::ostream &os, case UR_PLATFORM_BACKEND_HIP: os << "UR_PLATFORM_BACKEND_HIP"; break; + + case UR_PLATFORM_BACKEND_NATIVE_CPU: + os << "UR_PLATFORM_BACKEND_NATIVE_CPU"; + break; + default: os << "unknown enumerator"; break; From 4e22bd765e1167dbba402de88284aedb40f3e63d Mon Sep 17 00:00:00 2001 From: Alberto Cabrera Date: Thu, 13 Jul 2023 12:44:13 +0100 Subject: [PATCH 2/2] [UR] Fixed extra newline introduced in generated code --- source/common/ur_params.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index a9d49ea35b..c1368c79de 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -2056,7 +2056,6 @@ inline std::ostream &operator<<(std::ostream &os, case UR_PLATFORM_BACKEND_NATIVE_CPU: os << "UR_PLATFORM_BACKEND_NATIVE_CPU"; break; - default: os << "unknown enumerator"; break;