Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
llvm
Hercules
Merge requests
!200
Rodinia benches
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Rodinia benches
rodinia_benches
into
main
Overview
2
Commits
5
Pipelines
4
Changes
5
Merged
rarbore2
requested to merge
rodinia_benches
into
main
3 weeks ago
Overview
2
Commits
5
Pipelines
4
Changes
5
Expand
Set up benches for rodinia samples.
Edited
3 weeks ago
by
rarbore2
0
0
Merge request reports
Viewing commit
5f96afc7
Prev
Next
Show latest version
5 files
+
378
−
234
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
5f96afc7
cfd bench
· 5f96afc7
Russel Arbore
authored
3 weeks ago
juno_samples/rodinia/cfd/benches/cfd_bench.rs
0 → 100644
+
130
−
0
Options
#![feature(concat_idents)]
use
criterion
::{
criterion_group
,
criterion_main
,
Criterion
};
use
hercules_rt
::{
runner
,
HerculesImmBox
,
HerculesImmBoxTo
,
HerculesMutBox
,
HerculesMutBoxTo
};
juno_build
::
juno!
(
"euler"
);
juno_build
::
juno!
(
"pre_euler"
);
use
juno_cfd
::
*
;
fn
cfd_bench
(
c
:
&
mut
Criterion
)
{
let
mut
group
=
c
.benchmark_group
(
"cfd bench"
);
let
mut
r
=
runner!
(
euler
);
let
data_file
=
"data/fvcorr.domn.097K"
.to_string
();
let
iterations
=
1
;
let
block_size
=
16
;
let
FarFieldConditions
{
ff_variable
,
ff_fc_momentum_x
,
ff_fc_momentum_y
,
ff_fc_momentum_z
,
ff_fc_density_energy
,
}
=
set_far_field_conditions
();
let
GeometryData
{
nelr
,
areas
,
elements_surrounding_elements
,
normals
,
}
=
read_domain_geometry
(
data_file
,
block_size
);
let
mut
variables
=
initialize_variables
(
nelr
,
ff_variable
.as_slice
());
let
mut
variables
=
HerculesMutBox
::
from
(
variables
.as_mut_slice
());
let
areas
=
HerculesImmBox
::
from
(
areas
.as_slice
());
let
elements_surrounding_elements
=
HerculesImmBox
::
from
(
elements_surrounding_elements
.as_slice
());
let
normals
=
HerculesImmBox
::
from
(
normals
.as_slice
());
let
ff_variable
=
HerculesImmBox
::
from
(
ff_variable
.as_slice
());
let
ff_fc_density_energy
=
vec!
[
ff_fc_density_energy
.x
,
ff_fc_density_energy
.y
,
ff_fc_density_energy
.z
,
];
let
ff_fc_density_energy
=
HerculesImmBox
::
from
(
ff_fc_density_energy
.as_slice
());
let
ff_fc_momentum_x
=
vec!
[
ff_fc_momentum_x
.x
,
ff_fc_momentum_x
.y
,
ff_fc_momentum_x
.z
];
let
ff_fc_momentum_x
=
HerculesImmBox
::
from
(
ff_fc_momentum_x
.as_slice
());
let
ff_fc_momentum_y
=
vec!
[
ff_fc_momentum_y
.x
,
ff_fc_momentum_y
.y
,
ff_fc_momentum_y
.z
];
let
ff_fc_momentum_y
=
HerculesImmBox
::
from
(
ff_fc_momentum_y
.as_slice
());
let
ff_fc_momentum_z
=
vec!
[
ff_fc_momentum_z
.x
,
ff_fc_momentum_z
.y
,
ff_fc_momentum_z
.z
];
let
ff_fc_momentum_z
=
HerculesImmBox
::
from
(
ff_fc_momentum_z
.as_slice
());
group
.bench_function
(
"cfd bench euler"
,
|
b
|
{
b
.iter
(||
{
async_std
::
task
::
block_on
(
async
{
r
.run
(
nelr
as
u64
,
iterations
as
u64
,
variables
.to
(),
areas
.to
(),
elements_surrounding_elements
.to
(),
normals
.to
(),
ff_variable
.to
(),
ff_fc_density_energy
.to
(),
ff_fc_momentum_x
.to
(),
ff_fc_momentum_y
.to
(),
ff_fc_momentum_z
.to
(),
)
.await
});
})
});
let
mut
r
=
runner!
(
pre_euler
);
let
data_file
=
"data/fvcorr.domn.097K"
.to_string
();
let
iterations
=
1
;
let
block_size
=
16
;
let
FarFieldConditions
{
ff_variable
,
ff_fc_momentum_x
,
ff_fc_momentum_y
,
ff_fc_momentum_z
,
ff_fc_density_energy
,
}
=
set_far_field_conditions
();
let
GeometryData
{
nelr
,
areas
,
elements_surrounding_elements
,
normals
,
}
=
read_domain_geometry
(
data_file
,
block_size
);
let
mut
variables
=
initialize_variables
(
nelr
,
ff_variable
.as_slice
());
let
mut
variables
=
HerculesMutBox
::
from
(
variables
.as_mut_slice
());
let
areas
=
HerculesImmBox
::
from
(
areas
.as_slice
());
let
elements_surrounding_elements
=
HerculesImmBox
::
from
(
elements_surrounding_elements
.as_slice
());
let
normals
=
HerculesImmBox
::
from
(
normals
.as_slice
());
let
ff_variable
=
HerculesImmBox
::
from
(
ff_variable
.as_slice
());
let
ff_fc_density_energy
=
vec!
[
ff_fc_density_energy
.x
,
ff_fc_density_energy
.y
,
ff_fc_density_energy
.z
,
];
let
ff_fc_density_energy
=
HerculesImmBox
::
from
(
ff_fc_density_energy
.as_slice
());
let
ff_fc_momentum_x
=
vec!
[
ff_fc_momentum_x
.x
,
ff_fc_momentum_x
.y
,
ff_fc_momentum_x
.z
];
let
ff_fc_momentum_x
=
HerculesImmBox
::
from
(
ff_fc_momentum_x
.as_slice
());
let
ff_fc_momentum_y
=
vec!
[
ff_fc_momentum_y
.x
,
ff_fc_momentum_y
.y
,
ff_fc_momentum_y
.z
];
let
ff_fc_momentum_y
=
HerculesImmBox
::
from
(
ff_fc_momentum_y
.as_slice
());
let
ff_fc_momentum_z
=
vec!
[
ff_fc_momentum_z
.x
,
ff_fc_momentum_z
.y
,
ff_fc_momentum_z
.z
];
let
ff_fc_momentum_z
=
HerculesImmBox
::
from
(
ff_fc_momentum_z
.as_slice
());
group
.bench_function
(
"cfd bench pre-euler"
,
|
b
|
{
b
.iter
(||
{
async_std
::
task
::
block_on
(
async
{
r
.run
(
nelr
as
u64
,
iterations
as
u64
,
variables
.to
(),
areas
.to
(),
elements_surrounding_elements
.to
(),
normals
.to
(),
ff_variable
.to
(),
ff_fc_density_energy
.to
(),
ff_fc_momentum_x
.to
(),
ff_fc_momentum_y
.to
(),
ff_fc_momentum_z
.to
(),
)
.await
});
})
});
}
criterion_group!
(
benches
,
cfd_bench
);
criterion_main!
(
benches
);
Loading