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
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
Alexandru Fikl
sumpy
Commits
281a67fa
Commit
281a67fa
authored
10 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into h-2d
Conflicts: sumpy/expansion/__init__.py
parents
83388ffb
67d606d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sumpy/codegen.py
+10
-2
10 additions, 2 deletions
sumpy/codegen.py
sumpy/expansion/__init__.py
+11
-1
11 additions, 1 deletion
sumpy/expansion/__init__.py
with
21 additions
and
3 deletions
sumpy/codegen.py
+
10
−
2
View file @
281a67fa
...
...
@@ -109,7 +109,11 @@ hank1_01_result hank1_01(cdouble_t z)
"""
def
bessel_preamble_generator
(
seen_dtypes
,
seen_functions
):
def
bessel_preamble_generator
(
target
,
seen_dtypes
,
seen_functions
):
from
loopy.target.pyopencl
import
PyOpenCLTarget
if
not
isinstance
(
target
,
PyOpenCLTarget
):
raise
NotImplementedError
(
"
Only the PyOpenCLTarget is supported as of now
"
)
require_bessel
=
False
if
any
(
func
.
name
==
"
hank1_01
"
for
func
in
seen_functions
):
yield
(
"
50-sumpy-hankel
"
,
HANKEL_PREAMBLE
)
...
...
@@ -125,13 +129,17 @@ hank1_01_result_dtype = cl.tools.get_or_register_dtype("hank1_01_result",
)
def
bessel_mangler
(
identifier
,
arg_dtypes
):
def
bessel_mangler
(
target
,
identifier
,
arg_dtypes
):
"""
A function
"
mangler
"
to make Bessel functions
digestible for :mod:`loopy`.
See argument *function_manglers* to :func:`loopy.make_kernel`.
"""
from
loopy.target.pyopencl
import
PyOpenCLTarget
if
not
isinstance
(
target
,
PyOpenCLTarget
):
raise
NotImplementedError
(
"
Only the PyOpenCLTarget is supported as of now
"
)
if
identifier
==
"
hank1_01
"
:
return
(
np
.
dtype
(
hank1_01_result_dtype
),
identifier
,
(
np
.
dtype
(
np
.
complex128
),))
...
...
This diff is collapsed.
Click to expand it.
sumpy/expansion/__init__.py
+
11
−
1
View file @
281a67fa
...
...
@@ -67,14 +67,24 @@ class ExpansionBase(object):
return
len
(
self
.
get_coefficient_identifiers
())
def
coefficients_from_source
(
self
,
avec
,
bvec
):
"""
"""
Form an expansion from a source point.
:arg avec: vector from source to center.
:arg bvec: vector from center to target. Not usually necessary,
except for line-Taylor expansion.
:returns: a list of :mod:`sympy` expressions representing
the coefficients of the expansion.
"""
raise
NotImplementedError
def
evaluate
(
self
,
coeffs
,
bvec
):
"""
:return: a :mod:`sympy` expression corresponding
to the evaluated expansion with the coefficients
in *coeffs*.
"""
raise
NotImplementedError
def
update_persistent_hash
(
self
,
key_hash
,
key_builder
):
...
...
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