When composing the output file name, the path to the file is being dropped. The full path is required.
Details
- Reviewers
Hahnfeld ABataev caomhin carlo.bertolli hfinkel tra - Commits
- rG5636f4b33aee: [OpenMP] Bugfix: output file name drops the absolute path where full path is…
rC314156: [OpenMP] Bugfix: output file name drops the absolute path where full path is…
rL314156: [OpenMP] Bugfix: output file name drops the absolute path where full path is…
Diff Detail
- Repository
- rL LLVM
Event Timeline
Shouldn't this temp .cubin file go into the temporary directory, as opposed to the same directory as the input file?
That is indeed the intention. The filename already contains the "/tmp/" I just make sure that doesn't get dropped.
Is that guaranteed to always be the case? If not, you're just hiding the problem.
IMO, it would be better to construct a temporary path for the file, if that's the intention. All you need is TC.getDriver().GetTemporaryPath(...).
lib/Driver/ToolChains/Cuda.cpp | ||
---|---|---|
442 | Naming this FullPath seems inaccurate. It's not the full path, it's the root path (which is just the root_name + root_directory, but not any directory after that). In any case, I don't see why all of this is necessary. Can't you just have: SmallString<256> Name = II.getFilename(); llvm::sys::path::replace_extension(Name, "cubin"); const char *CubinF = C.addTempFile(C.getArgs().MakeArgString(Name)); |
lib/Driver/ToolChains/Cuda.cpp | ||
---|---|---|
441–442 | I don't think explicit StringRef is needed here. SmallString<256> Name(II.getFilename()); should do the job. |
Naming this FullPath seems inaccurate. It's not the full path, it's the root path (which is just the root_name + root_directory, but not any directory after that).
In any case, I don't see why all of this is necessary. Can't you just have: