File tree Expand file tree Collapse file tree 11 files changed +64
-4
lines changed Expand file tree Collapse file tree 11 files changed +64
-4
lines changed Original file line number Diff line number Diff line change @@ -184,12 +184,18 @@ if (NOT HIPIFY_CLANG_TESTS_ONLY)
184
184
PATTERN "hipify-perl"
185
185
PATTERN "*.sh"
186
186
PATTERN "findcode.sh" EXCLUDE
187
+ PATTERN "findcode_headers.sh" EXCLUDE
188
+ PATTERN "findcode_sources.sh" EXCLUDE
189
+ PATTERN "findcode_custom.sh" EXCLUDE
187
190
PATTERN "finduncodep.sh" EXCLUDE )
188
191
189
192
set (HIPIFY_LIBEXEC_INSTALL_PATH "${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_LIBEXECDIR} /hipify" )
190
193
191
194
install (
192
195
PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} /bin/findcode.sh
196
+ PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} /bin/findcode_headers.sh
197
+ PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} /bin/findcode_sources.sh
198
+ PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} /bin/findcode_custom.sh
193
199
PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} /bin/finduncodep.sh
194
200
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR} /hipify )
195
201
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ find $SEARCH_DIRS -name '*.cu' -o -name '*.CU'
6
6
find $SEARCH_DIRS -name ' *.cpp' -o -name ' *.cxx' -o -name ' *.c' -o -name ' *.cc'
7
7
find $SEARCH_DIRS -name ' *.CPP' -o -name ' *.CXX' -o -name ' *.C' -o -name ' *.CC'
8
8
find $SEARCH_DIRS -name ' *.cuh' -o -name ' *.CUH'
9
- find $SEARCH_DIRS -name ' *.h' -o -name ' *.hpp' -o -name ' *.inc' -o -name ' *.inl' -o -name ' *.hxx' -o -name ' *.hdl'
10
- find $SEARCH_DIRS -name ' *.H' -o -name ' *.HPP' -o -name ' *.INC' -o -name ' *.INL' -o -name ' *.HXX' -o -name ' *.HDL'
9
+ find $SEARCH_DIRS -name ' *.h' -o -name ' *.hpp' -o -name ' *.hh ' -o -name ' *. inc' -o -name ' *.inl' -o -name ' *.hxx' -o -name ' *.hdl'
10
+ find $SEARCH_DIRS -name ' *.H' -o -name ' *.HPP' -o -name ' *.HH ' -o -name ' *. INC' -o -name ' *.INL' -o -name ' *.HXX' -o -name ' *.HDL'
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ SEARCH_DIRS=$@
4
+
5
+ find $SEARCH_DIRS -name ' *.cu' -and -not -name ' *.cuh'
6
+ find $SEARCH_DIRS -name ' *.CU' -and -not -name ' *.CUH'
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ SEARCH_DIRS=$@
4
+
5
+ find $SEARCH_DIRS -name ' *.cuh' -o -name ' *.CUH'
6
+ find $SEARCH_DIRS -name ' *.h' -o -name ' *.hpp' -o -name ' *.hh' -o -name ' *.inc' -o -name ' *.inl' -o -name ' *.hxx' -o -name ' *.hdl'
7
+ find $SEARCH_DIRS -name ' *.H' -o -name ' *.HPP' -o -name ' *.HH' -o -name ' *.INC' -o -name ' *.INL' -o -name ' *.HXX' -o -name ' *.HDL'
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ SEARCH_DIRS=$@
4
+
5
+ find $SEARCH_DIRS -name ' *.cu' -and -not -name ' *.cuh'
6
+ find $SEARCH_DIRS -name ' *.CU' -and -not -name ' *.CUH'
7
+ find $SEARCH_DIRS -name ' *.cpp' -o -name ' *.cxx' -o -name ' *.c' -o -name ' *.cc'
8
+ find $SEARCH_DIRS -name ' *.CPP' -o -name ' *.CXX' -o -name ' *.C' -o -name ' *.CC'
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # usage : hipconvertinplace-perl.sh DIRNAME [hipify-perl options]
3
+ # usage : hipconvertinplace-perl.sh DIRNAME [-filter=all|headers|sources|custom] [ hipify-perl options]
4
4
5
5
# hipify "inplace" all code files in specified directory.
6
6
# This can be quite handy when dealing with an existing CUDA code base since the script
12
12
# (this is useful for testing improvements to the hipify-perl toolset).
13
13
14
14
SCRIPT_DIR=" $( dirname " $( realpath " $0 " ) " ) "
15
+ SCRIPT_NAME=findcode.sh
15
16
PRIV_SCRIPT_DIR=" $SCRIPT_DIR /../libexec/hipify"
16
17
SEARCH_DIR=$1
18
+ if [ " $2 " = " -filter=all" ]
19
+ then
17
20
shift
18
- $SCRIPT_DIR /hipify-perl -inplace -print-stats " $@ " ` $PRIV_SCRIPT_DIR /findcode.sh $SEARCH_DIR `
21
+ elif [ " $2 " = " -filter=headers" ]
22
+ then
23
+ SCRIPT_NAME=findcode_headers.sh
24
+ shift
25
+ elif [ " $2 " = " -filter=sources" ]
26
+ then
27
+ SCRIPT_NAME=findcode_sources.sh
28
+ shift
29
+ elif [ " $2 " = " -filter=custom" ]
30
+ then
31
+ SCRIPT_NANE=findcode_custom.sh
32
+ shift
33
+ fi
34
+ shift
35
+
36
+ $SCRIPT_DIR /hipify-perl -inplace -print-stats " $@ " ` $PRIV_SCRIPT_DIR /$SCRIPT_NAME $SEARCH_DIR `
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ case "$1" in
19
19
ln -r -s -f @HIPBINDIR@/hipexamine-perl.sh @ROCMBINDIR@/hipexamine-perl.sh
20
20
ln -r -s -f @HIPBINDIR@/hipexamine.sh @ROCMBINDIR@/hipexamine.sh
21
21
ln -r -s -f @HIPBINDIR@/findcode.sh @ROCMBINDIR@/findcode.sh
22
+ ln -r -s -f @HIPBINDIR@/findcode_headers.sh @ROCMBINDIR@/findcode_headers.sh
23
+ ln -r -s -f @HIPBINDIR@/findcode_sources.sh @ROCMBINDIR@/findcode_sources.sh
24
+ ln -r -s -f @HIPBINDIR@/findcode_custom.sh @ROCMBINDIR@/findcode_custom.sh
22
25
ln -r -s -f @HIPBINDIR@/finduncodep.sh @ROCMBINDIR@/finduncodep.sh
23
26
cd $CURRENTDIR
24
27
;;
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ case "$1" in
17
17
rm -f @ROCMBINDIR@/hipexamine-perl.sh
18
18
rm -f @ROCMBINDIR@/hipexamine.sh
19
19
rm -f @ROCMBINDIR@/findcode.sh
20
+ rm -f @ROCMBINDIR@/findcode_headers.sh
21
+ rm -f @ROCMBINDIR@/findcode_sources.sh
22
+ rm -f @ROCMBINDIR@/findcode_custom.sh
20
23
rm -f @ROCMBINDIR@/finduncodep.sh
21
24
rmdir --ignore-fail-on-non-empty @ROCMBINDIR@
22
25
;;
Original file line number Diff line number Diff line change @@ -10,5 +10,8 @@ ln -r -s -f @HIPBINDIR@/hipconvertinplace.sh @ROCMBINDIR@/hipconvertinplace.sh
10
10
ln -r -s -f @HIPBINDIR@/hipexamine-perl.sh @ROCMBINDIR@/hipexamine-perl.sh
11
11
ln -r -s -f @HIPBINDIR@/hipexamine.sh @ROCMBINDIR@/hipexamine.sh
12
12
ln -r -s -f @HIPBINDIR@/findcode.sh @ROCMBINDIR@/findcode.sh
13
+ ln -r -s -f @HIPBINDIR@/findcode_headers.sh @ROCMBINDIR@/findcode_headers.sh
14
+ ln -r -s -f @HIPBINDIR@/findcode_sources.sh @ROCMBINDIR@/findcode_sources.sh
15
+ ln -r -s -f @HIPBINDIR@/findcode_custom.sh @ROCMBINDIR@/findcode_custom.sh
13
16
ln -r -s -f @HIPBINDIR@/finduncodep.sh @ROCMBINDIR@/finduncodep.sh
14
17
cd $CURRENTDIR
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ if [ $1 -le 1 ]; then
7
7
rm -f @ROCMBINDIR@/hipexamine-perl.sh
8
8
rm -f @ROCMBINDIR@/hipexamine.sh
9
9
rm -f @ROCMBINDIR@/findcode.sh
10
+ rm -f @ROCMBINDIR@/findcode_headers.sh
11
+ rm -f @ROCMBINDIR@/findcode_sources.sh
12
+ rm -f @ROCMBINDIR@/findcode_custom.sh
10
13
rm -f @ROCMBINDIR@/finduncodep.sh
11
14
rmdir --ignore-fail-on-non-empty @ROCMBINDIR@
12
15
rmdir --ignore-fail-on-non-empty @HIPBINDIR@
You can’t perform that action at this time.
0 commit comments