Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyopencl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
pyopencl
Commits
d3f31844
Commit
d3f31844
authored
10 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Delete IPython support in original location
parent
ad235236
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyopencl/ipython.py
+0
-40
0 additions, 40 deletions
pyopencl/ipython.py
with
0 additions
and
40 deletions
pyopencl/ipython.py
deleted
100644 → 0
+
0
−
40
View file @
ad235236
from
__future__
import
division
from
IPython.core.magic
import
(
magics_class
,
Magics
,
cell_magic
)
import
pyopencl
as
cl
from
warnings
import
warn
warn
(
"
pyopencl.ipython is deprecated. Use pyopencl.ipython_ext instead.
"
)
@magics_class
class
PyOpenCLMagics
(
Magics
):
@cell_magic
def
cl_kernel
(
self
,
line
,
cell
):
try
:
ctx
=
self
.
shell
.
user_ns
[
"
cl_ctx
"
]
except
KeyError
:
ctx
=
None
if
not
isinstance
(
ctx
,
cl
.
Context
):
ctx
=
None
if
ctx
is
None
:
try
:
ctx
=
self
.
shell
.
user_ns
[
"
ctx
"
]
except
KeyError
:
ctx
=
None
if
ctx
is
None
:
raise
RuntimeError
(
"
unable to locate cl context, which must be
"
"
present in namespace as
'
cl_ctx
'
or
'
ctx
'"
)
prg
=
cl
.
Program
(
ctx
,
cell
.
encode
(
"
utf8
"
)).
build
()
for
knl
in
prg
.
all_kernels
():
self
.
shell
.
user_ns
[
knl
.
function_name
]
=
knl
def
load_ipython_extension
(
ip
):
ip
.
register_magics
(
PyOpenCLMagics
)
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