Hi All,

I have been converting my Monte Carlo code from cuda to Pyopencl and have run 
into the following problem. I am working between two machines 1)Ubuntu 14.04 
machine with cuda 7.0 proprietary drivers and libraries, intel's most recent 
opencl drivers, and amd's opencl drivers, Pyopencl from default Ubuntu repo and 
2) Windows 7 Ultimate with AMD SDK from about 2 years ago with python(x,y) and 
the Pyopencl distributed with that also from about 2 years ago.

On the Ubuntu machine I have the original Cuda code AND the Pyopencl code. I 
made a lot of changes to the cuda code to improve the performance like removing 
branching, changing ifs to switches and removing unused functions and 
variables. I then converted the cuda kernels to opencl kernels, copying and 
pasting a lot of the code directly. When I run the program in cuda on my test 
dataset I get the answer I expect, 100 +- small deviations due to randomness. 
The Pyopencl code returns ~twice that or 200 +- small deviations. It returns 
200 no matter which opencl library is called, Nvidia (GPU calc), Intel (CPU 
calc), or AMD (CPU Calc).

On the Windows machine, the exact same Pyopencl code returns the expected value 
of 100.

Before running on the Windows machine I figured I had copied something 
incorrectly but every variable I checked prints approximately the same value 
that cuda prints within reason except for the final value I check, the Maximum 
of the output array. I expect them to be very close but the Pyopencl one is 
~half the value of the cuda value. This is where the factor of 2 comes from. No 
other variables are different.

Any help or ideas are appreciated.

Joe Reese Haywood, Ph.D., DABR
Medical Physicist
Johnson Family Cancer Center
Mercy Health Muskegon
1440 E. Sherman Blvd, Suite 300
Muskegon, MI 49444
Phone: 231-672-2019
Email: [email protected]


Confidentiality Notice:
This e-mail, including any attachments is the property of Trinity Health and is 
intended for the sole use of the intended recipient(s). It may contain 
information that is privileged and confidential.  Any unauthorized review, use, 
disclosure, or distribution is prohibited. If you are not the intended 
recipient, please delete this message, and reply to the sender regarding the 
error in a separate email.
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to