Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
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
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
Ben Sepanski
loopy
Commits
75842489
Commit
75842489
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Some missing NumpyDtype wrapping
parent
8efe8657
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/target/opencl.py
+8
-7
8 additions, 7 deletions
loopy/target/opencl.py
with
8 additions
and
7 deletions
loopy/target/opencl.py
+
8
−
7
View file @
75842489
...
...
@@ -113,7 +113,8 @@ def opencl_function_mangler(kernel, name, arg_dtypes):
return
None
if
name
in
[
"
max
"
,
"
min
"
]
and
len
(
arg_dtypes
)
==
2
:
dtype
=
np
.
find_common_type
([],
arg_dtypes
)
dtype
=
np
.
find_common_type
(
[],
[
dtype
.
numpy_dtype
for
dtype
in
arg_dtypes
])
if
dtype
.
kind
==
"
c
"
:
raise
RuntimeError
(
"
min/max do not support complex numbers
"
)
...
...
@@ -121,7 +122,7 @@ def opencl_function_mangler(kernel, name, arg_dtypes):
if
dtype
.
kind
==
"
f
"
:
name
=
"
f
"
+
name
return
dtype
,
name
return
NumpyType
(
dtype
)
,
name
if
name
in
"
atan2
"
and
len
(
arg_dtypes
)
==
2
:
return
arg_dtypes
[
0
],
name
...
...
@@ -140,16 +141,16 @@ def opencl_function_mangler(kernel, name, arg_dtypes):
def
opencl_symbol_mangler
(
kernel
,
name
):
# FIXME: should be more picky about exact names
if
name
.
startswith
(
"
FLT_
"
):
return
np
.
dtype
(
np
.
float32
),
name
return
NumpyType
(
np
.
dtype
(
np
.
float32
)
)
,
name
elif
name
.
startswith
(
"
DBL_
"
):
return
np
.
dtype
(
np
.
float64
),
name
return
NumpyType
(
np
.
dtype
(
np
.
float64
)
)
,
name
elif
name
.
startswith
(
"
M_
"
):
if
name
.
endswith
(
"
_F
"
):
return
np
.
dtype
(
np
.
float32
),
name
return
NumpyType
(
np
.
dtype
(
np
.
float32
)
)
,
name
else
:
return
np
.
dtype
(
np
.
float64
),
name
return
NumpyType
(
np
.
dtype
(
np
.
float64
)
)
,
name
elif
name
==
"
INFINITY
"
:
return
np
.
dtype
(
np
.
float32
),
name
return
NumpyType
(
np
.
dtype
(
np
.
float32
)
)
,
name
else
:
return
None
...
...
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