compat/cuda/ptx2c: strip CR from each line

Windows nvcc + cl.exe produce a .ctx file with CR+LF newlines which
need to be stripped to work with gcc.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
pull/269/head
Ricardo Constantino 8 years ago committed by Timo Rothenpieler
parent 1ac03c8dc0
commit 7fbc082577
  1. 2
      compat/cuda/ptx2c.sh

@ -29,7 +29,7 @@ NAME="$(basename "$IN" | sed 's/\..*//')"
printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
while read LINE
do
printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed 's/["\\]/\\&/g')" >> "$OUT"
printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 's/["\\]/\\&/g')" >> "$OUT"
done < "$IN"
printf ";\n" >> "$OUT"

Loading…
Cancel
Save