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
47600995
Commit
47600995
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Don't count (-1) * as a flop
parent
f74a2af1
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/statistics.py
+17
-1
17 additions, 1 deletion
loopy/statistics.py
with
17 additions
and
1 deletion
loopy/statistics.py
+
17
−
1
View file @
47600995
...
...
@@ -126,7 +126,23 @@ class ExpressionOpCounter(CombineMapper):
else
:
return
ToCountMap
()
map_product
=
map_sum
def
map_product
(
self
,
expr
):
from
pymbolic.primitives
import
is_zero
if
expr
.
children
:
return
ToCountMap
(
{
self
.
type_inf
(
expr
):
len
(
expr
.
children
)
-
1
}
)
+
sum
(
self
.
rec
(
child
)
for
child
in
expr
.
children
# Do not count '(-1)* ' (as produced by
# subtraction in pymbolic): Assume this
# gets implemented as a sign flip or
# as subtraction. (Confirmed to be true on
# at least Nvidia 352.30.)
if
not
is_zero
(
child
-
1
))
else
:
return
ToCountMap
()
def
map_quotient
(
self
,
expr
,
*
args
):
return
ToCountMap
({
self
.
type_inf
(
expr
):
1
})
\
...
...
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