Thanks for the new release. I installed the lastest 0.91.2
Unfortunately i do get an Assertion error when running the test:
python test_wrapper.py
================================================================= test
session starts
=================================================================
python: platform darwin -- Python 2.6.1
test object 1: /Volumes/DATA/Development/Python/pyopencl-0.91.2/test/
test_wrapper.py
test_wrapper.py .F...F
======================================================================
FAILURES
=======================================================================
TestCL.test_get_info.test_get_info[device=<pyopencl.Device 'Intel(R)
Core(TM)2 Duo CPU T9800 @ 2.93GHz' at 0x1020400>,
platform=<pyopencl.Platform 'Apple' at 0x7fff0000>]
self = <test_wrapper.TestCL instance at 0x101557440>, platform =
<pyopencl.Platform 'Apple' at 0x7fff0000>
device = <pyopencl.Device 'Intel(R) Core(TM)2 Duo CPU T9800 @
2.93GHz' at 0x1020400>
def test_get_info(self, platform, device):
had_failures = [False]
QUIRKS = [
("NVIDIA", [
(cl.Device, cl.device_info.PLATFORM),
]),
]
def find_quirk(quirk_list, cl_obj, info):
for quirk_plat_name, quirks in quirk_list:
if quirk_plat_name in platform.name:
for quirk_cls, quirk_info in quirks:
if (isinstance(cl_obj, quirk_cls)
and quirk_info == info):
return True
return False
def do_test(cl_obj, info_cls, func=None, try_attr_form=True):
if func is None:
def func(info):
cl_obj.get_info(info)
for info_name in dir(info_cls):
if not info_name.startswith("_") and info_name !=
"to_string":
info = getattr(info_cls, info_name)
try:
func(info)
except:
print "failed get_info", type(cl_obj),
info_name
if find_quirk(QUIRKS, cl_obj, info):
print "(known quirk for %s)" %
platform.name
else:
had_failures[0] = True
raise
if try_attr_form:
try:
getattr(cl_obj, info_name.lower())
except:
print "failed attr-based get_info", type
(cl_obj), info_name
if find_quirk(QUIRKS, cl_obj, info):
print "(known quirk for %s)" % platform.name
else:
had_failures[0] = True
raise
do_test(platform, cl.platform_info)
do_test(device, cl.device_info)
ctx = cl.Context([device])
do_test(ctx, cl.context_info)
props = 0
if (device.queue_properties
& cl.command_queue_properties.PROFILING_ENABLE):
profiling = True
props = cl.command_queue_properties.PROFILING_ENABLE
queue = cl.CommandQueue(ctx,
properties=props)
do_test(queue, cl.command_queue_info)
prg = cl.Program(ctx, """
__kernel void sum(__global float *a)
{ a[get_global_id(0)] *= 2; }
""").build()
do_test(prg, cl.program_info)
do_test(prg, cl.program_build_info,
lambda info: prg.get_build_info(device, info),
try_attr_form=False)
cl.unload_compiler() # just for the heck of it
mf = cl.mem_flags
n = 2000
a_buf = cl.Buffer(ctx, 0, n*4)
do_test(a_buf, cl.mem_info)
kernel = prg.sum
do_test(kernel, cl.kernel_info)
evt = kernel(queue, (n,), a_buf)
do_test(evt, cl.event_info)
if profiling:
evt.wait()
do_test(evt, cl.profiling_info,
lambda info: evt.get_profiling_info(info),
try_attr_form=False)
if device.image_support:
smp = cl.Sampler(ctx, True,
cl.addressing_mode.CLAMP,
cl.filter_mode.NEAREST)
do_test(smp, cl.sampler_info)
img_format = cl.get_supported_image_formats(
> ctx, cl.mem_flags.READ_ONLY,
cl.mem_object_type.IMAGE2D)[0]
E IndexError: list index out of range
test_wrapper.py:128: IndexError
TestCL.test_nonempty_supported_image_formats.test_nonempty_supported_image_formats
[device=<pyopencl.Device 'Intel(R) Core(TM)2 Duo CPU T9800 @
2.93GHz' at 0x1020400>, context=<pyopencl.Context at 0x10200d4b0 on
<pyopencl.Device 'Intel(R) Core(TM)2 Duo CPU T9800 @ 2.93GHz' at
0x1020400>>]
self = <test_wrapper.TestCL instance at 0x101557440>, device =
<pyopencl.Device 'Intel(R) Core(TM)2 Duo CPU T9800 @ 2.93GHz' at
0x1020400>
context = <pyopencl.Context at 0x10200d4b0 on <pyopencl.Device 'Intel
(R) Core(TM)2 Duo CPU T9800 @ 2.93GHz' at 0x1020400>>
def test_nonempty_supported_image_formats(self, device, context):
if device.image_support:
assert len(cl.get_supported_image_formats(
> context, cl.mem_flags.READ_ONLY,
cl.mem_object_type.IMAGE2D)) > 0
E assert 0 > 0
E + where 0 = len([])
E + where [] = <Boost.Python.function object at
0x1011470b0>(<pyopencl.Context at 0x10200d4b0 on <pyopencl.Device
'Intel(R) Core(TM)2 Duo CPU T9800 @ 2.93GHz' at 0x1020400>>, 4,
4337)
E + where <Boost.Python.function object at
0x1011470b0> = cl.get_supported_image_formats
E + and 4 = <class 'pyopencl._cl.mem_flags'>.READ_ONLY
E + where <class 'pyopencl._cl.mem_flags'> =
cl.mem_flags
E + and 4337 = <class
'pyopencl._cl.mem_object_type'>.IMAGE2D
E + where <class 'pyopencl._cl.mem_object_type'> =
cl.mem_object_type
test_wrapper.py:167: AssertionError
========================================================= 2 failed, 4
passed in 0.16 seconds
==========================================================
On Sep 17, 2009, at 11:06 PM, Andreas Klöckner wrote:
On Donnerstag 17 September 2009, Andreas Klöckner wrote:
On Donnerstag 17 September 2009, you wrote:
sry. Here it is
(gdb) bt
#0 0x00007fff879ee50c in CFGetTypeID ()
#1 0x00007fff8175722b in isValidSampler ()
#2 0x00007fff8175473d in clGetSamplerInfo ()
#3 0x0000000101266151 in pyopencl::sampler::get_info ()
Whoops. Turns out I left the sampler constructor empty. Fixed in
git and
0.91.1, released a few minutes ago. (I encountered this crash, too,
but
thought it was Nvidia's fault and added a condition to the test.
Silly me.)
Forgot to say: Thanks for the report.
Andreas
_______________________________________________
PyOpenCL mailing list
[email protected]
http://tiker.net/mailman/listinfo/pyopencl_tiker.net