-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate NVProfilerService from boost::format to {fmt} #30856
Migrate NVProfilerService from boost::format to {fmt} #30856
Conversation
The code-checks are being triggered in jenkins. |
@@ -502,7 +502,7 @@ void NVProfilerService::preallocate(edm::service::SystemBounds const& bounds) { | |||
// create the NVTX domains for per-EDM-stream transitions | |||
stream_domain_.resize(concurrentStreams); | |||
for (unsigned int sid = 0; sid < concurrentStreams; ++sid) { | |||
stream_domain_[sid] = nvtxDomainCreate((boost::format("EDM Stream %d") % sid).str().c_str()); | |||
stream_domain_[sid] = nvtxDomainCreate(fmt::sprintf("EDM Stream %d", sid).c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it actually safe ?
Does the C string live long enough to be copied by the nvtxDomainCreate
function ?
Of course this would have been an issue also before...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be safe. From 15.2 of N4659 (last C++17 draft)
Temporary objects are destroyed as the last step in evaluating the full-expression (4.6) that (lexically) contains the point where they were created. This is true even if that evaluation ends in throwing an exception. The value computations and side effects of destroying a temporary object are associated only with the full-expression, not with any specific subexpression.
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-30856/17213
|
@cmsbuild, please test |
A new Pull Request was created by @fwyzard (Andrea Bocci) for master. It involves the following packages: HeterogeneousCore/CUDAServices @makortel, @cmsbuild, @fwyzard can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
The tests are being triggered in jenkins.
|
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
Thanks, but shouldn't be necessary - I made some standalone tests, and the code seems to behave correctly. |
PR description:
Migrate from
boost::format
tofmt::sprintf
.