[Openmp-commits] [openmp] [Libomptarget] Remove temporary files in AMDGPU JIT impl (PR #77980)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Mon Jan 15 05:54:36 PST 2024


================
@@ -1999,21 +2000,27 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
 
     // TODO: We should try to avoid materialization but there seems to be no
     // good linker interface w/o file i/o.
-    SmallString<128> LinkerOutputFilePath;
-    std::error_code EC = sys::fs::createTemporaryFile(
-        "amdgpu-pre-link-jit", ".out", LinkerOutputFilePath);
+    SmallString<128> LinkerInputFilePath;
+    std::error_code EC = sys::fs::createTemporaryFile("amdgpu-pre-link-jit",
----------------
jhuber6 wrote:

I don't think it's an issue, the underlying code more or less just tries random filenames until one works. There may be an astronomically slim chance that the stars align and both threads create the same random name at the same exact time and none of the other code detects it, but my gut says that the Linux kernel would handle that fine.

https://github.com/llvm/llvm-project/pull/77980


More information about the Openmp-commits mailing list