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
ad7f2488
Commit
ad7f2488
authored
7 years ago
by
Jonathan Mackenzie
Browse files
Options
Downloads
Patches
Plain Diff
Removed staticmethod from cl vector functions,
Improved documentation for enqueue_fill_buffer and enqueue_copy_buffer
parent
3a61e368
No related branches found
No related tags found
1 merge request
!9
Scalar types
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/runtime_memory.rst
+14
-1
14 additions, 1 deletion
doc/runtime_memory.rst
pyopencl/cltypes.py
+7
-9
7 additions, 9 deletions
pyopencl/cltypes.py
with
21 additions
and
10 deletions
doc/runtime_memory.rst
+
14
−
1
View file @
ad7f2488
...
...
@@ -96,7 +96,10 @@ Buffer
.. function:: enqueue_fill_buffer(queue, mem, pattern, offset, size, wait_for=None)
:arg pattern: a buffer object (likely a :class:`numpy.ndarray`)
:arg mem: the on device :class:`Buffer`
:arg pattern: a buffer object (likely a :class:`numpy.ndarray`, eg. `np.uint32(0)`)
Fills a buffer with the provided pattern
|std-enqueue-blurb|
...
...
@@ -104,6 +107,16 @@ Buffer
.. versionadded:: 2011.2
.. function:: enqueue_copy_buffer(queue, src, dst, byte_count=-1, src_offset=0, dst_offset=0, wait_for=None)
:arg src: the source :class:`Buffer`
:arg dst: the destination device :class:`Buffer`
:arg byte_count: the number of bytes to copy
Performs a device to device copy from `src` to `dst`.
|std-enqueue-blurb|
.. _svm:
Shared Virtual Memory (SVM)
...
...
This diff is collapsed.
Click to expand it.
pyopencl/cltypes.py
+
7
−
9
View file @
ad7f2488
...
...
@@ -98,7 +98,7 @@ def _create_vector_types():
from
warnings
import
warn
warn
(
"
default values for make_xxx are deprecated;
"
"
instead specify all parameters or use
"
"
array.vec
.zeros_xxx
"
,
DeprecationWarning
)
"
cltypes
.zeros_xxx
"
,
DeprecationWarning
)
padded_args
=
tuple
(
list
(
args
)
+
[
0
]
*
(
padded_count
-
len
(
args
)))
array
=
eval
(
"
array(padded_args, dtype=dtype)
"
,
dict
(
array
=
np
.
array
,
padded_args
=
padded_args
,
...
...
@@ -107,16 +107,14 @@ def _create_vector_types():
array
[
key
]
=
val
return
array
set_global
(
"
make_
"
+
name
,
staticmethod
(
eval
(
set_global
(
"
make_
"
+
name
,
eval
(
"
lambda *args, **kwargs: create_array(dtype, %i, %i,
"
"
*args, **kwargs)
"
%
(
count
,
padded_count
),
dict
(
create_array
=
create_array
,
dtype
=
dtype
))))
set_global
(
"
filled_
"
+
name
,
staticmethod
(
eval
(
"
lambda val: vec.make_%s(*[val]*%i)
"
%
(
name
,
count
))))
set_global
(
"
zeros_
"
+
name
,
staticmethod
(
eval
(
"
lambda: vec.filled_%s(0)
"
%
(
name
))))
set_global
(
"
ones_
"
+
name
,
staticmethod
(
eval
(
"
lambda: vec.filled_%s(1)
"
%
(
name
))))
dict
(
create_array
=
create_array
,
dtype
=
dtype
)))
set_global
(
"
filled_
"
+
name
,
eval
(
"
lambda val: make_%s(*[val]*%i)
"
%
(
name
,
count
)))
set_global
(
"
zeros_
"
+
name
,
eval
(
"
lambda: filled_%s(0)
"
%
(
name
)))
set_global
(
"
ones_
"
+
name
,
eval
(
"
lambda: filled_%s(1)
"
%
(
name
)))
globals
()[
'
types
'
][
np
.
dtype
(
base_type
),
count
]
=
dtype
globals
()[
'
type_to_scalar_and_count
'
][
dtype
]
=
np
.
dtype
(
base_type
),
count
...
...
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