Fork me on GitHub
#uncomplicate
<
2020-05-17
>
blueberry00:05:06

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

blueberry00:05:29

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.

blueberry00:05:45

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

francesco12:05:35

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

francesco22:05:35

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

francesco22:05:19

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

francesco22:05:42

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

francesco23:05:22

Thanks for your help!

blueberry23:05:39

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.