#!/bin/sh -ef
# NAME=Memory benchmark: STREAM
# DESCRIPTION=The STREAM benchmark is a simple synthetic benchmark program that measures sustainable memory bandwidth (in MiB/s) and the corresponding computation rate for simple vector kernels. A version written in C language and optimized for single processor systems is used.
# DESTROYS_HDD=false
# IS_INTERACTIVE=false
# POWEROFF_DURING_TEST=false
# VERSION=0.1
# TAGS=benchmark,ram,memory
# DEPENDS=Memory

. _inq-config-global; . $SHARE_DIR/functions-test

# As STREAM benchmark is rather fast, we will easily run it several
# times. Results won't diverge meaningfully.

echo -n "Copy operation..."
benchmark_submit_float "Memory Copy operation" `stream-mem | grep "^Copy" | \
	awk '{print $2}'` "MiB/sec"
echo_success
test_progress 1 4

echo -n "Scale operation..."
benchmark_submit_float "Memory Scale operation" `stream-mem | grep "^Scale" | \
	awk '{print $2}'` "MiB/sec"
echo_success
test_progress 2 4

echo -n "Add operation..."
benchmark_submit_float "Memory Add operation" `stream-mem | grep "^Add" | \
	awk '{print $2}'` "MiB/sec"
echo_success
test_progress 3 4

echo -n "Triad operation..."
benchmark_submit_float "Memory Triad operation" `stream-mem | grep "^Triad" | \
	awk '{print $2}'` "MiB/sec"
echo_success
test_progress 4 4

test_succeeded
