diff --git a/bin/hipconvertinplace-perl.sh b/bin/hipconvertinplace-perl.sh new file mode 100755 index 0000000000..a8c8d6d9e8 --- /dev/null +++ b/bin/hipconvertinplace-perl.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +#usage : hipconvertinplace.sh [DIRNAME] [HIPIFY_OPTIONS] + +#hipify "inplace" all code files in specified directory. +# This can be quite handy when dealing with an existing CUDA code base since the script +# preserves the existing directory structure. + +# For each code file, this script will: +# - If ".prehip file does not exist, copy the original code to a new file with extension ".prehip". Then Hipify the code file. +# - If ".prehip" file exists, this is used as input to hipify. +# (this is useful for testing improvements to the hipify toolset). + + +SCRIPT_DIR=`dirname $0` +SEARCH_DIR=$1 +shift +$SCRIPT_DIR/hipify -inplace -print-stats "$@" `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` diff --git a/bin/hipconvertinplace.sh b/bin/hipconvertinplace.sh old mode 100755 new mode 100644 index a8c8d6d9e8..a765ab39fa --- a/bin/hipconvertinplace.sh +++ b/bin/hipconvertinplace.sh @@ -1,18 +1,24 @@ #!/bin/bash -#usage : hipconvertinplace.sh [DIRNAME] [HIPIFY_OPTIONS] +#usage : hipconvertinplace.sh DIRNAME [hipify options] [--] [clang options] -#hipify "inplace" all code files in specified directory. +#hipify "inplace" all code files in specified directory. # This can be quite handy when dealing with an existing CUDA code base since the script # preserves the existing directory structure. -# For each code file, this script will: -# - If ".prehip file does not exist, copy the original code to a new file with extension ".prehip". Then Hipify the code file. -# - If ".prehip" file exists, this is used as input to hipify. -# (this is useful for testing improvements to the hipify toolset). - - SCRIPT_DIR=`dirname $0` SEARCH_DIR=$1 -shift -$SCRIPT_DIR/hipify -inplace -print-stats "$@" `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` + +hipify_args='' +while (( "$#" )); do + shift + if [ "$1" != "--" ]; then + hipify_args="$hipify_args $1" + else + shift + break + fi +done +clang_args="$@" + +$SCRIPT_DIR/hipify-clang -inplace -print-stats $hipify_args `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` -- -x cuda $clang_args diff --git a/bin/hipconvertinplace2.sh b/bin/hipconvertinplace2.sh deleted file mode 100644 index a765ab39fa..0000000000 --- a/bin/hipconvertinplace2.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -#usage : hipconvertinplace.sh DIRNAME [hipify options] [--] [clang options] - -#hipify "inplace" all code files in specified directory. -# This can be quite handy when dealing with an existing CUDA code base since the script -# preserves the existing directory structure. - -SCRIPT_DIR=`dirname $0` -SEARCH_DIR=$1 - -hipify_args='' -while (( "$#" )); do - shift - if [ "$1" != "--" ]; then - hipify_args="$hipify_args $1" - else - shift - break - fi -done -clang_args="$@" - -$SCRIPT_DIR/hipify-clang -inplace -print-stats $hipify_args `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` -- -x cuda $clang_args diff --git a/bin/hipexamine-perl.sh b/bin/hipexamine-perl.sh new file mode 100755 index 0000000000..40c1bf466d --- /dev/null +++ b/bin/hipexamine-perl.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +#usage : hipexamine.sh DIRNAME [hipify.pl options] + +# Generate HIP stats (LOC, CUDA->API conversions, missing functionality) for all the code files +# in the specified directory. + + +SCRIPT_DIR=`dirname $0` +SEARCH_DIR=$1 +shift +$SCRIPT_DIR/hipify -no-output -print-stats "$@" `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` diff --git a/bin/hipexamine.sh b/bin/hipexamine.sh old mode 100755 new mode 100644 index 40c1bf466d..2a6fab7110 --- a/bin/hipexamine.sh +++ b/bin/hipexamine.sh @@ -1,12 +1,22 @@ #!/bin/bash -#usage : hipexamine.sh DIRNAME [hipify.pl options] - -# Generate HIP stats (LOC, CUDA->API conversions, missing functionality) for all the code files -# in the specified directory. +#usage : hipexamine2.sh DIRNAME [hipify options] [--] [clang options] +# Generate CUDA->HIP conversion statistics for all the code files in the specified directory. SCRIPT_DIR=`dirname $0` SEARCH_DIR=$1 -shift -$SCRIPT_DIR/hipify -no-output -print-stats "$@" `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` + +hipify_args='' +while (( "$#" )); do + shift + if [ "$1" != "--" ]; then + hipify_args="$hipify_args $1" + else + shift + break + fi +done +clang_args="$@" + +$SCRIPT_DIR/hipify-clang -examine $hipify_args `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` -- -x cuda $clang_args diff --git a/bin/hipexamine2.sh b/bin/hipexamine2.sh deleted file mode 100644 index 2a6fab7110..0000000000 --- a/bin/hipexamine2.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -#usage : hipexamine2.sh DIRNAME [hipify options] [--] [clang options] - -# Generate CUDA->HIP conversion statistics for all the code files in the specified directory. - -SCRIPT_DIR=`dirname $0` -SEARCH_DIR=$1 - -hipify_args='' -while (( "$#" )); do - shift - if [ "$1" != "--" ]; then - hipify_args="$hipify_args $1" - else - shift - break - fi -done -clang_args="$@" - -$SCRIPT_DIR/hipify-clang -examine $hipify_args `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` -- -x cuda $clang_args