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
1bfded08
Commit
1bfded08
authored
13 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Fix up more tests to run with new-style loopy.
parent
4ebc5c98
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
test/test_matmul.py
+14
-12
14 additions, 12 deletions
test/test_matmul.py
with
14 additions
and
12 deletions
test/test_matmul.py
+
14
−
12
View file @
1bfded08
...
...
@@ -162,7 +162,7 @@ def test_plain_matrix_mul(ctx_factory):
knl
=
lp
.
LoopKernel
(
ctx
.
devices
[
0
],
"
{[i,j,k]: 0<=i,j,k<%d}
"
%
n
,
[
"
c[i, j] = a[i, k]*b[k, j]
"
"
c[i, j] =
sum_float32(k,
a[i, k]*b[k, j]
)
"
],
[
lp
.
ArrayArg
(
"
a
"
,
dtype
,
shape
=
(
n
,
n
),
order
=
order
),
...
...
@@ -172,16 +172,15 @@ def test_plain_matrix_mul(ctx_factory):
name
=
"
matmul
"
)
knl
=
lp
.
split_dimension
(
knl
,
"
i
"
,
16
,
outer_tag
=
"
g.0
"
,
inner_tag
=
"
l.1
"
,
no_slabs
=
True
)
outer_tag
=
"
g.0
"
,
inner_tag
=
"
l.1
"
)
knl
=
lp
.
split_dimension
(
knl
,
"
j
"
,
16
,
outer_tag
=
"
g.1
"
,
inner_tag
=
"
l.0
"
,
no_slabs
=
True
)
knl
=
lp
.
split_dimension
(
knl
,
"
k
"
,
16
,
no_slabs
=
True
)
outer_tag
=
"
g.1
"
,
inner_tag
=
"
l.0
"
)
knl
=
lp
.
split_dimension
(
knl
,
"
k
"
,
16
)
knl
=
lp
.
add_prefetch
(
knl
,
'
a
'
,
[
"
k_inner
"
,
"
i_inner
"
])
knl
=
lp
.
add_prefetch
(
knl
,
'
b
'
,
[
"
j_inner
"
,
"
k_inner
"
,
])
assert
knl
.
get_problems
({})[
0
]
<=
2
kernel_gen
=
(
lp
.
insert_register_prefetch
es
(
knl
)
for
knl
in
lp
.
generate_loop_schedules
(
knl
)
)
kernel_gen
=
lp
.
generate_loop_schedul
es
(
knl
)
kernel_gen
=
lp
.
check_kernels
(
kernel_gen
,
{},
kill_level_min
=
5
)
a
=
make_well_conditioned_dev_matrix
(
queue
,
n
,
dtype
=
dtype
,
order
=
order
)
b
=
make_well_conditioned_dev_matrix
(
queue
,
n
,
dtype
=
dtype
,
order
=
order
)
...
...
@@ -203,7 +202,7 @@ def test_plain_matrix_mul(ctx_factory):
def
test_
plain
_matrix_mul
_new_ui
(
ctx_factory
):
def
test_
variable_size
_matrix_mul
(
ctx_factory
):
dtype
=
np
.
float32
ctx
=
ctx_factory
()
order
=
"
C
"
...
...
@@ -294,6 +293,9 @@ def test_rank_one(ctx_factory):
return
knl
def
variant_3
(
knl
):
# Throws an error--doesn't use all hardware axis.
# Probably the right thing to do.
knl
=
lp
.
split_dimension
(
knl
,
"
i
"
,
16
,
outer_tag
=
"
g.0
"
,
inner_tag
=
"
l.0
"
)
knl
=
lp
.
split_dimension
(
knl
,
"
j
"
,
16
,
...
...
@@ -305,9 +307,9 @@ def test_rank_one(ctx_factory):
def
variant_4
(
knl
):
knl
=
lp
.
split_dimension
(
knl
,
"
i
"
,
256
,
outer_tag
=
"
g.0
"
,
slabs
=
(
0
,
-
1
))
outer_tag
=
"
g.0
"
,
slabs
=
(
0
,
1
))
knl
=
lp
.
split_dimension
(
knl
,
"
j
"
,
256
,
outer_tag
=
"
g.1
"
,
slabs
=
(
0
,
-
1
))
outer_tag
=
"
g.1
"
,
slabs
=
(
0
,
1
))
knl
=
lp
.
add_prefetch
(
knl
,
"
a
"
,
[
"
i_inner
"
])
knl
=
lp
.
add_prefetch
(
knl
,
"
b
"
,
[
"
j_inner
"
])
...
...
@@ -323,8 +325,8 @@ def test_rank_one(ctx_factory):
outer_tag
=
"
l.1
"
,
inner_tag
=
"
l.0
"
)
return
knl
#
for variant in [variant_1, variant_2, variant_
3
]:
for
variant
in
[
variant_4
]:
for
variant
in
[
variant_1
,
variant_2
,
variant_
4
]:
kernel_gen
=
lp
.
generate_loop_schedules
(
variant
(
knl
))
kernel_gen
=
lp
.
check_kernels
(
kernel_gen
,
dict
(
n
=
n
),
kill_level_min
=
5
)
...
...
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