Changing architecture on code blocks


I’m using code blocks for developing my code and I need to use atomicAdds in my program. I don’t know how to set the architecture to the one that I’m currently using on my GPU. I know the flag is -arch=sm_20 but I don’t know in which part of my project’s properties I have to set it. That’s why I get the following error:

error: identifier "atomicAdd" is undefined|

If someone can guide me I’ll really appreciate it :smile:

When you compile a program on linux you just write in the prompt: nvcc -arch=sm_20 and it will compile your code.

There seems no project property can use, so I just modify the compiler setting.

I follow this blog to create CUDA NVCC Compiler

Setting->Compiler and Debugger->CUDA NVCC Compiler->Other Settings->Advanced options->Compile single file to object file

Command line macro:

$compiler --compiler-options “$options” $includes -c $file -o $object -arch=sm_20

Thanks a lot! it works! :thanks: