Skip to content

Commit 3e8232d

Browse files
authored
Merge pull request ComputationalRadiationPhysics#1672 from psychocoderHPC/topic-disallowGlobalKeyWord
checker script for `__global__` keyword
2 parents 80a04c2 + b49c0ff commit 3e8232d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/hasCudaGlobalKeyword

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2016 Rene Widera
2+
#
3+
# This file is part of PIConGPU.
4+
#
5+
# PIConGPU is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# PIConGPU is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with PIConGPU.
17+
# If not, see <http://www.gnu.org/licenses/>.
18+
#
19+
20+
# search recursive inside a folder if the keyword `__global__` is used
21+
# @param $1 path to the folder
22+
# @result 0 if keyword is not found else 1
23+
24+
folderName=$1
25+
result=`grep -rn "__global__" $folderName`
26+
if [ $? -eq 0 ] ; then
27+
echo "Not allowed keyword __global__ found in the following files:" >&2
28+
echo "$result" | cut -f1-2 -d":" >&2
29+
exit 1
30+
fi
31+
exit 0

0 commit comments

Comments
 (0)