#pragma once #include #include #include #include "outputfile.hpp" namespace rocprofiler { namespace att_wrapper { inline void write_other_simd_json( const std::vector& records, const Fspath& filepath, int64_t begin_time, int64_t end_time) { nlohmann::ordered_json out; out["type"] = "OTHER_SIMD_INSTRUCTIONS"; out["begin_time"] = begin_time; out["end_time"] = end_time; out["wgp"] = records.front().wgp; out["instructions_schema"] = {"time", "duration", "category"}; nlohmann::json::array_t events; events.reserve(records.size()); for(const auto& in : records) { events.push_back({ in.time, static_cast(in.cycles), static_cast(in.category), }); } out["instructions_count"] = events.size(); out["instructions"] = std::move(events); OutputFile(filepath.string()) << out; } } // namespace att_wrapper } // namespace rocprofiler