For Erlang, I found this (https://github.com/tonyrog/cl) to be a good choice as it is more complete than other implementations.
My home development machine is Windows 7 64bit -- I prefer CentOS for general development and Mac for general use (I have all three at both work and home), however for some devices and applications I use, I decided to use Windows. Windows is actually very convenient when it comes to odd hardware. Mac -- not supported or some workaround is necessary, and for Linux, too much tinkering is needed which I do not want to spend too much time but focus on actual development.
Anyways, for Tony Rogvall's library, the compiling didn't go well in my environment. After spending several hours, I finally figured it out. Again, this difficulty and steps only apply for my case:
Environment:
- Windows 7 pro, 64bit.
- Nvidia CUDA 5 SDK installed. (CUDA 5 SDK comes with OpenCL, not a separate SDK)
- H/W: NVidia Quadro 600 and Tesla C2050.
- Erlang R15B02 (erts-5.9.2) 64bit.
- Visual Studio 2010 Pro.
- rebar
- Git
- open cmd
- "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
- git clone https://github.com/tonyrog/cl.git
- set OPENCL_DIR=/PROGRA~1/NVIDIA~2/CUDA/v5.0
update c_src\Makefile, adding "MCL=1"- rebar compile
Hope this helps someone facing the same problem.
Now it's time to actually explore OpenCL in Erlang!
UPDATE: the author confirmed that Makefile is not used. Therefore step#5 is not necessary.
3 comments:
Peculiar. First I had to get erlang bin in my path, then the rebar directory in my path and build it with bootstrap.bat. My rebar was misbehaving until I actually did set OPEN_CL exactly as you did (I tried first the long pathnames where, I was informed, OpenCL was not to be found). Then I got a git error caused by having downloaded a snapshot, not a git clone. Finally I got success, wondering if the end product is crash-free!
Creating library priv/cl_nif.lib and object priv/cl_nif.exp
And... it is not crash free, even the one-liners crash, though in all honesty I usualy have fewer crashes in 32 bit and have not tried it yet
Post a Comment