Skip to content

Commit

Permalink
update formatting script to handle jacobi header
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Sep 3, 2021
1 parent 17dd3b5 commit 1a065eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dev_tools/scripts/format_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CLANG_FORMAT=${CLANG_FORMAT:="clang-format"}

convert_header () {
local regex="^(#include )(<|\")(.*)(\"|>)$"
local jacobi_regex="^(cuda|hip)\/preconditioner\/jacobi_common(\.hip)?\.hpp"
if [[ $@ =~ ${regex} ]]; then
header_file="${BASH_REMATCH[3]}"
if [ -f "${header_file}" ]; then
Expand All @@ -14,6 +15,8 @@ convert_header () {
fi
elif [ "${header_file}" = "matrices/config.hpp" ]; then
echo "#include \"${header_file}\""
elif [[ "${header_file}" =~ ${jacobi_regex} ]]; then
echo "#include \"${header_file}\""
else
echo "#include <${header_file}>"
fi
Expand Down

0 comments on commit 1a065eb

Please sign in to comment.