Skip to content

Commit 76a5b09

Browse files
committed
Add UR_DEVICE_INFO_ESIMD_SUPPORT_EXP
This will be used by DPC++ PI to determine if a device supports the DPC++ ESIMD extension. Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
1 parent cf43531 commit 76a5b09

File tree

8 files changed

+97
-4
lines changed

8 files changed

+97
-4
lines changed

include/ur.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ class ur_device_info_v(IntEnum):
859859
## semaphore resources
860860
INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP = 0x200F ## [::ur_bool_t] returns true if the device supports exporting internal
861861
## event resources
862+
ESIMD_SUPPORT_EXP = 0x2010 ## [::ur_bool_t] returns true if the device supports ESIMD
862863

863864
class ur_device_info_t(c_int):
864865
def __str__(self):

include/ur_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ typedef enum ur_device_info_t {
14861486
///< semaphore resources
14871487
UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP = 0x200F, ///< [::ur_bool_t] returns true if the device supports exporting internal
14881488
///< event resources
1489+
UR_DEVICE_INFO_ESIMD_SUPPORT_EXP = 0x2010, ///< [::ur_bool_t] returns true if the device supports ESIMD
14891490
/// @cond
14901491
UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff
14911492
/// @endcond
@@ -1511,7 +1512,7 @@ typedef enum ur_device_info_t {
15111512
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
15121513
/// + `NULL == hDevice`
15131514
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
1514-
/// + `::UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP < propName`
1515+
/// + `::UR_DEVICE_INFO_ESIMD_SUPPORT_EXP < propName`
15151516
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
15161517
/// + If `propName` is not supported by the adapter.
15171518
/// - ::UR_RESULT_ERROR_INVALID_SIZE

scripts/core/EXP-ESIMD.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<%
2+
OneApi=tags['$OneApi']
3+
x=tags['$x']
4+
X=x.upper()
5+
%>
6+
7+
.. _experimental-ESIMD:
8+
9+
================================================================================
10+
ESIMD
11+
================================================================================
12+
13+
.. warning::
14+
15+
Experimental features:
16+
17+
* May be replaced, updated, or removed at any time.
18+
* Do not require maintaining API/ABI stability of their own additions over
19+
time.
20+
* Do not require conformance testing of their own additions.
21+
22+
Motivation
23+
--------------------------------------------------------------------------------
24+
The `DPC++ ESIMD extension <https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/supported/sycl_ext_intel_esimd/sycl_ext_intel_esimd.md>`_
25+
provides the user the ability to write explicitly vectorized code. In order
26+
for DPC++ PI to query if a backend supports ESIMD, the Unified Runtime
27+
will need a new device info enumeration.
28+
29+
API
30+
--------------------------------------------------------------------------------
31+
32+
Enums
33+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34+
* ${x}_device_info_t
35+
* ${X}_DEVICE_INFO_ESIMD_SUPPORT_EXP
36+
37+
Changelog
38+
--------------------------------------------------------------------------------
39+
40+
+-----------+------------------------+
41+
| Revision | Changes |
42+
+===========+========================+
43+
| 1.0 | Initial Draft |
44+
+-----------+------------------------+
45+
46+
47+
Contributors
48+
--------------------------------------------------------------------------------
49+
50+
* Sarnie, Nick `nick.sarnie@intel.com <nick.sarnie@intel.com>`_

scripts/core/exp-esimd.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (C) 2023 Intel Corporation
3+
#
4+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See LICENSE.TXT
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
# See YaML.md for syntax definition
9+
#
10+
--- #--------------------------------------------------------------------------
11+
type: header
12+
desc: "Intel $OneApi Unified Runtime Experimental APIs for ESIMD"
13+
ordinal: "99"
14+
--- #--------------------------------------------------------------------------
15+
type: enum
16+
extend: true
17+
typed_etors: true
18+
desc: "Extension enums to $x_device_info_t to support ESIMD."
19+
name: $x_device_info_t
20+
etors:
21+
- name: ESIMD_SUPPORT_EXP
22+
value: "0x2010"
23+
desc: "[$x_bool_t] returns true if the device supports ESIMD"

source/common/ur_params.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,6 +2835,10 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
28352835
case UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP:
28362836
os << "UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP";
28372837
break;
2838+
2839+
case UR_DEVICE_INFO_ESIMD_SUPPORT_EXP:
2840+
os << "UR_DEVICE_INFO_ESIMD_SUPPORT_EXP";
2841+
break;
28382842
default:
28392843
os << "unknown enumerator";
28402844
break;
@@ -4633,6 +4637,20 @@ inline void serializeTagged(std::ostream &os, const void *ptr,
46334637

46344638
os << ")";
46354639
} break;
4640+
4641+
case UR_DEVICE_INFO_ESIMD_SUPPORT_EXP: {
4642+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4643+
if (sizeof(ur_bool_t) > size) {
4644+
os << "invalid size (is: " << size
4645+
<< ", expected: >=" << sizeof(ur_bool_t) << ")";
4646+
return;
4647+
}
4648+
os << (void *)(tptr) << " (";
4649+
4650+
os << *tptr;
4651+
4652+
os << ")";
4653+
} break;
46364654
default:
46374655
os << "unknown enumerator";
46384656
break;

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo(
512512
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
513513
}
514514

515-
if (UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP < propName) {
515+
if (UR_DEVICE_INFO_ESIMD_SUPPORT_EXP < propName) {
516516
return UR_RESULT_ERROR_INVALID_ENUMERATION;
517517
}
518518

source/loader/ur_libapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ ur_result_t UR_APICALL urDeviceGet(
768768
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
769769
/// + `NULL == hDevice`
770770
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
771-
/// + `::UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP < propName`
771+
/// + `::UR_DEVICE_INFO_ESIMD_SUPPORT_EXP < propName`
772772
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
773773
/// + If `propName` is not supported by the adapter.
774774
/// - ::UR_RESULT_ERROR_INVALID_SIZE

source/ur_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ ur_result_t UR_APICALL urDeviceGet(
657657
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
658658
/// + `NULL == hDevice`
659659
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
660-
/// + `::UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP < propName`
660+
/// + `::UR_DEVICE_INFO_ESIMD_SUPPORT_EXP < propName`
661661
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
662662
/// + If `propName` is not supported by the adapter.
663663
/// - ::UR_RESULT_ERROR_INVALID_SIZE

0 commit comments

Comments
 (0)