I am currently working on a cython based wrapper for the OpenCL FFT library from AMD: https://github.com/geggo/gpyfft
For this I need to create a pyopencl Event instance from a cl_event returned by the library. I attached a patch against recent pyopencl that adds this possibility, similar to the from_cl_mem_as_int() method of the MemoryObject class. Could you please add this to pyopencl.
Thanks for your help
Will any of you attend EuroPython in Florence, Italy, starting
I'll be there all week and will be glad to meet other PyOpenCL users.
Tomasz Rybak <tomasz.rybak(a)post.pl> GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A 488E C654 FB33 2AD5 9860
I've found some unexpected errors while working with PyOpenCL, specifically
when using one-dimensional, complex arrays.
pycuda.array.dot(a,b) doesn't work with a complex vector.
pycuda.array.sum(a) also gives an error when a is complex
Are these features that will be added in the future, or is there just not
full support for complex vectors?
Andrew Miller <ajm09c(a)acu.edu> writes:
> I have run into a question while using 1d arrays in OpenCL. I am able to
> multiply a 1d array*=scalar. When I try to multiply a 1d array by another
> 1d array, it works fine as: newarray=a*b but when I try a*=b, I run into
Should be fixed in git, thanks for the report.
Hello Mr. Klöckner,
I work with your PyOpenCL Package for my own PhD at TU-Darmstadt in the
field of applied mathematics. It is great! Thank you for your effords!
Right know I try to handle a problem, and my google-Research did not work
out. I do some calculations of Voronoi-Cells (nearest neighbor-problem).
Therefore, I write into my Result array, which is quite big (Number of
Points > 250.000).
I only want to store True/False to keep the information of closest
neighbors. (i.e. Pnt 12 is Neighbour of Pnt 13 => 12/13 = 1)
I compressed this information to a uint8 linear array (Values 0-255) and I
do bit manipulations to store 8 Neighbor Informations.
Furthermore the array grows with the Gaussian sum:
0 1 2 3
2 0 1
3 0 1 0
nachbar = zeros(array_size, dtype=uint8)
nachbar_buf = cl.Buffer(ctx, mf.READ_WRITE | mf.USE_HOST_PTR,
int index = (cur_compare_pnt-1)*cur_compare_pnt/2 + cur_pnt;
int main_index = index / 8;
int sub_index = index % 8;
nachbar_buf[main_index] |= 1<<sub_index;
I am not sure, if this was understandable I hope so. My problem is, that
this process is not vectorizable, since I write with different Point Tupels
into the same uint8 Entry.
My question is: Is there a way to use a bool-linear- array in OpenCL? Or is
there a better way at all?
Thank you very much. I started with OpenCL at all one year ago and your work
help a lot.
I have run into a question while using 1d arrays in OpenCL. I am able to
multiply a 1d array*=scalar. When I try to multiply a 1d array by another
1d array, it works fine as: newarray=a*b but when I try a*=b, I run into
Here is the output:
line 631, in __imul__
self._axpbz(self, scalar, self, self.dtype.type(0))
line 155, in kernel_runner
knl = kernel_getter(*args)
line 407, in _axpbz
a.dtype, x.dtype, b.dtype, out.dtype)
File "<string>", line 2, in get_axpbz_kernel
line 83, in first_arg_dependent_memoize
result = func(cl_object, *args)
line 417, in get_axpbz_kernel
line 114, in dtype_to_ctype
raise ValueError, "unable to map dtype '%s'" % dtype
ValueError: unable to map dtype 'object'
a_gpu and b_gpu are both pyopencl arrays, and they are both 1d, 2-element,
Is there a way to do this with pyopencl, and I'm just going about it wrong?
Thanks for the help!