Files
TheRock/compiler/hipify/tests/run_test.bat
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

74 lines
2.2 KiB
Batchfile

@echo off
setlocal
for %%i in (FileCheck.exe) do set FILE_CHECK=%%~$PATH:i
if not defined FILE_CHECK (echo Error: FileCheck.exe not found in PATH. && exit /b 1)
set HIPIFY=%1
set IN_FILE=%2
set TMP_FILE=%3
set CUDA_ROOT=%4
set CLANG_RES=%5
set NUM=%6
set all_args=%*
if %NUM% EQU 1 (
set HIPIFY_OPTS=%7
call set clang_args=%%all_args:*%7=%%
) else if %NUM% EQU 2 (
set HIPIFY_OPTS=%7 %8
call set clang_args=%%all_args:*%8=%%
) else if %NUM% EQU 3 (
set HIPIFY_OPTS=%7 %8 %9
shift
call set clang_args=%%all_args:*%9=%%
) else if %NUM% EQU 4 (
shift
call set HIPIFY_OPTS=%%6 %%7 %%8 %%9
) else if %NUM% EQU 5 (
shift
shift
call set HIPIFY_OPTS=%%5 %%6 %%7 %%8 %%9
) else (
call set clang_args=%%all_args:*%5=%%
set NUM=0
)
if %NUM% EQU 4 (
shift
call set clang_args=%%all_args:*%9=%%
)
if %NUM% EQU 5 (
shift
call set clang_args=%%all_args:*%9=%%
)
set test_dir=%~dp2
set "test_dir=%test_dir:\=/%"
set compile_commands=compile_commands.json
set json_in=%test_dir%%compile_commands%.in
set json_out=%test_dir%%compile_commands%
if exist %json_in% (
powershell -Command "(gc %json_in%) -replace '<test dir>', '%test_dir%' -replace '<CUDA dir>', '%CUDA_ROOT%' | Out-File -encoding ASCII %json_out%"
set hipify_cmd=%HIPIFY% -o=%TMP_FILE% %IN_FILE% %CUDA_ROOT% --clang-resource-directory=%CLANG_RES% %HIPIFY_OPTS% -p=%test_dir% %HIPIFY_OPTS% -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH=1
) else (
set hipify_cmd=%HIPIFY% -o=%TMP_FILE% %IN_FILE% %CUDA_ROOT% --clang-resource-directory=%CLANG_RES% %HIPIFY_OPTS% -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH=1 -- %clang_args%
)
SET CUDA=%CUDA_ROOT:~13,-1%
echo [HIPIFY] CUDA directory : %CUDA%
echo [HIPIFY] clang res directory : %CLANG_RES%
echo [HIPIFY] hipify options count: %NUM%
echo [HIPIFY] hipify options : %HIPIFY_OPTS%
echo [HIPIFY] clang options : %clang_args%
echo [HIPIFY] hipify-clang command: %hipify_cmd%
call %hipify_cmd%
if errorlevel 1 (echo Error: hipify-clang.exe failed with exit code: %errorlevel% && exit /b %errorlevel%)
findstr /v /r /c:"[ ]*//[ ]*[CHECK*|RUN]" %TMP_FILE% | %FILE_CHECK% %IN_FILE%
if errorlevel 1 (echo Error: FileCheck.exe failed with exit code: %errorlevel% && exit /b %errorlevel%)