Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_pdata
Commits
93a19c82
Commit
93a19c82
authored
3 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Adding performance output
parent
acf16b0f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3971
failed
3 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example/Performance/miniBUDE/Makefile
+1
-1
1 addition, 1 deletion
example/Performance/miniBUDE/Makefile
example/Performance/miniBUDE/main.cu
+39
-26
39 additions, 26 deletions
example/Performance/miniBUDE/main.cu
with
40 additions
and
27 deletions
example/Performance/miniBUDE/Makefile
+
1
−
1
View file @
93a19c82
...
...
@@ -43,7 +43,7 @@ OBJ = main.o
miniBUDE
:
%.o
:
%.cu
$(
CUDA_CC
)
$(
CUDA_OPTIONS
)
$(
OPT
)
-g
-c
--std
=
c++14
-o
$@
$<
$(
INCLUDE_PATH_NVCC
)
$(
CUDA_CC
)
-Ofast
-march
=
native
-ffast-math
$(
CUDA_OPTIONS
)
$(
OPT
)
-c
--std
=
c++14
-o
$@
$<
$(
INCLUDE_PATH_NVCC
)
%.o
:
%.cpp
$(
CC
)
-O3
$(
OPT
)
-g
-c
--std
=
c++14
-o
$@
$<
$(
INCLUDE_PATH
)
...
...
This diff is collapsed.
Click to expand it.
example/Performance/miniBUDE/main.cu
+
39
−
26
View file @
93a19c82
...
...
@@ -11,6 +11,7 @@
#include
<sys/time.h>
#include
"Vector/map_vector.hpp"
#include
"util/stat/common_statistics.hpp"
//#define USE_SHARED
...
...
@@ -614,42 +615,54 @@ int main(int argc, char *argv[])
// We run the benchmark 30 times to get mean and variace
for
(
int
i
=
0
;
i
<
30
;
i
++
)
{
printf
(
"Iteration %d
\n
"
,
i
);
runCUDA
(
_openfpm
);
}
// calculate mean and variance
double
mean
;
double
dev
;
standard_deviation
(
_openfpm
.
gflops_data
,
mean
,
dev
);
printf
(
"
\n\n\n
Mean %f ~ %f GFlops/s
\n\n\n
"
,
mean
,
dev
);
FILE
*
perf_out
=
openFile
(
"./"
,
"performance_out"
,
"w"
,
NULL
);
char
out
[
256
];
sprintf
(
out
,
"%f %f"
,
mean
,
dev
);
fwrite
(
out
,
1
,
strlen
(
out
),
perf_out
);
fclose
(
perf_out
);
// Load reference results from file
FILE
*
ref_energies
=
openFile
(
params
.
deckDir
,
FILE_REF_ENERGIES
,
"r"
,
NULL
);
size_t
n_ref_poses
=
params
.
nposes
;
if
(
params
.
nposes
>
REF_NPOSES
)
{
printf
(
"Only validating the first %d poses.
\n
"
,
REF_NPOSES
);
n_ref_poses
=
REF_NPOSES
;
}
// Load reference results from file
FILE
*
ref_energies
=
openFile
(
params
.
deckDir
,
FILE_REF_ENERGIES
,
"r"
,
NULL
);
size_t
n_ref_poses
=
params
.
nposes
;
if
(
params
.
nposes
>
REF_NPOSES
)
{
printf
(
"Only validating the first %d poses.
\n
"
,
REF_NPOSES
);
n_ref_poses
=
REF_NPOSES
;
}
for
(
size_t
i
=
0
;
i
<
n_ref_poses
;
i
++
)
fscanf
(
ref_energies
,
"%f"
,
&
resultsRef
[
i
]);
for
(
size_t
i
=
0
;
i
<
n_ref_poses
;
i
++
)
fscanf
(
ref_energies
,
"%f"
,
&
resultsRef
[
i
]);
fclose
(
ref_energies
);
fclose
(
ref_energies
);
float
maxdiff
=
-
100.0
f
;
printf
(
"
\n
Reference CUDA (diff)
\n
"
);
for
(
int
i
=
0
;
i
<
n_ref_poses
;
i
++
)
{
if
(
fabs
(
resultsRef
[
i
])
<
1.
f
&&
fabs
(
_openfpm
.
d_results
.
template
get
<
0
>(
i
))
<
1.
f
)
continue
;
float
diff
=
fabs
(
resultsRef
[
i
]
-
_openfpm
.
d_results
.
template
get
<
0
>(
i
))
/
_openfpm
.
d_results
.
template
get
<
0
>(
i
);
if
(
diff
>
maxdiff
)
{
maxdiff
=
diff
;
// printf ("Maxdiff: %.2f (%.3f vs %.3f)\n", maxdiff, resultsRef[i], resultsCUDA[i]);
}
float
maxdiff
=
-
100.0
f
;
printf
(
"
\n
Reference CUDA (diff)
\n
"
);
for
(
int
i
=
0
;
i
<
n_ref_poses
;
i
++
)
{
if
(
fabs
(
resultsRef
[
i
])
<
1.
f
&&
fabs
(
_openfpm
.
d_results
.
template
get
<
0
>(
i
))
<
1.
f
)
continue
;
if
(
i
<
8
)
printf
(
"%7.2f vs %7.2f (%5.2f%%)
\n
"
,
resultsRef
[
i
],
_openfpm
.
d_results
.
template
get
<
0
>(
i
),
100
*
diff
);
float
diff
=
fabs
(
resultsRef
[
i
]
-
_openfpm
.
d_results
.
template
get
<
0
>(
i
))
/
_openfpm
.
d_results
.
template
get
<
0
>(
i
);
if
(
diff
>
maxdiff
)
{
maxdiff
=
diff
;
// printf ("Maxdiff: %.2f (%.3f vs %.3f)\n", maxdiff, resultsRef[i], resultsCUDA[i]);
}
printf
(
"
\n
Largest difference was %.3f%%
\n\n
"
,
maxdiff
*
100
);
free
(
resultsRef
);
if
(
i
<
8
)
printf
(
"%7.2f vs %7.2f (%5.2f%%)
\n
"
,
resultsRef
[
i
],
_openfpm
.
d_results
.
template
get
<
0
>(
i
),
100
*
diff
);
}
printf
(
"
\n
Largest difference was %.3f%%
\n\n
"
,
maxdiff
*
100
);
free
(
resultsRef
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment