1 | // Copyright (c) Meta Platforms, Inc. and its affiliates. |
2 | // All rights reserved. |
3 | // |
4 | // This source code is licensed under the BSD-style license found in the |
5 | // LICENSE file in the root directory of this source tree. |
6 | |
7 | #pragma once |
8 | |
9 | #include <c10/macros/Macros.h> |
10 | |
11 | namespace c10d { |
12 | |
13 | enum class DebugLevel { Off = 0, Info = 1, Detail = 2 }; |
14 | |
15 | TORCH_API void setDebugLevel(DebugLevel level); |
16 | |
17 | // Sets the debug level based on the value of the `TORCH_DISTRIBUTED_DEBUG` |
18 | // environment variable. |
19 | TORCH_API void setDebugLevelFromEnvironment(); |
20 | |
21 | TORCH_API DebugLevel debug_level() noexcept; |
22 | |
23 | } // namespace c10d |
24 | |