Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29352 Discussions

Integrating CUDA2.0 into INTEL FORTRAN 10.1.025 under Visual Studio 2005

laddriteh_hr
Beginner
1,144 Views

I am running Intel Fortran Compiler 10.1.025 with Visual Studio 2005 under Vista. I was unable to integrate CUDA in fortran because I get following errors when building simple test.f file:

Linking...

Link: executing 'link'
test.obj : error LNK2019: unresolved external symbol _CUINIT referenced in function _MAIN__
test.obj : error LNK2019: unresolved external symbol _CUDEVICEGETCOUNT referenced in function _MAIN__
test.obj : error LNK2019: unresolved external symbol _CUDEVICEGET referenced in function _MAIN__
test.obj : error LNK2019: unresolved external symbol _CUDEVICEGETNAME referenced in function _MAIN__
Debug\GASS_EXAMPLE1.exe : fatal error LNK1120: 4 unresolved externals

Mentioned test.f file that calls CUDA functions is as follows:

program cuda_fortran_test
integer dev
character*256 n
print *,'Existing CUDA devices:'

call cuInit(0)
idevices = 0
call cuDeviceGetCount(idevices)
do i=1,idevices
call cuDeviceGet(dev, i-1)
call cuDeviceGetName(n, 256, dev)
print *,'Device ',i-1,': ',n
enddo
end

I have set environment var. PATH (in Windows Vista) to CUDAs bin, lin i
inc properly.

I also put cuda.lib in
C:\Program Files\Intel\Compiler\Fortran\10.1.025\IA32\Lib
folder.

I was unabel to integrate cuda.lib in Visual Studio Fortran properly I guess.
Maybe someone can help how to compile and build fortran program that calls cuda funcitions.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,144 Views

I am not familiar with the CUDA API but I'd expect that the routine names are mixed-case and Intel Fortran makes all names uppercase by default. My advice is to create a module with interface blocks for the CUDA routines using BIND(C,NAME="CudaRoutineName").

0 Kudos
Reply