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
48d4df5c
Commit
48d4df5c
authored
11 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Fix with_queue for queue=None
parent
6e4bad80
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/array.py
+7
-2
7 additions, 2 deletions
pyopencl/array.py
with
7 additions
and
2 deletions
pyopencl/array.py
+
7
−
2
View file @
48d4df5c
...
...
@@ -235,6 +235,10 @@ class ArrayHasOffsetError(ValueError):
ValueError
.
__init__
(
self
,
val
)
class
_copy_queue
:
pass
class
Array
(
object
):
"""
A :class:`numpy.ndarray` work-alike that stores its data and performs
its computations on the compute device. *shape* and *dtype* work exactly
...
...
@@ -525,7 +529,7 @@ class Array(object):
return
_ArrayFlags
(
self
)
def
_new_with_changes
(
self
,
data
,
offset
,
shape
=
None
,
dtype
=
None
,
strides
=
None
,
queue
=
Non
e
):
strides
=
None
,
queue
=
_copy_queu
e
):
"""
:arg data: *None* means alocate a new array.
"""
...
...
@@ -535,7 +539,7 @@ class Array(object):
dtype
=
self
.
dtype
if
strides
is
None
:
strides
=
self
.
strides
if
queue
is
Non
e
:
if
queue
is
_copy_queu
e
:
queue
=
self
.
queue
if
queue
is
not
None
:
...
...
@@ -561,6 +565,7 @@ class Array(object):
if
queue
is
not
None
:
assert
queue
.
context
==
self
.
context
return
self
.
_new_with_changes
(
self
.
base_data
,
self
.
offset
,
queue
=
queue
)
...
...
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