File: simd-dispatch

package info (click to toggle)
hyphy 2.5.47%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 27,404 kB
  • sloc: cpp: 79,973; xml: 467; lisp: 341; python: 156; javascript: 117; sh: 106; makefile: 86; 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