xref: /llvm-project/libc/benchmarks/gpu/BenchmarkLogger.h (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
102b57dedSjameshu15869 //===-- Utilities to log to standard output during tests --------*- C++ -*-===//
202b57dedSjameshu15869 //
302b57dedSjameshu15869 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
402b57dedSjameshu15869 // See https://llvm.org/LICENSE.txt for license information.
502b57dedSjameshu15869 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
602b57dedSjameshu15869 //
702b57dedSjameshu15869 //===----------------------------------------------------------------------===//
802b57dedSjameshu15869 
902b57dedSjameshu15869 #ifndef LLVM_LIBC_BENCHMARKS_GPU_BENCHMARKLOGGER_H
1002b57dedSjameshu15869 #define LLVM_LIBC_BENCHMARKS_GPU_BENCHMARKLOGGER_H
1102b57dedSjameshu15869 
12*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
13*5ff3ff33SPetr Hosek 
14*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
1502b57dedSjameshu15869 namespace benchmarks {
1602b57dedSjameshu15869 
1702b57dedSjameshu15869 // A class to log to standard output in the context of hermetic tests.
1802b57dedSjameshu15869 struct BenchmarkLogger {
1902b57dedSjameshu15869   constexpr BenchmarkLogger() = default;
2002b57dedSjameshu15869   template <typename T> BenchmarkLogger &operator<<(T);
2102b57dedSjameshu15869 };
2202b57dedSjameshu15869 
2302b57dedSjameshu15869 // A global TestLogger instance to be used in tests.
2402b57dedSjameshu15869 extern BenchmarkLogger log;
2502b57dedSjameshu15869 
2602b57dedSjameshu15869 } // namespace benchmarks
27*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
2802b57dedSjameshu15869 
2902b57dedSjameshu15869 #endif /* LLVM_LIBC_BENCHMARKS_GPU_BENCHMARKLOGGER_H */
30