Skip to content

Commit ccb757e

Browse files
author
Petr Vesely
committed
[WIP] make char*
1 parent 5c629a0 commit ccb757e

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

include/ur.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def __str__(self):
281281
## @brief Extension type.
282282
class ur_platform_extension_t(Structure):
283283
_fields_ = [
284-
("name", c_char * UR_MAX_EXTENSION_NAME_LENGTH), ## [in] null-terminated extension name.
284+
("name", c_char_p), ## [in] null-terminated extension name.
285285
("version", c_ulong) ## [in] version of the extension using ::UR_MAKE_VERSION.
286286
]
287287

include/ur_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ urTearDown(
368368
///////////////////////////////////////////////////////////////////////////////
369369
/// @brief Extension type.
370370
typedef struct ur_platform_extension_t {
371-
char name[UR_MAX_EXTENSION_NAME_LENGTH]; ///< [in] null-terminated extension name.
372-
uint32_t version; ///< [in] version of the extension using ::UR_MAKE_VERSION.
371+
char *name; ///< [in] null-terminated extension name.
372+
uint32_t version; ///< [in] version of the extension using ::UR_MAKE_VERSION.
373373

374374
} ur_platform_extension_t;
375375

scripts/core/EXT.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ without affecting the core specification. Extensions may in future be promoted t
1515
in a later version of Unified Runtime, when agreed upon by the Working Group. All extensions are
1616
optional and are not required to be implemented by any particular adapter, but are expected to
1717
be widely available and possibly be required in a future version of the specification. Adapters
18-
must report which extensions are supported through the ${x}PlatformGetExtensionProperties query.
18+
must report which extensions are supported through the ${X}_PLATFORM_INFO_EXTENSIONS platform info query.
1919
Each extension may also impose additional restrictions on when it can be used - i.e. a platform
2020
or device query.
2121

@@ -29,7 +29,7 @@ Requirements
2929
============
3030

3131
- Extensions must use globally unique names for macros, enums, structures and functions
32-
- Extensions must have globally unique extension names reported from ${x}PlatformGetExtensionProperties
32+
- Extensions must have globally unique extension names reported from ${X}_PLATFORM_INFO_EXTENSIONS platform info query
3333
- All extensions must be defined in this specification
3434
- Extensions must not break backwards compatibility of the core APIs
3535
- Standard extension versions must be backwards compatible with prior versions

scripts/core/platform.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ desc: "Extension type."
2020
name: $x_platform_extension_t
2121
class: $xPlatform
2222
members:
23-
- type: char
24-
name: name[$X_MAX_EXTENSION_NAME_LENGTH]
23+
# TODO - this should be char[], but haven't got it to work with generator yet
24+
- type: char*
25+
name: name
2526
desc: "[in] null-terminated extension name."
2627
- type: uint32_t
2728
name: version

source/common/ur_params.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,9 +941,9 @@ inline std::ostream &operator<<(std::ostream &os,
941941
const struct ur_platform_extension_t params) {
942942
os << "(struct ur_platform_extension_t){";
943943

944-
os << ".name[UR_MAX_EXTENSION_NAME_LENGTH] = ";
944+
os << ".name = ";
945945

946-
os << (params.name[UR_MAX_EXTENSION_NAME_LENGTH]);
946+
ur_params::serializePtr(os, (params.name));
947947

948948
os << ", ";
949949
os << ".version = ";

0 commit comments

Comments
 (0)