Skip to content
Snippets Groups Projects
Commit ac7ed3c9 authored by Marko Bencun's avatar Marko Bencun
Browse files

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
#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:
......
...@@ -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"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment