Hi all,

I observed a problem with typecasting from a real number to a complex number an a Tesla 2050 using pyopencl (from git w/ latest commit d6926eea21351f3044fd441cae64637441e3172f). A code snipped may explain that better:

import pyopencl as _cl
import pyopencl.array as _clarray

import numpy as _numpy
from numpy import float32,float64,complex64,complex128

print _cl.__file__
print _numpy.__file__


cl_context = _cl.create_some_context()
print cl_context

cl_queue = _cl.CommandQueue(cl_context)
print cl_queue

narr= _numpy.zeros(shape=(2,2), dtype=complex64)
narr[0,0]= 5

print narr

clarr= _clarray.to_device(cl_queue, narr)
print "clarr on gpu: {0}".format(clarr)

res= clarr / 5 # this reproduces: <program source>:20:20: error: can't convert between vector values of different size ('cfloat_t __attribute__((address_space(1)))' and 'double')
#res=  clarr / (5+0j) # this works

print clarr


Cheers, Karsten


_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to