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
Wiki
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
Kaushik Kulkarni
pyopencl
Commits
ac7ed3c9
Commit
ac7ed3c9
authored
11 years ago
by
Marko Bencun
Browse files
Options
Downloads
Patches
Plain Diff
fixed one test where the buffer is allowed to be None
parent
83447a51
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyopencl/cffi_cl.py
+5
-2
5 additions, 2 deletions
pyopencl/cffi_cl.py
test/test_wrapper.py
+5
-2
5 additions, 2 deletions
test/test_wrapper.py
with
10 additions
and
4 deletions
pyopencl/cffi_cl.py
+
5
−
2
View file @
ac7ed3c9
#
from pyopencl._cl import PooledBuffer, MemoryPool
from
pyopencl._cl
import
PooledBuffer
,
MemoryPool
import
warnings
import
warnings
import
np
import
np
import
ctypes
import
ctypes
...
@@ -697,7 +697,10 @@ class Image(MemoryObject):
...
@@ -697,7 +697,10 @@ class Image(MemoryObject):
if
shape
is
None
:
if
shape
is
None
:
raise
LogicError
(
"
Image
"
,
status_code
.
INVALID_VALUE
,
"'
shape
'
must be given
"
)
raise
LogicError
(
"
Image
"
,
status_code
.
INVALID_VALUE
,
"'
shape
'
must be given
"
)
c_buf
,
size
,
_
=
_c_buffer_from_obj
(
buffer
,
writable
=
flags
&
mem_flags
.
USE_HOST_PTR
)
if
buffer
is
None
:
c_buf
,
size
=
_ffi
.
NULL
,
0
else
:
c_buf
,
size
,
_
=
_c_buffer_from_obj
(
buffer
,
writable
=
flags
&
mem_flags
.
USE_HOST_PTR
)
dims
=
len
(
shape
)
dims
=
len
(
shape
)
if
dims
==
2
:
if
dims
==
2
:
...
...
This diff is collapsed.
Click to expand it.
test/test_wrapper.py
+
5
−
2
View file @
ac7ed3c9
...
@@ -47,10 +47,13 @@ def test_get_info(ctx_factory):
...
@@ -47,10 +47,13 @@ def test_get_info(ctx_factory):
failure_count
=
[
0
]
failure_count
=
[
0
]
pocl_quirks
=
[
pocl_quirks
=
[
(
cl
.
Buffer
,
cl
.
mem_info
.
OFFSET
),
(
cl
.
Buffer
,
cl
.
mem_info
.
OFFSET
),
]
if
ctx
.
_get_cl_version
()
>=
(
1
,
2
)
and
cl
.
get_cl_header_version
()
>=
(
1
,
2
):
pocl_quirks
.
extend
([
(
cl
.
Program
,
cl
.
program_info
.
KERNEL_NAMES
),
(
cl
.
Program
,
cl
.
program_info
.
KERNEL_NAMES
),
(
cl
.
Program
,
cl
.
program_info
.
NUM_KERNELS
),
(
cl
.
Program
,
cl
.
program_info
.
NUM_KERNELS
),
]
]
)
CRASH_QUIRKS
=
[
CRASH_QUIRKS
=
[
((
"
NVIDIA Corporation
"
,
"
NVIDIA CUDA
"
,
((
"
NVIDIA Corporation
"
,
"
NVIDIA CUDA
"
,
"
OpenCL 1.0 CUDA 3.0.1
"
),
"
OpenCL 1.0 CUDA 3.0.1
"
),
...
...
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