Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
GRASLAND Hadrien
Fast5x5
Commits
7b7f8020
Commit
7b7f8020
authored
Apr 20, 2018
by
GRASLAND Hadrien
Browse files
Replace racey process substitution with a simpler stderr/stdout swap
parent
295cafdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
benchmark/benchmark.sh
benchmark/benchmark.sh
+14
-3
measure_perf.sh
measure_perf.sh
+10
-2
No files found.
benchmark/benchmark.sh
View file @
7b7f8020
...
...
@@ -14,21 +14,32 @@ for size in $(seq 3 8); do
echo
-e
"
\t
Simple"
g++ gemm_simple.cpp
-DSIZE
=
$size
-O3
-march
=
native
for
i
in
$(
seq
1
${
REPEAT
}
)
;
do
${
TIME
}
-f
"%U, "
./a.out 2>
>(
tr
-d
'\n'
|
tee
-a
${
FILE
}
_simple.res
)
&&
echo
# GNU time produces its data on stderr, and we want to post-process it.
# But bash's pipe operator only works on stdout. So we need to swap
# stdout and stderr first.
/usr/bin/time
-f
"%U, "
./a.out 3>&1 1>&2 2>&3 3>&-
\
|
tr
-d
'\n'
|
tee
-a
${
FILE
}
_simple.res
\
&&
echo
done
echo
>>
${
FILE
}
_simple.res
echo
-e
"
\t
Eigen"
g++ gemm_eigen.cpp
-DSIZE
=
$size
-O3
-march
=
native
for
i
in
$(
seq
1
${
REPEAT
}
)
;
do
${
TIME
}
-f
"%U, "
./a.out 2>
>(
tr
-d
'\n'
|
tee
-a
${
FILE
}
_eigen.res
)
&&
echo
# Same as above, only targeting a different file
/usr/bin/time
-f
"%U, "
./a.out 3>&1 1>&2 2>&3 3>&-
\
|
tr
-d
'\n'
|
tee
-a
${
FILE
}
_eigen.res
\
&&
echo
done
echo
>>
${
FILE
}
_eigen.res
echo
-e
"
\t
Custom"
g++ gemm_custom.cpp
-DSIZE
=
$size
-O3
-march
=
native
for
i
in
$(
seq
1
${
REPEAT
}
)
;
do
${
TIME
}
-f
"%U, "
./a.out 2>
>(
tr
-d
'\n'
|
tee
-a
${
FILE
}
_custom.res
)
&&
echo
# Same as above, only targeting a different file
/usr/bin/time
-f
"%U, "
./a.out 3>&1 1>&2 2>&3 3>&-
\
|
tr
-d
'\n'
|
tee
-a
${
FILE
}
_custom.res
\
&&
echo
done
echo
>>
${
FILE
}
_custom.res
...
...
measure_perf.sh
View file @
7b7f8020
...
...
@@ -10,13 +10,21 @@ rm -f eigen_${FILE}
for
size
in
$(
seq
3 8
)
;
do
g++ matrix_product_custom.cpp
-DSIZE
=
$size
-O3
-march
=
native
for
i
in
$(
seq
1
${
REPEAT
}
)
;
do
/usr/bin/time
-f
"%U, "
./a.out 2>
>(
tr
-d
'\n'
|
tee
-a
custom_
${
FILE
}
)
&&
echo
# GNU time produces its data on stderr, and we want to post-process it.
# But bash's pipe operator only works on stdout. So we need to swap
# stdout and stderr first.
/usr/bin/time
-f
"%U, "
./a.out 3>&1 1>&2 2>&3 3>&-
\
|
tr
-d
'\n'
|
tee
-a
custom_
${
FILE
}
\
&&
echo
done
echo
>>
custom_
${
FILE
}
g++ matrix_product_eigen.cpp
-DSIZE
=
$size
-O3
-march
=
native
for
i
in
$(
seq
1
${
REPEAT
}
)
;
do
/usr/bin/time
-f
"%U, "
./a.out 2>
>(
tr
-d
'\n'
|
tee
-a
eigen_
${
FILE
}
)
&&
echo
# Same as above, only targeting a different file
/usr/bin/time
-f
"%U, "
./a.out 3>&1 1>&2 2>&3 3>&-
\
|
tr
-d
'\n'
|
tee
-a
eigen_
${
FILE
}
\
&&
echo
done
echo
>>
eigen_
${
FILE
}
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment