5/4/2023 0 Comments Opencl benchmark amd![]() The weird behaviour you are observing is probably due to the fact that some of these initialisation routines are being performed before being interrupted by your induced error. This is likely where your first discrepancy is coming from (AMD appearing to be much faster than Intel). In particular, compiling programs is expensive, and different vendors (Intel, AMD) will perform different program transformations and optimisation passes. You are timing all of the initialisation routines, which include creating the OpenCL context, allocating memory, copying memory to and from host to the device (even though they are the same thing in this case, there is still a memcpy), and compiling the program.Īll of this will dramatically affect the runtime you observe. Most likely some mistake with the Intel OpenCl runtime, though I wouldn't know where to begin looking. I really have no idea what could be causing such a strange error. It only works if I let it run in the same IPython console, first ending in any error and then the correct one. If I run the program in the command line using python3 file.py the performance is bad. After this, the performance is always better than with the AMD APP, until I restart the IPython console. any syntax, arguments), run this in an IPython console and get an error message, correct the error and run it again, then the performance on the Intel OpenCl increases to 0.045s (factor of 5-6). If I let the program end in an error by changing anything in the function Mandelbrot (e.g. ![]() Using Intel OpenCl the time is around 0.25s, which is unexpected, as the Intel OpenCl usually performs better with the Core i7. Using the Core i7 on the AMD APP this function clocks at around 0.075s for a 1024x1024 pixel image with an iteration depth of 200. code would be the kernel written in OpenCl C. Here platforms would be the AMD APP and platforms is Intel OpenCl, the device is the Core i7 both times. Np.float64(dx), np.float64(dy), np.uint16(maxit), np.uint16(col), output_opencl)Ĭl.enqueue_copy(queue, image, output_opencl).wait() Prg.mandelbrot(queue, (xsize, ysize), None, np.float64(xmin), np.float64(ymax), Output_opencl = cl.Buffer(ctx, mf.WRITE_ONLY, image.nbytes) The main part is the function to calculate the number of iterations for a given point on the grid (image) is: platforms = cl.get_platforms()ĭevs = platforms.get_devices(device_type=cl.device_type.CPU)ĭef Mandelbrot(xmin, xmax, ymin, ymax, xsize, ysize, maxit, col, image): I'm using Ubuntu 14.10 on an HP Elitebook 840 G1 with an Intel Core i7-4600U. I now have some weird performance issues with Intel OpenCl compared to AMD APP. I've been trying to speed up my implementation of the Mandelbrot set using OpenCl via PyOpenCl.
0 Comments
Leave a Reply. |