Skip to content

Commit

Permalink
[TSL] Remove some Windows- and Darwinn-specific GPU code.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 571535260
  • Loading branch information
chsigg authored and tensorflower-gardener committed Oct 7, 2023
1 parent 333145d commit a47d18e
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions third_party/xla/third_party/tsl/tsl/platform/default/dso_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,13 @@ StatusOr<void*> GetDsoHandle(const string& name, const string& version) {

auto message = absl::StrCat("Could not load dynamic library '", filename,
"'; dlerror: ", status.message());
#if !defined(PLATFORM_WINDOWS)
if (const char* ld_library_path = getenv("LD_LIBRARY_PATH")) {
message += absl::StrCat("; LD_LIBRARY_PATH: ", ld_library_path);
}
#endif
VLOG(1) << message;
return Status(absl::StatusCode::kFailedPrecondition, message);
}
} // namespace

namespace DsoLoader {
StatusOr<void*> GetCudaDriverDsoHandle() {
#if defined(PLATFORM_WINDOWS)
return GetDsoHandle("nvcuda", "");
#elif defined(__APPLE__)
// On Mac OS X, CUDA sometimes installs libcuda.dylib instead of
// libcuda.1.dylib.
auto handle_or = GetDsoHandle("cuda", "");
if (handle_or.ok()) {
return handle_or;
}
#endif
return GetDsoHandle("cuda", "1");
}

Expand Down Expand Up @@ -126,19 +111,11 @@ StatusOr<void*> GetNcclDsoHandle() {
}

StatusOr<void*> GetNvInferDsoHandle() {
#if defined(PLATFORM_WINDOWS)
return GetDsoHandle("nvinfer", "");
#else
return GetDsoHandle("nvinfer", GetTensorRTVersion());
#endif
}

StatusOr<void*> GetNvInferPluginDsoHandle() {
#if defined(PLATFORM_WINDOWS)
return GetDsoHandle("nvinfer_plugin", "");
#else
return GetDsoHandle("nvinfer_plugin", GetTensorRTVersion());
#endif
}

StatusOr<void*> GetRocblasDsoHandle() { return GetDsoHandle("rocblas", ""); }
Expand Down

0 comments on commit a47d18e

Please sign in to comment.