How to specify architecture while compiling CUDA program in Visual profiler How to change command line flag in CUDA
How to specify architecture
while compiling CUDA program in Visual profiler
How to change command
line flag in CUDA
Hello, today I’ll let you know how to change compilation
option such as flag in visual profiler. Sometimes it happens we need to specify
the architecture of our GPU to run any sample code. For example, if your code
contain “atomicAdd()” function then you SM architecture
should be > SM10, although you SM architecture is greater than 1.0 but you can’t Build your project in Visual profiler because of compiler flag is SM10. When you try to do this visual profiler through an error like this;
should be > SM10, although you SM architecture is greater than 1.0 but you can’t Build your project in Visual profiler because of compiler flag is SM10. When you try to do this visual profiler through an error like this;
atomicAdd undefined identifier
|
In this case you specifically, specify architecture greater
than SM10 in compiler flag.
Let us compile our code using command line;
nvcc –arch=sm__30
|
Same you want to do in your visual profiler. So you need to
change this line
nvcc -gencode=arch=compute_10,code=\"sm_30,compute_30\
|
To
nvcc -gencode=arch=compute_30,code=\"sm_30,compute_30\
|
Procedure to achieve this;
Step 1: Open your project properties
Step 2: Go to your GPU option
Step 3: Change GPU architecture
value to required SM value, in this case I have change it from SM10 to SM30
Step 4 : You are done
Got Questions?
Feel free to ask me any question by
commenting below because I'd be happy to walk you through step by step!
Want to Contact us? Click here










