You guys are telling that compilation of a complex and mixed code of MPI and CUDA is trivial and should perform OOTB, but it assumes that I am unable to get it. I have a little file that should compile a mixed MPI and CUDA code.
Code:
CC=nvcc
CFLAGS= -I/usr/local/mpich2-1.0.6.p1/include -I/usr/local/cuda/include -I/home/user/NVIDIA_CUDA_SDK/common/inc
LDFLAGS= -L/usr/local/mpich2-1.0.6.p1/lib -L/usr/local/cuda/lib -L/home/user/NVIDIA_CUDA_SDK/lib -L/home/user/NVIDIA_CUDA_SDK/common/lib
LIB= -lcuda -lcudart -lcutil -lm -lmpich -lpthread
SOURCES= Init.c main.c
EXECNAME= Exec
all:
$(CC) -o $(EXECNAME) $(SOURCES) $(LIB) $(LDFLAGS) $(CFLAGS)
And getting some error message and this is the piece of error message is as follows :
Init.c: In function ‘CUDAInit’:
Init.c:62: error: ‘cudaDeviceProp’ undeclared (first use in this function)
Init.c:62: error: (Each undeclared identifier is reported only once
Init.c:62: error: for each function it appears in.)
Init.c:62: error: expected ‘;’ before ‘deviceProp’
Init.c:63: error: ‘deviceProp’ undeclared (first use in this function)
Init.c:75: error: expected ‘;’ before ‘}’ token
Init.c:120: error: expected declaration or statement at end of input
make: *** [all] Error 255
Bookmarks