mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-04 16:04:58 +08:00
[ROCm][Windows] Enable torchvision build with ROCm on Windows (#147382)
- Updated HIP flags for Windows (removed non Windows flags on Windows case, added runtime library) - Set hipcc call for Windows case - Removed CUDA flags (not used in ROCm) on Windows - Updated Windows compiler (added case when using ROCm on Windows) - Fixed path issue in hipify_python Pull Request resolved: https://github.com/pytorch/pytorch/pull/147382 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <jeff.daily@amd.com>
This commit is contained in:
committed by
PyTorch MergeBot
parent
61a64c20c4
commit
268de64005
@ -139,7 +139,6 @@ class GeneratedFileCleaner:
|
||||
for d in self.dirs_to_clean[::-1]:
|
||||
os.rmdir(d)
|
||||
|
||||
|
||||
# Follow UNIX convention for paths to use '/' instead of '\\' on Windows
|
||||
def _to_unix_path(path: str) -> str:
|
||||
return path.replace(os.sep, '/')
|
||||
@ -830,6 +829,7 @@ def preprocessor(
|
||||
show_progress: bool) -> HipifyResult:
|
||||
""" Executes the CUDA -> HIP conversion on the specified file. """
|
||||
fin_path = os.path.abspath(os.path.join(output_directory, filepath))
|
||||
filepath = _to_unix_path(filepath)
|
||||
hipify_result = HIPIFY_FINAL_RESULT[fin_path]
|
||||
if filepath not in all_files:
|
||||
hipify_result.hipified_path = None
|
||||
@ -932,8 +932,8 @@ def preprocessor(
|
||||
return templ.format(os.path.relpath(header_fout_path if header_fout_path is not None
|
||||
else header_filepath, header_dir))
|
||||
hipified_header_filepath = HIPIFY_FINAL_RESULT[header_filepath].hipified_path
|
||||
return templ.format(os.path.relpath(hipified_header_filepath if hipified_header_filepath is not None
|
||||
else header_filepath, header_dir))
|
||||
return templ.format(_to_unix_path(os.path.relpath(hipified_header_filepath if hipified_header_filepath is not None
|
||||
else header_filepath, header_dir)))
|
||||
|
||||
return m.group(0)
|
||||
return repl
|
||||
|
||||
Reference in New Issue
Block a user