Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion offload/liboffload/API/Platform.td
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def ol_platform_info_t : Enum {
TaggedEtor<"NAME", "char[]", "The string denoting name of the platform. The size of the info needs to be dynamically queried.">,
TaggedEtor<"VENDOR_NAME", "char[]", "The string denoting name of the vendor of the platform. The size of the info needs to be dynamically queried.">,
TaggedEtor<"VERSION", "char[]", "The string denoting the version of the platform. The size of the info needs to be dynamically queried.">,
TaggedEtor<"BACKEND", "ol_platform_backend_t", "The native backend of the platform.">
TaggedEtor<"BACKEND", "ol_platform_backend_t", "The native backend of the platform.">,
TaggedEtor<"IS_INITIALIZED", "bool", "Is platform initialized.">,
TaggedEtor<"NUMBER_OF_DEVICES", "int32_t", "Number of devices.">
];
}

Expand Down
6 changes: 6 additions & 0 deletions offload/liboffload/src/OffloadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ Error olGetPlatformInfoImplDetail(ol_platform_handle_t Platform,
case OL_PLATFORM_INFO_BACKEND: {
return Info.write<ol_platform_backend_t>(Platform->BackendType);
}
case OL_PLATFORM_INFO_IS_INITIALIZED: {
return Info.write<bool>(Platform->Plugin->is_initialized());
}
case OL_PLATFORM_INFO_NUMBER_OF_DEVICES: {
return Info.write<int32_t>(Platform->Plugin->number_of_devices());
}
default:
return createOffloadError(ErrorCode::INVALID_ENUMERATION,
"getPlatformInfo enum '%i' is invalid", PropName);
Expand Down