Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-12 01:51:28

0001 #ifndef HeterogeneousCore_SonicTriton_TritonOneEDAnalyzer
0002 #define HeterogeneousCore_SonicTriton_TritonOneEDAnalyzer
0003 
0004 #include "HeterogeneousCore/SonicCore/interface/SonicOneEDAnalyzer.h"
0005 #include "HeterogeneousCore/SonicTriton/interface/TritonClient.h"
0006 #include "FWCore/ParameterSet/interface/FileInPath.h"
0007 #include "FWCore/ServiceRegistry/interface/Service.h"
0008 #include "HeterogeneousCore/SonicTriton/interface/TritonService.h"
0009 
0010 #include <string>
0011 
0012 template <typename... Capabilities>
0013 class TritonOneEDAnalyzer : public SonicOneEDAnalyzer<TritonClient, Capabilities...> {
0014 public:
0015   TritonOneEDAnalyzer(edm::ParameterSet const& cfg) : SonicOneEDAnalyzer<TritonClient, Capabilities...>(cfg) {
0016     edm::Service<TritonService> ts;
0017     ts->addModel(this->clientPset_.template getParameter<std::string>("modelName"),
0018                  this->clientPset_.template getParameter<edm::FileInPath>("modelConfigPath").fullPath());
0019   }
0020 
0021   //destroy client before destructor called to unregister any shared memory before TritonService shuts down fallback server
0022   virtual void tritonEndJob() {}
0023   void endJob() final {
0024     tritonEndJob();
0025     this->client_.reset();
0026   }
0027 };
0028 
0029 #endif