Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencil_reco
Commits
a59323a1
Commit
a59323a1
authored
Jan 02, 2020
by
Stephan Seitz
Browse files
Avoid dependency on pycuda in crazy
parent
2b798ba4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pystencils_reco/_crazy_decorator.py
View file @
a59323a1
...
...
@@ -26,7 +26,6 @@ def crazy(function) -> pystencils_reco.AssignmentCollection:
# @disk_cache_no_fallback
@
functools
.
wraps
(
function
)
def
wrapper
(
*
args
,
**
kwargs
):
import
pycuda.gpuarray
# TODO(seitz): remove dependency
inspection
=
inspect
.
getfullargspec
(
function
)
arg_names
=
inspection
.
args
annotations
=
inspection
.
annotations
...
...
@@ -35,7 +34,7 @@ def crazy(function) -> pystencils_reco.AssignmentCollection:
if
is_array_like
(
a
)
else
a
for
i
,
a
in
enumerate
(
args
)}
compile_kwargs
=
{
k
:
create_field_from_array_like
(
str
(
k
),
a
,
annotations
.
get
(
k
,
None
))
if
(
hasattr
(
a
,
'__array__'
)
or
is
inst
ance
(
a
,
pycuda
.
gpuarray
.
GPUArray
))
and
if
(
hasattr
(
a
,
'__array__'
)
or
'GPUArray'
in
st
r
(
a
.
__class__
))
and
not
isinstance
(
a
,
sympy
.
Matrix
)
# noqa
else
a
for
(
k
,
a
)
in
kwargs
.
items
()}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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