Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:47

0001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0002 #include "HeterogeneousCore/SonicTriton/interface/triton_utils.h"
0003 
0004 #include <sstream>
0005 #include <experimental/iterator>
0006 
0007 namespace triton_utils {
0008 
0009   template <typename C>
0010   std::string printColl(const C& coll, const std::string& delim) {
0011     if (coll.empty())
0012       return "";
0013     std::stringstream msg;
0014     //avoid trailing delim
0015     std::copy(std::begin(coll), std::end(coll), std::experimental::make_ostream_joiner(msg, delim));
0016     return msg.str();
0017   }
0018 
0019   void convertToWarning(const cms::Exception& e) { edm::LogWarning(e.category()) << e.explainSelf(); }
0020 }  // namespace triton_utils
0021 
0022 template std::string triton_utils::printColl(const edm::Span<std::vector<int64_t>::const_iterator>& coll,
0023                                              const std::string& delim);
0024 template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim);
0025 template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim);
0026 template std::string triton_utils::printColl(const std::vector<std::string>& coll, const std::string& delim);
0027 template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, const std::string& delim);