Hi. I would like to use some of the architecture specifying macro, which I believe is “CUDA_ARCH”. I was trying the following code, but the macro appears not to be defined. How can I get this to work?
#if __CUDA_ARCH__ < 200
// cache-shared memory configuring not possible, no cache
printf("Cache configuration not possible\n");
#else
cudaError_t errorCachePref1 = cudaFuncSetCacheConfig("...", cudaFuncCachePreferShared);
cudaError_t errorCachePref2 = cudaFuncSetCacheConfig("...", cudaFuncCachePreferShared);
printf("Cache configuration done\n");
#endif
}
I read a few things on other forums that CUDA_ARCH is not defined on the C compiler side, and is defined only on the CDA compiler side. The file I am using is a .cu file, and is supposed to be compiled with nvcc, so I am not sure what I should do to make this work.
Thanks