File: simd-dispatch

package info (click to toggle)
hyphy 2.5.69%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,728 kB
  • sloc: cpp: 81,964; xml: 467; lisp: 341; python: 166; javascript: 117; sh: 106; makefile: 87; ansic: 86
file content (20 lines) | stat: -rwxr-xr-x 409 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

DIR=/usr/lib/hyphy/bin
EXE=${DIR}/$(basename "$0")
CMDARGS="$@"

test_and_run () {
        if lscpu | grep -q "$1" && [ -x "${EXE}-$1" ]; then
		echo "Using ${EXE}-$1" 1>&2
                "${EXE}-$1" "${CMDARGS}"
                exit
        fi
}


for SIMD in avx sse3 ; do test_and_run ${SIMD} ; done

# fallback to plain option
echo "Using $EXE without SIMD support"
"${EXE}" "${CMDARGS}" 1>&2