Since CUDA 9.0 doesn't support sm_20 and sm_21 anymore. This PR allows Caffe to compile with CUDA 9.0 and newer versions successfully.
This addresses the discussion concerning [#6237](https://github.com/BVLC/caffe/pull/6237) in [master (#6237)](https://github.com/BVLC/caffe/commit/
cb150eca6d593ddb85e53acd05b8dcf709ea8337#diff-
2004a3d3e6b4ed2e2812bb0b4b998f18)
set(__nvcc_flags "")
set(__nvcc_archs_readable "")
- string(COMPARE GREATER_EQUAL "${CUDA_VERSION}" "9.1" iscudanewerthan91)
- if(iscudanewerthan91)
+ string(COMPARE GREATER_EQUAL "${CUDA_VERSION}" "9.0" iscudanewerthan90)
+ if(iscudanewerthan90)
string(REPLACE "21(20)" "" __cuda_arch_bin "${__cuda_arch_bin}")
string(REPLACE "20" "" __cuda_arch_bin "${__cuda_arch_bin}")
endif()