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
4b1933db
Commit
4b1933db
authored
9 years ago
by
James Stevens
Browse files
Options
Downloads
Patches
Plain Diff
removed get_op_counter_old
parent
fe3497e7
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
+2
-43
2 additions, 43 deletions
loopy/statistics.py
with
2 additions
and
43 deletions
loopy/statistics.py
+
2
−
43
View file @
4b1933db
...
@@ -560,50 +560,8 @@ def count(kernel, bset):
...
@@ -560,50 +560,8 @@ def count(kernel, bset):
return
result
return
result
def
get_op_poly_old
(
knl
):
"""
Count the number of operations in a loopy kernel.
:parameter knl: A :class:`loopy.LoopKernel` whose operations are to be counted.
:return: A mapping of **{** :class:`numpy.dtype` **:**
:class:`islpy.PwQPolynomial` **}**.
- The :class:`islpy.PwQPolynomial` holds the number of operations for
the :class:`numpy.dtype` specified in the key (in terms of the
:class:`loopy.LoopKernel` *inames*).
Example usage::
# (first create loopy kernel and specify array data types)
poly = get_op_poly(knl)
params = {
'
n
'
: 512,
'
m
'
: 256,
'
l
'
: 128}
float32_op_ct = poly.dict[np.dtype(np.float32)].eval_with_dict(params)
float64_op_ct = poly.dict[np.dtype(np.float64)].eval_with_dict(params)
# (now use these counts to predict performance)
"""
from
loopy.preprocess
import
preprocess_kernel
,
infer_unknown_types
knl
=
infer_unknown_types
(
knl
,
expect_completion
=
True
)
knl
=
preprocess_kernel
(
knl
)
op_poly
=
ToCountMap
()
op_counter
=
ExpressionOpCounter
(
knl
)
for
insn
in
knl
.
instructions
:
# how many times is this instruction executed?
# check domain size:
insn_inames
=
knl
.
insn_inames
(
insn
)
inames_domain
=
knl
.
get_inames_domain
(
insn_inames
)
domain
=
(
inames_domain
.
project_out_except
(
insn_inames
,
[
dim_type
.
set
]))
ops
=
op_counter
(
insn
.
assignee
)
+
op_counter
(
insn
.
expression
)
op_poly
=
op_poly
+
ops
*
count
(
knl
,
domain
)
return
op_poly
.
dict
def
get_op_poly
(
knl
):
def
get_op_poly
(
knl
):
"""
Count the number of operations in a loopy kernel.
"""
Count the number of operations in a loopy kernel.
:parameter knl: A :class:`loopy.LoopKernel` whose operations are to be counted.
:parameter knl: A :class:`loopy.LoopKernel` whose operations are to be counted.
...
@@ -633,6 +591,7 @@ def get_op_poly(knl):
...
@@ -633,6 +591,7 @@ def get_op_poly(knl):
# (now use these counts to predict performance)
# (now use these counts to predict performance)
"""
"""
from
loopy.preprocess
import
preprocess_kernel
,
infer_unknown_types
from
loopy.preprocess
import
preprocess_kernel
,
infer_unknown_types
knl
=
infer_unknown_types
(
knl
,
expect_completion
=
True
)
knl
=
infer_unknown_types
(
knl
,
expect_completion
=
True
)
knl
=
preprocess_kernel
(
knl
)
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