From abc8a9b50bf4358525d07010350d8b39c7778e8d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 6 Mar 2026 08:54:47 +0100 Subject: [PATCH] hipify: suppress warnings --- CMakeLists.txt | 1 + CMakeLists_files.cmake | 1 + bin/hipify_file.sh | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fec39fea14..a0ca8609fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ option(BUILD_FLOW_ALU_GRID "Build flow blackoil with alu grid" OFF) option(USE_DAMARIS_LIB "Use the Damaris library for asynchronous I/O?" OFF) option(USE_GPU_BRIDGE "Enable the GPU bridge (GPU/AMGCL solvers)" ON) option(CONVERT_CUDA_TO_HIP "Convert CUDA code to HIP (to run on AMD cards)" OFF) +option(SUPPRESS_HIPIFY_WARNINGS "Suppress warnings in hipify?" ON) option(USE_AMGX "Enable AMGX support?" OFF) option(USE_HYPRE "Use the Hypre library for linear solvers?" OFF) set(OPM_COMPILE_COMPONENTS "2;3;4;5;6;7" CACHE STRING "The components to compile support for") diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 86ec71b9bb..7e6fe86483 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -48,6 +48,7 @@ macro (ADD_CUDA_OR_HIP_FILE LIST DIR FILE) ${cuda_file_path} ${hip_file_path} $ + ${SUPPRESS_HIPIFY_WARNINGS} DEPENDS ${cuda_file_path} COMMENT diff --git a/bin/hipify_file.sh b/bin/hipify_file.sh index e4df427a9b..e1c16ce5f5 100644 --- a/bin/hipify_file.sh +++ b/bin/hipify_file.sh @@ -6,12 +6,18 @@ set -e # Make sure the script fails if a command fails input_file=$1 output_file=$2 hipify_command=$3 +suppress=$4 # make sure the output folder exists mkdir -p $(dirname $output_file) # hipify out-of-place -$hipify_command $input_file > $output_file +if [ "$suppress" == "1" ] || [ "$suppress" == "ON" ] +then + $hipify_command -o $output_file $input_file 2> /dev/null +else + $hipify_command -o $output_file $input_file +fi # expand includes so we only need include_directories (path to hip) sed -i 's/^#include /#include /g' $output_file