Skip to content

Commit

Permalink
Fix device build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Apr 28, 2024
1 parent 9bb78d4 commit 2c44958
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/celeritas/global/ActionLauncher.device.hh
Expand Up @@ -75,7 +75,7 @@ class ActionLauncher

//! Create a launcher with a string extension
ActionLauncher(ExplicitActionInterface const& action, std::string_view ext)
: ActionLauncher{action.label() + "-" + std::string(ext)}
: ActionLauncher{std::string(action.label()) + "-" + std::string(ext)}
{
}

Expand Down
7 changes: 4 additions & 3 deletions src/corecel/sys/ScopedProfiling.cuda.cc
Expand Up @@ -42,20 +42,21 @@ nvtxStringHandle_t message_handle_for(std::string_view message)
static std::unordered_map<std::string, nvtxStringHandle_t> registry;
static std::shared_mutex mutex;

std::string temp_message{message};
{
std::shared_lock lock(mutex);

if (auto message_handle = registry.find(message);
if (auto message_handle = registry.find(temp_message);
message_handle != registry.end())
{
return message_handle->second;
}
}

// We did not find the handle; try to insert it
auto [iter, inserted] = [message] {
auto [iter, inserted] = [&temp_message] {
std::unique_lock lock(mutex);
return registry.insert({std::string{message}, {}});
return registry.insert({std::move(temp_message), {}});
}();
if (inserted)
{
Expand Down

0 comments on commit 2c44958

Please sign in to comment.