debug.h 598 B

123456789101112131415161718192021222324252627
  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. #pragma once
  7. #include <c10/macros/Macros.h>
  8. namespace c10d {
  9. enum class DebugLevel {
  10. Off,
  11. Info,
  12. Detail
  13. };
  14. TORCH_API void setDebugLevel(DebugLevel level);
  15. // Sets the debug level based on the value of the `TORCH_DISTRIBUTED_DEBUG`
  16. // environment variable.
  17. TORCH_API void setDebugLevelFromEnvironment();
  18. TORCH_API DebugLevel debug_level() noexcept;
  19. } // namespace c10d