I know that you can perform conditional compiling with CUDA using:
#ifdef __CUDA_ARCH__
// CUDA code
#else
// Non-CUDA code
#endif
However, the definition CUDA_ARCH is only available inside device functions. Is there a way to allow conditional condition in host function? Say I have inside my main:
int main() {
#ifdef __CUDA_ARCH__
// Launch CUDA kernel to perform calculation
#else
// Launch host functions instead (OpenMP or otherwise)
#endif
}