Skip to content

Commit

Permalink
move cuda2hip.sh into dev_tools/scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Nov 14, 2019
1 parent 59ffd0e commit 81eddb7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cuda2hip.sh → dev_tools/scripts/cuda2hip.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

HIPIFY=/opt/rocm/hip/bin/hipify-perl

if [ "$0" != "dev_tools/scripts/cuda2hip.sh" ]; then
echo "Only allow to run dev_tools/scripts/cuda2hip.sh at ginkgo source folder."
exit 1
fi

if [ -z "$1" ]; then
echo "Usage: $0 path/to/cuda/file"
exit 2
fi

ORIGIN_FILE=$1
echo "CUDA: ${ORIGIN_FILE}"
NEW_FILE=$(echo ${ORIGIN_FILE} | sed -E "s/^cuda/hip/g;s/(cuh|hpp)$/hip\.hpp/g;s/(cpp|cu)$/hip\.cpp/g")
Expand Down

0 comments on commit 81eddb7

Please sign in to comment.