def _get_kernel_name():
 names = ['kernel']
 if ('NVPROF_ID' in os.environ):
  for frame in tb.extract_stack():
   if nrv_re.search(frame[0]):
    break
   caller = frame[0:2]
  (file_path, file_name) = os.path.split(caller[0])
  (path1, path2) = os.path.split(file_path)
  (file_base, ext) = os.path.splitext(file_name)
  for name in (path2, file_base, ext):
   name = name_re.sub('', name)
   if name:
    names.append(name)
  names.append(native_str(caller[1]))
 return names

def _get_kernel_name ( ) : names = [ 'kernel' ] if ( 'NVPROF_ID' in os . environ ) : for frame in tb . extract_stack ( ) : if nrv_re . search ( frame [ 0 ] ) : break caller = frame [ 0 : 2 ] ( file_path , file_name ) = os . path . split ( caller [ 0 ] ) ( path1 , path2 ) = os . path . split ( file_path ) ( file_base , ext ) = os . path . splitext ( file_name ) for name in ( path2 , file_base , ext ) : name = name_re . sub ( '' , name ) if name : names . append ( name ) names . append ( native_str ( caller [ 1 ] ) ) return names
returns the path of the kernel .