uncomplicate

2020-05-17T00:28:59.023100Z

@francesco Please clone the hello-world project and try the specific OpenCL 1.2 example https://github.com/uncomplicate/neanderthal/blob/master/examples/hello-world/src/hello_world/opencl1.cl

2020-05-17T00:31:06.025Z

@francesco Both books should be compatible with OpenCL 1.2. but the DLFP book supports OpenCL only for the chapters that do not require tensors (Deep Diamond) since there is no useful tensor support for OpenCL yet anywhere.

2020-05-17T00:32:29.026100Z

BTW macOS usully means laptops, which usually mean not-so-powerful GPUs anyway, so in the end the super-optimized CPU stuff might be both more convenient and faster on such machines.

2020-05-17T00:37:45.029700Z

@francesco Now that I think about it, there is a bug in Apple's OpenCL implementation where they don't support a few native variants of device functions that should be supported by the standard, so Neanderthal's code should be patched by changing native_so_and_so_function to so_and_so_function to work on Apple's devices. This is straightforward (although it looks scary) since it is literally 0) Clone Neanderthal from github 1) replace this string in a few *.cl files 2) run lein install. I'll see to fix that in the next release of Neanderthal.

2020-05-17T12:31:35.030600Z

thanks! I'll try to follow your suggestions and let you know

2020-05-17T22:49:35.032Z

@blueberry Removing the native_* prefix solved the problem. Actually the only problematic file was http://random.cl

2020-05-17T22:56:19.035700Z

Also, using (opencl/with-default-1 ...) as suggested in the article to test the OpenCL GPU, actually run the code on the CPU on my system: it chooses the first device of the first platform with a GPU, which in my case is the CPU (GPU is the second one). If the intended behavior is to use the GPU it should use (devices :gpu) .

2020-05-17T22:59:42.036800Z

Are you interested in a patch to Neanderthal that chooses an alternative http://random.cl based on platform detection and/or a global property?

2020-05-17T23:01:22.037Z

Thanks for your help!

2020-05-17T23:10:39.041Z

Yes, please. Send the patch that fixes this on OpenCL. I can't apply it directly, though, since I have to keep the existing behavior on other two major platforms (AMD and Nvidia). I'll have to see how to best integrate it. As for the device detection, this depends on the platform. with-default does what it's suposed to do: uses the default platform. Other platforms put GPU as the default, Mac chooses the CPU. Some platforms may not even have a GPU... That's why there are proper ways to specify the device of your choice.