#NEWLINE# def check_cuda_version( compiler , settings ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# out = build_and_run ( compiler , '\n        #include <cuda.h>\n        #include <stdio.h>\n        int main(int argc, char* argv[]) {\n          printf("%d", CUDA_VERSION);\n          return 0;\n        }\n        ' , include_dirs = settings [ 'include_dirs' ] ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# utils . print_warning ( 'Cannot check CUDA version' , str ( compiler ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# cuda_version = int ( out ) #NEWLINE# if ( cuda_version < minimum_cuda_version ) : #NEWLINE# #INDENT# utils . print_warning ( ( 'CUDA version is too old: %d' % cuda_version ) , 'CUDA v6.5 or newer is required' ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True