File: simd-dispatch

package info (click to toggle)
mmseqs2 14-7e284%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 32,516 kB
  • sloc: cpp: 68,239; ansic: 6,548; sh: 2,631; makefile: 84; perl: 32
file content (18 lines) | stat: -rwxr-xr-x 333 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

BASE=/usr/bin/mmseqs

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 "$@"