LibRapid / librapid

A highly optimised C++ library for mathematical applications and neural networks.
http://librapid.rtfd.io
MIT License
164 stars 10 forks source link

OpenCL Support on MacOS (Mx) #245

Open Pencilcaseman opened 1 year ago

Pencilcaseman commented 1 year ago

OpenCL on MacOS (M2 Max chip) seems to fail.

AGX: exceeded compiled variants footprint limit

My best guess is that this is due to the number of OpenCL function variants defined since there is one for int8_t, int16_t, int32_t, etc. for every function.


Solution?

The best idea I've got to fix this is to generate and compile the kernels at runtime. This way, only the kernels that are used by the program are produced.

Issues:

  1. Requires writing the code to generate every type of kernel
  2. Requires runtime compilation of kernels (not a pre-main* process)
  3. Might not fix the issue

I'll probably get test merged through to master in the current state as of writing this issue before working on this.