Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lorenz Huedepohl
ftimings
Commits
1ec6f7b8
Commit
1ec6f7b8
authored
Mar 04, 2015
by
Lorenz Huedepohl
Browse files
Test program for perf counters
parent
49ec202c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
1ec6f7b8
...
...
@@ -55,7 +55,7 @@ ftimings_c_example_SOURCES = \
ftimings_c_example_LDADD
=
libftimings-@FTIMINGS_API_VERSION@-@FC@.la
ftimings_c_example_LINK
=
$(FCLINK)
-static
noinst_PROGRAMS
=
do_flops do_memory_transfer
noinst_PROGRAMS
=
do_flops do_memory_transfer
test_perf
do_flops_SOURCES
=
\
examples/do_flops.c
...
...
@@ -65,6 +65,10 @@ do_memory_transfer_SOURCES = \
examples/do_memory_transfer.c
do_memory_transfer_CPPFLAGS
=
-DTEST_DO_MEMORY_TRANSFER
test_perf_SOURCES
=
\
ftimings/perf_memory_counter.c
test_perf_CPPFLAGS
=
-DTEST_PERF
# other files to distribute
filesdir
=
$(datadir)
/@PACKAGE@-@FC@/examples
files_DATA
=
examples/example.F90
...
...
ftimings/perf_memory_counter.c
View file @
1ec6f7b8
...
...
@@ -160,6 +160,7 @@ void ftimings_perf_memory_counters(int64_t *reads, int64_t *writes) {
#ifdef TEST_PERF
#include
<assert.h>
#define mebi (1024L * 1024L)
#define N (512L * mebi / sizeof(int))
volatile
int
mem
[
N
];
...
...
@@ -168,7 +169,7 @@ int main() {
int
i
,
j
;
int64_t
count_reads
,
count_writes
;
ftimings_perf_memory_counters_init
();
assert
(
ftimings_perf_memory_counters_init
()
)
;
ftimings_perf_memory_counters
(
&
count_reads
,
&
count_writes
);
printf
(
"Read %"
PRId64
" MiB (%"
PRId64
" bytes),
\t
wrote %"
PRId64
" MiB (%"
PRId64
" bytes) from RAM
\n
"
,
count_reads
/
mebi
,
count_reads
,
count_writes
/
mebi
,
count_writes
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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