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
2999f30e
Commit
2999f30e
authored
8 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Deprecate 'defines' in make_kernel
parent
991582f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
loopy/kernel/creation.py
+6
-8
6 additions, 8 deletions
loopy/kernel/creation.py
test/test_apps.py
+5
-5
5 additions, 5 deletions
test/test_apps.py
test/test_dg.py
+7
-5
7 additions, 5 deletions
test/test_dg.py
with
18 additions
and
18 deletions
loopy/kernel/creation.py
+
6
−
8
View file @
2999f30e
...
...
@@ -1179,14 +1179,6 @@ def make_kernel(domains, instructions, kernel_data=["..."], **kwargs):
:arg preamble_generators: a list of functions of signature
(seen_dtypes, seen_functions) where seen_functions is a set of
(name, c_name, arg_dtypes), generating extra entries for *preambles*.
:arg defines: a dictionary of replacements to be made in instructions given
as strings before parsing. A macro instance intended to be replaced
should look like
"
MACRO
"
in the instruction code. The expansion given
in this parameter is allowed to be a list. In this case, instructions
are generated for *each* combination of macro values.
These defines may also be used in the domain and in argument shapes and
strides. They are expanded only upon kernel creation.
:arg default_order:
"
C
"
(default) or
"
F
"
:arg default_offset: 0 or :class:`loopy.auto`. The default value of
*offset* in :attr:`GlobalArg` for guessed arguments.
...
...
@@ -1220,6 +1212,12 @@ def make_kernel(domains, instructions, kernel_data=["..."], **kwargs):
flags
=
kwargs
.
pop
(
"
flags
"
,
None
)
target
=
kwargs
.
pop
(
"
target
"
,
None
)
if
defines
:
from
warnings
import
warn
warn
(
"'
defines
'
argument to make_kernel is deprecated.
"
"
Use lp.fix_parameters instead
"
,
DeprecationWarning
,
stacklevel
=
2
)
if
target
is
None
:
from
loopy
import
_DEFAULT_TARGET
target
=
_DEFAULT_TARGET
...
...
This diff is collapsed.
Click to expand it.
test/test_apps.py
+
5
−
5
View file @
2999f30e
...
...
@@ -74,12 +74,11 @@ def test_convolution(ctx_factory):
"
...
"
],
assumptions
=
"
f_w>=1 and im_w, im_h >= 2*f_w+1 and nfeats>=1 and nimgs>=0
"
,
options
=
"
annotate_inames
"
,
defines
=
dict
(
ncolors
=
3
))
options
=
"
annotate_inames
"
)
f_w
=
3
knl
=
lp
.
fix_parameters
(
knl
,
f_w
=
f_w
)
knl
=
lp
.
fix_parameters
(
knl
,
f_w
=
f_w
,
ncolors
=
3
)
ref_knl
=
knl
...
...
@@ -142,8 +141,9 @@ def test_convolution_with_nonzero_base(ctx_factory):
"
...
"
],
assumptions
=
"
f_w>=1 and im_w, im_h >= 2*f_w+1 and nfeats>=1 and nimgs>=0
"
,
flags
=
"
annotate_inames
"
,
defines
=
dict
(
ncolors
=
3
))
options
=
"
annotate_inames
"
)
knl
=
lp
.
fix_parameters
(
knl
,
ncolors
=
3
)
ref_knl
=
knl
...
...
This diff is collapsed.
Click to expand it.
test/test_dg.py
+
7
−
5
View file @
2999f30e
...
...
@@ -72,8 +72,9 @@ def test_dg_volume(ctx_factory):
order
=
order
),
lp
.
ValueArg
(
"
K
"
,
np
.
int32
,
approximately
=
1000
),
],
name
=
"
dg_volume
"
,
assumptions
=
"
K>=1
"
,
defines
=
dict
(
Np
=
Np
))
name
=
"
dg_volume
"
,
assumptions
=
"
K>=1
"
)
knl
=
lp
.
fix_parameters
(
knl
,
Np
=
Np
)
seq_knl
=
knl
...
...
@@ -218,9 +219,10 @@ def no_test_dg_surface(ctx_factory):
lp
.
GlobalArg
(
"
LIFT
"
,
dtype
,
shape
=
"
Np, NfpNfaces
"
,
order
=
"
C
"
),
lp
.
ValueArg
(
"
K
"
,
np
.
int32
,
approximately
=
1000
),
],
name
=
"
dg_surface
"
,
assumptions
=
"
K>=1
"
,
defines
=
dict
(
Np
=
Np
,
Nfp
=
Nfp
,
NfpNfaces
=
Nfaces
*
Nfp
,
nsurf_dofs
=
K
*
Nfp
),
)
name
=
"
dg_surface
"
,
assumptions
=
"
K>=1
"
)
knl
=
lp
.
fix_parameters
(
knl
,
Np
=
Np
,
Nfp
=
Nfp
,
NfpNfaces
=
Nfaces
*
Nfp
,
nsurf_dofs
=
K
*
Nfp
)
seq_knl
=
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