Fork me on GitHub

@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.


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.


@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.


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


@blueberry Removing the native_* prefix solved the problem. Actually the only problematic file was


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) .


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


Thanks for your help!


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.