Graduate student at Rutgers assigned to porting a C/C++ CFD code to the tesla 2070 recently purchased.
This may be a C issue rather than a CUDA issue, but here it is:
I am getting a “1d_wave_approx.cu(39): error: expression must have arithmetic or enum type”. I assume is has to do with passing the 2-D array around incorrectly.
Any ideas?
This error typically occurs when a floating-point expression is used for indexing an array, which is not supported in C/C++. Staring at your code, I was unable to spot anything that’s not an integer. Could you attach a complete, self-contained (thus compilable) file that reproduces the problem? What toolchain are you using (which CUDA version)?
here is the entire script. i have the sdk 4.0.17 installed. i compile with nvcc -lcublas.
Is there a debugger I should know about? My gdb fails me once i get inside the triple angle braces.
thanks a lot. 1d_wave_approx.cu (1.48 KB)
You are inconsistently using [font=“Courier New”]*u[/font] in the declaration of u_approx () and [font=“Courier New”]u[/font] accessing it inside the function. Use the same in both places.
Thanks so much! The first sentence shed light on a mistake I made but couldn’t find out for 10 minutes. My mistake is exactly I used the wrong variable in a macro that’s calculating the index for an array. Appreciate the help!