MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetROCDLDir

Function GetROCDLDir

tensorflow/compiler/xla/service/gpu/amdgpu_compiler.cc:48–69  ·  view source on GitHub ↗

Returns the directory containing ROCm-Device-Libs files. This function is called in AMDGPUCompiler's constructor, so can't return an error. But AMDGPUCompiler::Compile will return an error when the wanted rocdl file doesn't exist in the folder this function returns.

Source from the content-addressed store, hash-verified

46// AMDGPUCompiler::Compile will return an error when the wanted rocdl file
47// doesn't exist in the folder this function returns.
48string GetROCDLDir(const HloModuleConfig& config) {
49 std::vector<string> potential_rocdl_dirs;
50 const string datadir = config.debug_options().xla_gpu_cuda_data_dir();
51 if (!datadir.empty()) {
52 potential_rocdl_dirs.push_back(datadir);
53 }
54 potential_rocdl_dirs.push_back(tensorflow::RocdlRoot());
55
56 // Tries all potential ROCDL directories in the order they are inserted.
57 // Returns the first directory that exists in the file system.
58 for (const string& potential_rocdl_dir : potential_rocdl_dirs) {
59 if (tensorflow::Env::Default()->IsDirectory(potential_rocdl_dir).ok()) {
60 VLOG(2) << "Found ROCm-Device-Libs dir " << potential_rocdl_dir;
61 return potential_rocdl_dir;
62 }
63 VLOG(2) << "Unable to find potential ROCm-Device-Libs dir "
64 << potential_rocdl_dir;
65 }
66
67 // Last resort: maybe in the current folder.
68 return ".";
69}
70
71} // namespace
72

Callers 1

amdgpu_compiler.ccFile · 0.85

Calls 6

RocdlRootFunction · 0.85
DefaultFunction · 0.85
emptyMethod · 0.45
push_backMethod · 0.45
okMethod · 0.45
IsDirectoryMethod · 0.45

Tested by

no test coverage detected