• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #pragma once
2 
3 // In order to preserve bc, we make DeprecatedTypeProperties instances unique
4 // just like they are for Type.
5 
6 #include <c10/core/Backend.h>
7 #include <c10/core/ScalarType.h>
8 #include <memory>
9 
10 namespace at {
11 
12 class DeprecatedTypeProperties;
13 
14 struct TORCH_API DeprecatedTypePropertiesDeleter {
15   void operator()(DeprecatedTypeProperties * ptr);
16 };
17 
18 class TORCH_API DeprecatedTypePropertiesRegistry {
19  public:
20   DeprecatedTypePropertiesRegistry();
21 
22   DeprecatedTypeProperties& getDeprecatedTypeProperties(Backend p, ScalarType s) const;
23 
24 private:
25   // NOLINTNEXTLINE(*c-array*)
26   std::unique_ptr<DeprecatedTypeProperties> registry
27     [static_cast<int>(Backend::NumOptions)]
28     [static_cast<int>(ScalarType::NumOptions)];
29 };
30 
31 TORCH_API DeprecatedTypePropertiesRegistry& globalDeprecatedTypePropertiesRegistry();
32 
33 } // namespace at
34