what does -arch and -code flags do?

does anyone know what these parameters do? i have the settings: -arch compute_13 -code sm_13.

i cant remeber the settings i had before on MSVS which i had to change; reason being that before i was trying to take the absolute values of a double array but it simply wouldnt work. infact i had put

if (i<elements)
doublearray[i]=2.02;

and that didnt work. it started working when i changed the setting to:
compile name 1.3 (virtual) ARCH (aside why doesnt it let me have this as hardware ARCH)
code name 1.3 (hardware) CODE

but now that i changed it back to:

if (i<elements)
if doublearray[i]<0
doublearray[i]=-doublearray[i];

it still spits out 2.02

any thoughts

thanx
sachin

any ideas

The meaning of arch and code can be found in the NVCC manual included in the doc directory of the toolkit install:

From nvcc_2.1.pdf

Compute computability (See programming guide appendix A for list of device compute capabilities) 1.3 (-arch compute_13) is the only one that supports double precision format. When you put in a number such as

2.02

, it automatically gets promoted to a double. If you want it to be a float instead, you have to put a ‘f’ after it:

2.02f

.

Long story short, if you don’t need the double precision on a number, make sure to add the f!

As a side note, it looks like NVIDIA needs to update the supported architectures list to include 1.3, it’s excluded even from the 2.3 beta nvcc pdf.