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
Kaushik Kulkarni
loopy
Commits
f8cf6fcf
Commit
f8cf6fcf
authored
7 years ago
by
James Stevens
Browse files
Options
Downloads
Patches
Plain Diff
added CountGranularity.ALL to list all granularities
parent
c44ebfd0
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/statistics.py
+9
-17
9 additions, 17 deletions
loopy/statistics.py
with
9 additions
and
17 deletions
loopy/statistics.py
+
9
−
17
View file @
f8cf6fcf
...
...
@@ -478,9 +478,11 @@ class CountGranularity:
once per *work-group*.
"""
WORKITEM
=
"
workitem
"
SUBGROUP
=
"
subgroup
"
WORKGROUP
=
"
workgroup
"
ALL
=
[
WORKITEM
,
SUBGROUP
,
WORKGROUP
]
# {{{ Op descriptor
...
...
@@ -511,16 +513,11 @@ class Op(Record):
"""
count_granularity_options
=
[
CountGranularity
.
WORKITEM
,
CountGranularity
.
SUBGROUP
,
CountGranularity
.
WORKGROUP
,
None
]
def
__init__
(
self
,
dtype
=
None
,
name
=
None
,
count_granularity
=
None
):
if
count_granularity
not
in
self
.
c
ount
_g
ranularity
_options
:
raise
ValueError
(
"
Op.__init__: count_granularity
'
%s
'
is
"
if
count_granularity
not
in
C
ount
G
ranularity
.
ALL
+
[
None
]
:
raise
ValueError
(
"
Op.__init__: count_granularity
'
%s
'
is
"
"
not allowed. count_granularity options: %s
"
%
(
count_granularity
,
self
.
c
ount
_g
ranularity
_options
))
%
(
count_granularity
,
C
ount
G
ranularity
.
ALL
+
[
None
]
))
if
dtype
is
None
:
Record
.
__init__
(
self
,
dtype
=
dtype
,
name
=
name
,
count_granularity
=
count_granularity
)
...
...
@@ -582,11 +579,6 @@ class MemAccess(Record):
"""
count_granularity_options
=
[
CountGranularity
.
WORKITEM
,
CountGranularity
.
SUBGROUP
,
CountGranularity
.
WORKGROUP
,
None
]
def
__init__
(
self
,
mtype
=
None
,
dtype
=
None
,
stride
=
None
,
direction
=
None
,
variable
=
None
,
count_granularity
=
None
):
...
...
@@ -600,10 +592,10 @@ class MemAccess(Record):
raise
NotImplementedError
(
"
MemAccess: variable must be None when
"
"
mtype is
'
local
'"
)
if
count_granularity
not
in
self
.
c
ount
_g
ranularity
_options
:
raise
ValueError
(
"
Op.__init__: count_granularity
'
%s
'
is
"
if
count_granularity
not
in
C
ount
G
ranularity
.
ALL
+
[
None
]
:
raise
ValueError
(
"
Op.__init__: count_granularity
'
%s
'
is
"
"
not allowed. count_granularity options: %s
"
%
(
count_granularity
,
self
.
c
ount
_g
ranularity
_options
))
%
(
count_granularity
,
C
ount
G
ranularity
.
ALL
+
[
None
]
))
if
dtype
is
None
:
Record
.
__init__
(
self
,
mtype
=
mtype
,
dtype
=
dtype
,
stride
=
stride
,
...
...
@@ -1490,7 +1482,7 @@ def get_mem_access_map(knl, numpy_types=True, count_redundant_work=False,
# this should not happen since this is enforced in MemAccess
raise
ValueError
(
"
get_insn_count: count_granularity
'
%s
'
is
"
"
not allowed. count_granularity options: %s
"
%
(
count_granularity
,
MemAccess
.
c
ount
_g
ranularity
_options
))
%
(
count_granularity
,
C
ount
G
ranularity
.
ALL
+
[
None
]
))
knl
=
infer_unknown_types
(
knl
,
expect_completion
=
True
)
knl
=
preprocess_kernel
(
knl
)
...
...
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