Skip to content

Commit

Permalink
[Cleanup] Use push_back instead of emplace_back where appropriate (go…
Browse files Browse the repository at this point in the history
…/totw/112)

PiperOrigin-RevId: 707691748
  • Loading branch information
frgossen authored and Google-ML-Automation committed Dec 18, 2024
1 parent 59a3e6e commit 6bdae60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion xla/tsl/platform/cloud/gcs_dns_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void GcsDnsCache::AnnotateRequest(HttpRequest* request) {
LOG(ERROR) << "Error converting response to IP address for " << name
<< ": " << strerror(errno);
} else {
output.emplace_back(buf);
output.push_back(buf);
VLOG(1) << "... address: " << buf;
}
}
Expand Down
6 changes: 3 additions & 3 deletions xla/tsl/platform/default/cuda_root_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ std::vector<std::string> CandidateCudaRoots() {
std::string executable_path = tsl::Env::Default()->GetExecutablePath();
std::string cuda_nvcc_dir =
io::JoinPath(executable_path + "." + runfiles_suffix, "cuda_nvcc");
roots.emplace_back(cuda_nvcc_dir);
roots.push_back(cuda_nvcc_dir);

// The CUDA candidate root for python targets.
std::string runfiles_dir = tsl::Env::Default()->GetRunfilesDir();
std::size_t runfiles_ind = runfiles_dir.rfind(runfiles_suffix);
cuda_nvcc_dir = io::JoinPath(
runfiles_dir.substr(0, runfiles_ind + runfiles_suffix.length()),
"cuda_nvcc");
roots.emplace_back(cuda_nvcc_dir);
roots.push_back(cuda_nvcc_dir);

roots.emplace_back(TF_CUDA_TOOLKIT_PATH);
roots.push_back(TF_CUDA_TOOLKIT_PATH);
roots.emplace_back(std::string("/usr/local/cuda"));

#if defined(PLATFORM_POSIX) && !defined(__APPLE__)
Expand Down

0 comments on commit 6bdae60

Please sign in to comment.