File: simd-dispatch

package info (click to toggle)
scrappie 1.4.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 61,724 kB
  • sloc: ansic: 114,526; python: 1,586; makefile: 160; sh: 122
file content (19 lines) | stat: -rwxr-xr-x 336 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

BASE=/usr/bin/scrappie

function test_and_run () {
	if grep -q "$1" /proc/cpuinfo && [ -x "${BASE}-$1" ]; then
		cmd="${BASE}-$1"
		shift
		# echo "${cmd}" "$@"
		"${cmd}" "$@"
		exit
	fi
}

for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 sse ; do test_and_run ${SIMD} "$@" ; done

# fallback to plain option
$BASE-plain "$@"