mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Summary: This change was autogenerated by running: ``` % find c10 -iname "*.cpp" -exec python3 tools/clang_tidy.py -c build -x {} -s \; ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/55870 Reviewed By: janeyx99 Differential Revision: D27728617 Pulled By: malfet fbshipit-source-id: bede4d7f0c106d51394d1e9efddf01bf894421c5
16 lines
578 B
C++
16 lines
578 B
C++
#include <c10/core/impl/DeviceGuardImplInterface.h>
|
|
|
|
namespace c10 {
|
|
namespace impl {
|
|
|
|
// NOLINTNEXTLINE(modernize-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays)
|
|
std::atomic<const DeviceGuardImplInterface*>
|
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
|
device_guard_impl_registry[static_cast<size_t>(DeviceType::COMPILE_TIME_MAX_DEVICE_TYPES)];
|
|
|
|
DeviceGuardImplRegistrar::DeviceGuardImplRegistrar(DeviceType type, const DeviceGuardImplInterface* impl) {
|
|
device_guard_impl_registry[static_cast<size_t>(type)].store(impl);
|
|
}
|
|
|
|
}} // namespace c10::impl
|