Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions hipify/cuda_to_hip_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7605,6 +7605,9 @@
),
),
("cuComplex", ("rocblas_float_complex", CONV_TYPE, API_BLAS)),
("cuFloatComplex", ("rocblas_float_complex", CONV_TYPE, API_BLAS)),
("cuCrealf", ("std::real", CONV_TYPE, API_BLAS)), # From rocblas complex header
("cuCimagf", ("std::imag", CONV_TYPE, API_BLAS)), # From rocblas complex header
("cuDoubleComplex", ("rocblas_double_complex", CONV_TYPE, API_BLAS)),
("cufftResult_t", ("hipfftResult_t", CONV_TYPE, API_FFT)),
("cufftResult", ("hipfftResult", CONV_TYPE, API_FFT)),
Expand Down
7 changes: 5 additions & 2 deletions hipify/hipify_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,13 @@ def preprocess_file_and_save_result(
is_pytorch_extension: bool,
clean_ctx: GeneratedFileCleaner,
show_progress: bool) -> None:
fin_path = os.path.abspath(os.path.join(output_directory, filepath))
if fin_path not in HIPIFY_FINAL_RESULT:
HIPIFY_FINAL_RESULT[fin_path] = {}
HIPIFY_FINAL_RESULT[fin_path]["hipified_path"] = fin_path
result = preprocessor(output_directory, filepath, all_files, header_include_dirs, stats,
hip_clang_launch, is_pytorch_extension, clean_ctx, show_progress)

fin_path = os.path.abspath(os.path.join(output_directory, filepath))
# Show what happened
if show_progress and "ignored" not in result["status"]:
print(
Expand Down Expand Up @@ -766,7 +769,6 @@ def pt_sparse_repl(m):
# checks SPARSE map first, and if a miss occurs, falls back to pytorch mappings
return PYTORCH_SPARSE_MAP.get(m.group(0), pt_repl(m))


if is_pytorch_extension:
output_source = RE_PYTORCH_PREPROCESSOR.sub(pt_repl, output_source)
else:
Expand Down Expand Up @@ -820,6 +822,7 @@ def repl(m):
return m.group(0)
# Hipify header file first if needed
if header_filepath not in HIPIFY_FINAL_RESULT:
print(f'recursing on {header_filepath}')
preprocess_file_and_save_result(output_directory,
header_filepath,
all_files, header_include_dirs, stats, hip_clang_launch,
Expand Down