def gen_arg_addrspace_md(fn):
 mod = fn.module
 fnty = fn.type.pointee
 codes = []
 for a in fnty.args:
  if cgutils.is_pointer(a):
   codes.append(SPIR_GLOBAL_ADDRSPACE)
  else:
   codes.append(SPIR_PRIVATE_ADDRSPACE)
 consts = [lc.Constant.int(lc.Type.int(), x) for x in codes]
 name = lc.MetaDataString.get(mod, 'kernel_arg_addr_space')
 return lc.MetaData.get(mod, ([name] + consts))

def gen_arg_addrspace_md ( fn ) : mod = fn . module fnty = fn . type . pointee codes = [ ] for a in fnty . args : if cgutils . is_pointer ( a ) : codes . append ( SPIR_GLOBAL_ADDRSPACE ) else : codes . append ( SPIR_PRIVATE_ADDRSPACE ) consts = [ lc . Constant . int ( lc . Type . int ( ) , x ) for x in codes ] name = lc . MetaDataString . get ( mod , 'kernel_arg_addr_space' ) return lc . MetaData . get ( mod , ( [ name ] + consts ) )
generate kernel_arg_addr_space metadata .