Debian Codegraph @

offload/unittests/OffloadAPI/common/Environment.hpp

raw
1 //===------- Offload API tests - gtest environment ------------------------===//
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
9 #pragma once
10
11 #include "llvm/Support/MemoryBuffer.h"
12 #include <OffloadAPI.h>
13 #include <gtest/gtest.h>
14
15 namespace TestEnvironment {
16
17 struct Device {
18 ol_device_handle_t Handle;
19 std::string Name;
20 };
21
22 const std::vector<Device> &getDevices();
23 ol_device_handle_t getHostDevice();
24 bool loadDeviceBinary(const std::string &BinaryName, ol_device_handle_t Device,
25 std::unique_ptr<llvm::MemoryBuffer> &BinaryOut);
26 } // namespace TestEnvironment