| 90 | } |
| 91 | |
| 92 | const char *CudaPtxInMemory::default_text() const { |
| 93 | if (ptx_by_compute_capability_.empty()) { |
| 94 | return nullptr; |
| 95 | } |
| 96 | |
| 97 | absl::MutexLock lock(&mu_); |
| 98 | |
| 99 | auto ptx = ptx_by_compute_capability_.begin()->second; |
| 100 | // Check if there is an entry in decompressed ptx table. |
| 101 | auto decompressed_ptx_iter = decompressed_ptx_.find(ptx); |
| 102 | if (decompressed_ptx_iter != decompressed_ptx_.end()) { |
| 103 | // If the decompressed string is empty, which means the ptx hasn't been |
| 104 | // decompressed, decompress it here. |
| 105 | if (decompressed_ptx_iter->second.empty()) { |
| 106 | decompressed_ptx_iter->second = DecompressPtx(ptx); |
| 107 | } |
| 108 | return decompressed_ptx_iter->second.c_str(); |
| 109 | } |
| 110 | return ptx; |
| 111 | } |
| 112 | |
| 113 | const char *CudaPtxInMemory::original_default_text() const { |
| 114 | if (ptx_by_compute_capability_.empty()) { |