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
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
loopy
Commits
400b1c92
Commit
400b1c92
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Fix reduction library for new mangler/preamble generator interface
parent
bcedf75d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/library/reduction.py
+6
-6
6 additions, 6 deletions
loopy/library/reduction.py
with
6 additions
and
6 deletions
loopy/library/reduction.py
+
6
−
6
View file @
400b1c92
...
...
@@ -300,27 +300,27 @@ def parse_reduction_op(name):
# }}}
def
reduction_function_mangler
(
target
,
func_id
,
arg_dtypes
):
def
reduction_function_mangler
(
kernel
,
func_id
,
arg_dtypes
):
if
isinstance
(
func_id
,
ArgExtFunction
):
from
loopy.target.opencl
import
OpenCLTarget
if
not
isinstance
(
target
,
OpenCLTarget
):
if
not
isinstance
(
kernel
.
target
,
OpenCLTarget
):
raise
LoopyError
(
"
only OpenCL supported for now
"
)
op
=
func_id
.
reduction_op
return
(
op
.
result_dtype
(
target
,
func_id
.
scalar_dtype
,
func_id
.
inames
),
return
(
op
.
result_dtype
(
kernel
.
target
,
func_id
.
scalar_dtype
,
func_id
.
inames
),
"
%s_%s
"
%
(
op
.
prefix
(
func_id
.
scalar_dtype
),
func_id
.
name
))
return
None
def
reduction_preamble_generator
(
target
,
seen_dtypes
,
seen_functions
):
def
reduction_preamble_generator
(
kernel
,
seen_dtypes
,
seen_functions
):
from
loopy.target.opencl
import
OpenCLTarget
for
func
in
seen_functions
:
if
isinstance
(
func
.
name
,
ArgExtFunction
):
if
not
isinstance
(
target
,
OpenCLTarget
):
if
not
isinstance
(
kernel
.
target
,
OpenCLTarget
):
raise
LoopyError
(
"
only OpenCL supported for now
"
)
yield
get_argext_preamble
(
target
,
func
.
name
)
yield
get_argext_preamble
(
kernel
.
target
,
func
.
name
)
# vim: fdm=marker
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