================
@@ -0,0 +1,164 @@
+//===-- flop_counter_runtime.cpp - FLOP Counter Runtime ------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the runtime for counting floating-point operations.
+// It hooks into instrumentation points inserted by the LLVM Instrumentor pass.
+//
+//===----------------------------------------------------------------------===//
+
+#include "../instrumentor_runtime.h"
+
+#include <atomic>
+#include <cinttypes>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+namespace {
+
+/// FLOP counter statistics (thread-safe using atomics)
+struct FlopCounterStats {
+  std::atomic<uint64_t> TotalFlops{0};
----------------
arsenm wrote:

I'd assume std:;atomic 0 initializes by default?

https://github.com/llvm/llvm-project/pull/205698
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to