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
Timothy Smith
loopy
Commits
282abebe
Commit
282abebe
authored
7 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Plain Diff
Merge branch 'minor-fixes' into 'master'
Minor fixes See merge request
!123
parents
4ff0aef2
b4f0093f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/python/hello-loopy.py
+2
-2
2 additions, 2 deletions
examples/python/hello-loopy.py
loopy/preprocess.py
+8
-6
8 additions, 6 deletions
loopy/preprocess.py
with
10 additions
and
8 deletions
examples/python/hello-loopy.py
+
2
−
2
View file @
282abebe
...
@@ -26,5 +26,5 @@ knl = lp.split_iname(knl, "i", 128, outer_tag="g.0", inner_tag="l.0")
...
@@ -26,5 +26,5 @@ knl = lp.split_iname(knl, "i", 128, outer_tag="g.0", inner_tag="l.0")
evt
,
(
out
,)
=
knl
(
queue
,
a
=
a
)
evt
,
(
out
,)
=
knl
(
queue
,
a
=
a
)
# ENDEXAMPLE
# ENDEXAMPLE
c
knl
=
lp
.
CompiledKernel
(
ctx
,
knl
)
knl
=
lp
.
add_and_infer_dtypes
(
knl
,
{
"
a
"
:
np
.
dtype
(
np
.
float32
)}
)
print
(
cknl
.
get_highligh
te
d
_code
({
"
a
"
:
np
.
float32
}
))
print
(
lp
.
genera
te_code
_v2
(
knl
).
device_code
(
))
This diff is collapsed.
Click to expand it.
loopy/preprocess.py
+
8
−
6
View file @
282abebe
...
@@ -48,20 +48,22 @@ def prepare_for_caching(kernel):
...
@@ -48,20 +48,22 @@ def prepare_for_caching(kernel):
import
loopy
as
lp
import
loopy
as
lp
new_args
=
[]
new_args
=
[]
tgt
=
kernel
.
target
for
arg
in
kernel
.
args
:
for
arg
in
kernel
.
args
:
dtype
=
arg
.
dtype
dtype
=
arg
.
dtype
if
dtype
is
not
None
and
dtype
is
not
lp
.
auto
:
if
dtype
is
not
None
and
dtype
is
not
lp
.
auto
and
dtype
.
target
is
not
tgt
:
dtype
=
dtype
.
with_target
(
kernel
.
target
)
arg
=
arg
.
copy
(
dtype
=
dtype
.
with_target
(
kernel
.
target
)
)
new_args
.
append
(
arg
.
copy
(
dtype
=
dtype
)
)
new_args
.
append
(
arg
)
new_temporary_variables
=
{}
new_temporary_variables
=
{}
for
name
,
temp
in
six
.
iteritems
(
kernel
.
temporary_variables
):
for
name
,
temp
in
six
.
iteritems
(
kernel
.
temporary_variables
):
dtype
=
temp
.
dtype
dtype
=
temp
.
dtype
if
dtype
is
not
None
and
dtype
is
not
lp
.
auto
:
if
dtype
is
not
None
and
dtype
is
not
lp
.
auto
and
dtype
.
target
is
not
tgt
:
dtype
=
dtype
.
with_target
(
kernel
.
targe
t
)
temp
=
temp
.
copy
(
dtype
=
dtype
.
with_target
(
tg
t
)
)
new_temporary_variables
[
name
]
=
temp
.
copy
(
dtype
=
dtype
)
new_temporary_variables
[
name
]
=
temp
kernel
=
kernel
.
copy
(
kernel
=
kernel
.
copy
(
args
=
new_args
,
args
=
new_args
,
...
...
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