CMS 3D CMS Logo

Classes | Namespaces | Typedefs | Functions
ROCmService.cc File Reference
#include <iomanip>
#include <iostream>
#include <limits>
#include <set>
#include <string>
#include <vector>
#include <hip/hip_runtime.h>
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/ResourceInformation.h"
#include "HeterogeneousCore/ROCmServices/interface/ROCmInterface.h"
#include "HeterogeneousCore/ROCmUtilities/interface/hipCheck.h"
#include "FWCore/ServiceRegistry/interface/ServiceMaker.h"

Go to the source code of this file.

Classes

class  ROCmService
 

Namespaces

 edm
 HLT enums.
 
 edm::service
 

Typedefs

typedef ROCmServiceMaker ::concrete_t ROCmService___t
 
typedef edm::serviceregistry::ServiceMaker< ROCmServiceMaker ::interface_t, ROCmServiceMakerROCmService__t
 
using ROCmServiceMaker = edm::serviceregistry::ParameterSetMaker< ROCmInterface, ROCmService >
 

Functions

std::string decodeVersion (int version)
 
bool edm::service::isProcessWideService (ROCmService const *)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::DescriptionFillerForServices< ROCmService___t > > s_filler__LINE__ ("ROCmService")
 
static const edm::serviceregistry::ServicePluginFactory ::PMaker< ROCmService__ts_maker__LINE__ ("ROCmService")
 
void setHipLimit (hipLimit_t limit, const char *name, size_t request)
 

Typedef Documentation

◆ ROCmService___t

typedef ROCmServiceMaker ::concrete_t ROCmService___t

Definition at line 396 of file ROCmService.cc.

◆ ROCmService__t

Definition at line 396 of file ROCmService.cc.

◆ ROCmServiceMaker

Definition at line 395 of file ROCmService.cc.

Function Documentation

◆ decodeVersion()

std::string decodeVersion ( int  version)

Definition at line 75 of file ROCmService.cc.

References cond::impl::to_string(), and BeamSplash_cfg::version.

Referenced by ROCmService::ROCmService().

75  {
76  return std::to_string(version / 1000) + '.' + std::to_string(version % 1000 / 10);
77 }
std::string to_string(const V &value)
Definition: OMSAccess.h:77

◆ s_filler__LINE__()

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::DescriptionFillerForServices< ROCmService___t > > s_filler__LINE__ ( "ROCmService"  )
static

◆ s_maker__LINE__()

static const edm::serviceregistry::ServicePluginFactory ::PMaker< ROCmService__t > s_maker__LINE__ ( "ROCmService"  )
static

◆ setHipLimit()

void setHipLimit ( hipLimit_t  limit,
const char *  name,
size_t  request 
)

Definition at line 53 of file ROCmService.cc.

References hipCheck, remoteMonitoring_LASER_era2018_cfg::limit, Skims_PA_cff::name, mps_fire::result, and relativeConstraints::value.

Referenced by ROCmService::ROCmService().

53  {
54  // read the current device
55  int device;
56  hipCheck(hipGetDevice(&device));
57  // try to set the requested limit
58  auto result = hipDeviceSetLimit(limit, request);
59  if (hipErrorUnsupportedLimit == result) {
60  edm::LogWarning("ROCmService") << "ROCm device " << device << ": unsupported limit \"" << name << "\"";
61  return;
62  }
63  // read back the limit value
64  size_t value;
65  result = hipDeviceGetLimit(&value, limit);
66  if (hipSuccess != result) {
67  edm::LogWarning("ROCmService") << "ROCm device " << device << ": failed to set limit \"" << name << "\" to "
68  << request << ", current value is " << value;
69  } else if (value != request) {
70  edm::LogWarning("ROCmService") << "ROCm device " << device << ": limit \"" << name << "\" set to " << value
71  << " instead of requested " << request;
72  }
73 }
Definition: value.py:1
#define hipCheck(ARG,...)
Definition: hipCheck.h:52
Log< level::Warning, false > LogWarning