xref: /llvm-project/offload/unittests/OffloadAPI/device/olDeviceInfo.hpp (revision fd3907ccb583df99e9c19d2fe84e4e7c52d75de9)
1 //===------- Offload API tests - Helpers for device info query testing ----===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #pragma once
9 
10 #include <unordered_map>
11 #include <vector>
12 
13 // TODO: We could autogenerate these
14 inline std::vector<ol_device_info_t> DeviceQueries = {
15     OL_DEVICE_INFO_TYPE, OL_DEVICE_INFO_PLATFORM, OL_DEVICE_INFO_NAME,
16     OL_DEVICE_INFO_VENDOR, OL_DEVICE_INFO_DRIVER_VERSION};
17 
18 inline std::unordered_map<ol_device_info_t, size_t> DeviceInfoSizeMap = {
19     {OL_DEVICE_INFO_TYPE, sizeof(ol_device_type_t)},
20     {OL_DEVICE_INFO_PLATFORM, sizeof(ol_platform_handle_t)},
21 };
22