Skip to content

Commit

Permalink
Merge pull request #712 from Alcpz/alcpz/native_cpu_constants
Browse files Browse the repository at this point in the history
[UR] Added Native CPU constants
  • Loading branch information
veselypeta authored Jul 13, 2023
2 parents d808cab + 4e22bd7 commit 0189058
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/ur.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions scripts/core/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 4 additions & 0 deletions source/common/ur_params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2052,6 +2052,10 @@ 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;
Expand Down

0 comments on commit 0189058

Please sign in to comment.