def is_nvcc_available():
 def set_version():
  p_out = output_subprocess_Popen([nvcc_path, '--version'])
  ver_line = decode(p_out[0]).strip().split('\n')[(-1)]
  (build, version) = ver_line.split(',')[1].strip().split()
  assert (build == 'release')
  global nvcc_version
  nvcc_version = version
 try:
  set_version()
  return True
 except Exception:
  p = os.path.join(config.cuda.root, 'bin', 'nvcc')
  if os.path.exists(p):
   global nvcc_path
   nvcc_path = p
   try:
    set_version()
   except Exception:
    return False
   return True
  else:
   return False

def is_nvcc_available ( ) : def set_version ( ) : p_out = output_subprocess_Popen ( [ nvcc_path , '--version' ] ) ver_line = decode ( p_out [ 0 ] ) . strip ( ) . split ( '\n' ) [ ( - 1 ) ] ( build , version ) = ver_line . split ( ',' ) [ 1 ] . strip ( ) . split ( ) assert ( build == 'release' ) global nvcc_version nvcc_version = version try : set_version ( ) return True except Exception : p = os . path . join ( config . cuda . root , 'bin' , 'nvcc' ) if os . path . exists ( p ) : global nvcc_path nvcc_path = p try : set_version ( ) except Exception : return False return True else : return False
return true iff the nvcc compiler is found .