def gridsize_expand(ndim):
 if (ndim == 1):
  fname = 'ptx.gridsize.1d'
  restype = types.int32
 elif (ndim == 2):
  fname = 'ptx.gridsize.2d'
  restype = types.UniTuple(types.int32, 2)
 elif (ndim == 3):
  fname = 'ptx.gridsize.3d'
  restype = types.UniTuple(types.int32, 3)
 else:
  raise ValueError('argument can only be 1, 2 or 3')
 return ir.Intrinsic(fname, typing.signature(restype, types.intp), args=[ndim])

def gridsize_expand ( ndim ) : if ( ndim == 1 ) : fname = 'ptx.gridsize.1d' restype = types . int32 elif ( ndim == 2 ) : fname = 'ptx.gridsize.2d' restype = types . UniTuple ( types . int32 , 2 ) elif ( ndim == 3 ) : fname = 'ptx.gridsize.3d' restype = types . UniTuple ( types . int32 , 3 ) else : raise ValueError ( 'argument can only be 1, 2 or 3' ) return ir . Intrinsic ( fname , typing . signature ( restype , types . intp ) , args = [ ndim ] )
return the absolute size in threads of the entire grid of blocks .