InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_DEVICE_H_
2#define INFINI_OPS_DEVICE_H_
3
4#include <infini/rt.h>
5
6#include "common/traits.h"
7
8namespace infini::ops {
9
10using Device = infini::rt::Device;
11
12template <Device::Type device_type>
13using DeviceEnabled = infini::rt::DeviceEnabled<device_type>;
14
16 List<Device::Type::kCpu, Device::Type::kNvidia, Device::Type::kCambricon,
17 Device::Type::kAscend, Device::Type::kMetax, Device::Type::kMoore,
18 Device::Type::kIluvatar, Device::Type::kHygon, Device::Type::kMars,
19 Device::Type::kThead>;
20
21template <typename>
23 struct Filter {
24 template <Device::Type kDev>
25 std::enable_if_t<DeviceEnabled<kDev>::value> operator()(
26 ValueTag<kDev>) const {}
27 };
28
29 using type = typename FilterList<Filter, std::tuple<>, AllDeviceTypes>::type;
30};
31
32template <typename T>
34
35} // namespace infini::ops
36
37#endif
Definition generated/include/operator.h:28
typename ActiveDevicesImpl< T >::type ActiveDevices
Definition device.h:33
infini::rt::Device Device
Definition device.h:10
infini::rt::DeviceEnabled< device_type > DeviceEnabled
Definition device.h:13
List< Device::Type::kCpu, Device::Type::kNvidia, Device::Type::kCambricon, Device::Type::kAscend, Device::Type::kMetax, Device::Type::kMoore, Device::Type::kIluvatar, Device::Type::kHygon, Device::Type::kMars, Device::Type::kThead > AllDeviceTypes
Definition device.h:19
std::enable_if_t< DeviceEnabled< kDev >::value > operator()(ValueTag< kDev >) const
Definition device.h:25
Definition device.h:22
typename FilterList< Filter, std::tuple<>, AllDeviceTypes >::type type
Definition device.h:29