It looks like the very simple change I noted yesterday makes the CUDA 
package work under Windows. Before spamming the GIT depository, could 
somebody verify it the fix really works? Or if it can be written in a 
better way?

Add the following two lines to CUDA.jl, just above the include(...) lines
~~~
     const CUDA_LIB = @windows? "nvcuda.dll" : "libcuda"
     dlopen(CUDA_LIB)    # loads library, throws an error if not found
~~~
In the base.jl file replace "libcuda" with CUDA_LIB. (Line 9)

Another useful tool could be "SendTo" in the Windows explorer for .cu 
files, to be compiled to .ptx files with a couple mouse clicks.
Simply right click on a .cu file, and select Send to > in the context menu, 
and !nvcc in the new popup window. To make it work do the following.

1. Create a batch file, named !nvcc.bat, anywhere you like in a local disk. 
It has to contain the following lines:
~~~
@echo off
REM Go to the drive of parameter1; cd to its path; run nvcc with the 
filename
%~d1
cd "%~p1"
"%CUDA_PATH%\bin\nvcc.exe" -ptx %~nx1
pause
~~~

2. In Windows explorer navigate to %APPDATA%\Microsoft\Windows\SendTo\

3. Create a link to the !nvcc.bat file just created. (Right-drag to here, 
select: Create shortcuts here)

Now a new entry appears in the SendTo menu, !nvcc. If a .cu file is sent to 
there, it will be compiled to .ptx in the same directory, ready to be used 
by the CUDA package.

Reply via email to