-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDevice.cpp
More file actions
49 lines (37 loc) · 1.37 KB
/
Device.cpp
File metadata and controls
49 lines (37 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//===- DX/Device.cpp - DirectX Device API ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
#include "API/Device.h"
#include "Config.h"
#include "llvm/Support/Error.h"
#include <memory>
using namespace offloadtest;
Queue::~Queue() {}
Device::~Device() {}
llvm::Expected<llvm::SmallVector<std::unique_ptr<Device>>>
offloadtest::initializeDevices(const DeviceConfig Config) {
llvm::SmallVector<std::unique_ptr<Device>> Devices;
llvm::Error Result = llvm::Error::success();
#ifdef OFFLOADTEST_ENABLE_D3D12
if (auto Err = initializeDX12Devices(Config, Devices))
Result = llvm::joinErrors(std::move(Result), std::move(Err));
#endif
#ifdef OFFLOADTEST_ENABLE_VULKAN
if (auto Err = initializeVulkanDevices(Config, Devices))
Result = llvm::joinErrors(std::move(Result), std::move(Err));
#endif
#ifdef OFFLOADTEST_ENABLE_METAL
if (auto Err = initializeMetalDevices(Config, Devices))
Result = llvm::joinErrors(std::move(Result), std::move(Err));
#endif
if (Result)
return std::move(Result);
return Devices;
}