Help needed :- Error : expected ")" in Visual Studio 2005

Hi,

I am trying to parallelize some compute intensive portions of a complex set thermodynamic calculations for estimating wear of lining of furnace refractories. I have written two kernals and the bulk of the code is written in C++ and is being run in Visual Studio 2005. The complete program consists of a set of header files which contain function and global variable definitions. In the main program these custom made header files are #included. The problem is, when I try to compile the solution, two errors are thrown. Both the errors are the same and the error is,

                                  error : Expected ")"

The location of the errors are pinpointed to the beginning of two kernal function starting lines containing the global keyword. I am using SDK version 2.3 and I am using Tesla C1060 device with a compute capability of 1.3. Further, if I simply isolate and compile the kernal functions alone it compiles without any errors.However in this isolated file if I include the custom made header, the same error is encountered.

I am stuck with this problem for quite some time… Kindly help !!

So the header either contains a syntax error or some kind of host C++ construct which nvcc probably can’t parse correctly. The solution is probably to introduce a layer of abstraction by compiling the kernels separately with a C++ wrapper function and link against the resulting object file. You then access the kernels via the wrapper function.

Thanks a lot … I will try that out. But could you pls let me know the exact procedure to do it ?

I am not sure how you expect someone could describe the “exact procedure” for fixing a syntax error or propose a refactor of code they have seen’t to fix a problem described as vaguely as this one. And before you do the obvious, I also think it is unreasonable to post huge amounts of code and expect someone else to read and fix it for you.

I am too well aware of the etiquettes of a forum and I would never post chunks of useless code and waste my time and others, unless the problem is very specific!!

When I said exact procedure I meant to ask for the method or a link to information on how to create wrapper functions, as I am not well versed in the same.

Kindly do not get into advisory mode or draw conclusions before understanding the exact rationale behind questioner, however any technical suggestions would be gladly welcome.