Search code examples
visual-studio-2012cudaatomic

error : identifier “atomicExch” is undefined under visual studio 2012 and cuda 7.5


I'm trying to compile a CUDA code under Visual Studio 2012 with CUDA 7.5 SDK but I'm getting an error

"error : identifier "atomicExch" is undefined".

So I tried to get some information from CUDA SDK Samples and some forums but I'm still unable to solve the problem.

Any suggestions or can someone help me how to solve this problem?


Solution

  • okay I finally solved it by adding the following to my code:

    // Compile kernel code for Compute 2.0 and above only
    
    #if __CUDA_ARCH__ >= 200
    
        // Device funtions on the GPU
    
    #endif