#NEWLINE# def get_libdevice( arch ) : #NEWLINE# #INDENT# libdir = ( os . environ . get ( 'NUMBAPRO_LIBDEVICE' ) or os . environ . get ( 'NUMBAPRO_CUDALIB' ) ) #NEWLINE# pat = ( 'libdevice\\.%s(\\.\\d+)*\\.bc$' % arch ) #NEWLINE# candidates = find_file ( re . compile ( pat ) , libdir ) #NEWLINE# return ( max ( candidates ) if libdir else None )