Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sumpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Andreas Klöckner
sumpy
Commits
8c6315f3
Commit
8c6315f3
authored
6 years ago
by
Isuru Fernando
Browse files
Options
Downloads
Patches
Plain Diff
Add different dims, orders for benchmarks
parent
9235bbd4
No related branches found
No related tags found
1 merge request
!81
Add benchmarks for translations
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/bench_translations.py
+77
-19
77 additions, 19 deletions
benchmarks/bench_translations.py
with
77 additions
and
19 deletions
benchmarks/bench_translations.py
+
77
−
19
View file @
8c6315f3
...
...
@@ -30,38 +30,39 @@ from sumpy.assignment_collection import SymbolicAssignmentCollection
from
sumpy.codegen
import
to_loopy_insns
class
Param
:
def
__init__
(
self
,
knl
,
local_expn_class
,
mpole_expn_class
):
self
.
knl
=
knl
self
.
local_expn_class
=
local_expn_class
self
.
mpole_expn_class
=
mpole_expn_class
def
__init__
(
self
,
dim
,
order
):
self
.
dim
=
dim
self
.
order
=
order
def
__repr__
(
self
):
return
"
{}
_{}
_{}
"
.
format
(
self
.
knl
,
self
.
local_expn_class
.
__name__
,
self
.
mpole_expn_class
.
__name__
)
return
"
{}
D_order
_{}
"
.
format
(
self
.
dim
,
self
.
order
)
class
TranslationSuite
:
class
Translation
Benchmark
Suite
:
params
=
[
Param
(
LaplaceKernel
(
2
),
VolumeTaylorLocalExpansion
,
VolumeTaylorMultipoleExpansion
),
Param
(
LaplaceKernel
(
2
),
LaplaceConformingVolumeTaylorLocalExpansion
,
LaplaceConformingVolumeTaylorMultipoleExpansion
),
Param
(
HelmholtzKernel
(
2
),
VolumeTaylorLocalExpansion
,
VolumeTaylorMultipoleExpansion
),
Param
(
HelmholtzKernel
(
2
),
HelmholtzConformingVolumeTaylorLocalExpansion
,
HelmholtzConformingVolumeTaylorMultipoleExpansion
),
Param
(
HelmholtzKernel
(
2
),
H2DLocalExpansion
,
H2DMultipoleExpansion
)
Param
(
2
,
10
),
Param
(
2
,
15
),
Param
(
2
,
20
),
Param
(
3
,
5
),
Param
(
3
,
10
),
]
param_names
=
[
'
translation
'
]
param_names
=
[
'
order
'
]
def
setup
(
self
,
param
):
logging
.
basicConfig
(
level
=
logging
.
INFO
)
self
.
ctx
=
cl
.
create_some_context
()
self
.
queue
=
cl
.
CommandQueue
(
self
.
ctx
)
np
.
random
.
seed
(
17
)
if
self
.
__class__
==
TranslationBenchmarkSuite
:
raise
NotImplementedError
mpole_expn_class
=
self
.
mpole_expn_class
if
param
.
order
==
3
and
H2DMultipoleExpansion
==
mpole_expn_class
:
raise
NotImplementedError
def
track_m2l_op_count
(
self
,
param
):
knl
=
param
.
knl
m_expn
=
param
.
mpole_expn_class
(
knl
,
order
=
3
)
l_expn
=
param
.
local_expn_class
(
knl
,
order
=
3
)
knl
=
self
.
knl
(
param
.
dim
)
m_expn
=
self
.
mpole_expn_class
(
knl
,
order
=
param
.
order
)
l_expn
=
self
.
local_expn_class
(
knl
,
order
=
param
.
order
)
src_coeff_exprs
=
[
sym
.
Symbol
(
"
src_coeff%d
"
%
i
)
for
i
in
range
(
len
(
m_expn
))]
...
...
@@ -80,3 +81,60 @@ class TranslationSuite:
return
sum
([
counter
.
rec
(
insn
.
expression
)
+
1
for
insn
in
insns
])
track_m2l_op_count
.
unit
=
"
ops
"
class
LaplaceVolumeTaylorTranslation
(
TranslationBenchmarkSuite
):
knl
=
LaplaceKernel
local_expn_class
=
VolumeTaylorLocalExpansion
mpole_expn_class
=
VolumeTaylorMultipoleExpansion
params
=
[
Param
(
2
,
10
),
Param
(
3
,
5
),
]
class
LaplaceConformingVolumeTaylorTranslation
(
TranslationBenchmarkSuite
):
knl
=
LaplaceKernel
local_expn_class
=
LaplaceConformingVolumeTaylorLocalExpansion
mpole_expn_class
=
LaplaceConformingVolumeTaylorMultipoleExpansion
params
=
[
Param
(
2
,
10
),
Param
(
2
,
15
),
Param
(
2
,
20
),
Param
(
3
,
5
),
]
class
HelmholtzVolumeTaylorTranslation
(
TranslationBenchmarkSuite
):
knl
=
HelmholtzKernel
local_expn_class
=
VolumeTaylorLocalExpansion
mpole_expn_class
=
VolumeTaylorMultipoleExpansion
params
=
[
Param
(
2
,
10
),
Param
(
3
,
5
),
]
class
HelmholtzConformingVolumeTaylorTranslation
(
TranslationBenchmarkSuite
):
knl
=
HelmholtzKernel
local_expn_class
=
HelmholtzConformingVolumeTaylorLocalExpansion
mpole_expn_class
=
HelmholtzConformingVolumeTaylorMultipoleExpansion
params
=
[
Param
(
2
,
10
),
Param
(
2
,
15
),
Param
(
2
,
20
),
Param
(
3
,
5
),
]
class
Helmholtz2DTranslation
(
TranslationBenchmarkSuite
):
knl
=
HelmholtzKernel
local_expn_class
=
H2DLocalExpansion
mpole_expn_class
=
H2DMultipoleExpansion
params
=
[
Param
(
2
,
10
),
Param
(
2
,
15
),
Param
(
2
,
20
),
]
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