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
6ef2c660
Commit
6ef2c660
authored
13 years ago
by
Tim Warburton
Browse files
Options
Downloads
Patches
Plain Diff
Add edit_code flag to automated testing harness.
parent
ee602dc2
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/compiled.py
+9
-3
9 additions, 3 deletions
loopy/compiled.py
with
9 additions
and
3 deletions
loopy/compiled.py
+
9
−
3
View file @
6ef2c660
...
...
@@ -22,8 +22,9 @@ class CompiledKernel:
import
pyopencl
as
cl
try
:
self
.
cl_program
=
cl
.
Program
(
context
,
self
.
code
)
self
.
cl_kernel
=
getattr
(
cl
.
Program
(
context
,
self
.
code
)
.
build
(
options
=
options
),
self
.
cl_program
.
build
(
options
=
options
),
kernel
.
name
)
except
:
print
"
[Loopy] ----------------------------------------------------
"
...
...
@@ -225,7 +226,8 @@ def make_args(queue, kernel, seq_input_arrays, parameters):
def
auto_test_vs_seq
(
seq_knl
,
ctx
,
kernel_gen
,
op_count
,
op_label
,
parameters
,
print_seq_code
=
False
,
print_code
=
True
,
warmup_rounds
=
2
,
timing_rounds
=
100
):
print_seq_code
=
False
,
print_code
=
True
,
warmup_rounds
=
2
,
timing_rounds
=
100
,
edit_code
=
False
,
dump_binary
=
False
):
from
time
import
time
# {{{ set up CL context for sequential run
...
...
@@ -300,13 +302,17 @@ def auto_test_vs_seq(seq_knl, ctx, kernel_gen, op_count, op_label, parameters,
if
args
is
None
:
args
,
output_arrays
=
make_args
(
queue
,
kernel
,
seq_input_arrays
,
parameters
)
compiled
=
CompiledKernel
(
ctx
,
kernel
)
compiled
=
CompiledKernel
(
ctx
,
kernel
,
edit_code
=
edit_code
)
print
"
----------------------------------------------------------
"
print
"
Kernel #%d:
"
%
i
print
"
----------------------------------------------------------
"
if
print_code
:
print_highlighted_code
(
compiled
.
code
)
print
"
----------------------------------------------------------
"
if
dump_binary
:
print
type
(
compiled
.
cl_program
)
print
compiled
.
cl_program
.
binaries
[
0
]
print
"
----------------------------------------------------------
"
do_check
=
True
...
...
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