Ejemplo n.º 1
0
class blockDim(Stub):
    '''
    The shape of a block of threads, as declared when instantiating the
    kernel.  This value is the same for all threads in a given kernel, even
    if they belong to different blocks (i.e. each block is "full").
    '''
    x = Macro('ntid.x', SREG_SIGNATURE)
    y = Macro('ntid.y', SREG_SIGNATURE)
    z = Macro('ntid.z', SREG_SIGNATURE)
Ejemplo n.º 2
0
class gridDim(Stub):
    '''
    The shape of the grid of blocks, accressed through the attributes ``x``,
    ``y``, and ``z``.
    '''
    _description_ = '<gridDim.{x,y,z}>'
    x = Macro('nctaid.x', SREG_SIGNATURE)
    y = Macro('nctaid.y', SREG_SIGNATURE)
    z = Macro('nctaid.z', SREG_SIGNATURE)
Ejemplo n.º 3
0
class gridDim(Stub):
    """
    The shape of the grid of blocks, accressed through the attributes ``x``,
    ``y``, and ``z``.
    """

    _description_ = "<gridDim.{x,y,z}>"
    x = Macro("nctaid.x", SREG_SIGNATURE)
    y = Macro("nctaid.y", SREG_SIGNATURE)
    z = Macro("nctaid.z", SREG_SIGNATURE)
Ejemplo n.º 4
0
class blockIdx(Stub):
    '''
    The block indices in the grid of thread blocks, accessed through the
    attributes ``x``, ``y``, and ``z``. Each index is an integer spanning the
    range from 0 inclusive to the corresponding value of the attribute in
    :attr:`numba.cuda.gridDim` exclusive.
    '''
    _description_ = '<blockIdx.{x,y,z}>'

    x = Macro('ctaid.x', SREG_SIGNATURE)
    y = Macro('ctaid.y', SREG_SIGNATURE)
    z = Macro('ctaid.z', SREG_SIGNATURE)
Ejemplo n.º 5
0
class threadIdx(Stub):
    """
    The thread indices in the current thread block, accessed through the
    attributes ``x``, ``y``, and ``z``. Each index is an integer spanning the
    range from 0 inclusive to the corresponding value of the attribute in
    :attr:`numba.cuda.blockDim` exclusive.
    """

    _description_ = "<threadIdx.{x,y,z}>"

    x = Macro("tid.x", SREG_SIGNATURE)
    y = Macro("tid.y", SREG_SIGNATURE)
    z = Macro("tid.z", SREG_SIGNATURE)
Ejemplo n.º 6
0
class shared(Stub):
    """shared namespace"""

    _description_ = "<shared>"

    array = Macro("shared.array",
                  shared_array,
                  callable=True,
                  argnames=["shape", "dtype"])
Ejemplo n.º 7
0
class shared(Stub):
    """shared namespace
    """
    _description_ = '<shared>'

    array = Macro('shared.array',
                  shared_array,
                  callable=True,
                  argnames=['shape', 'dtype'])
Ejemplo n.º 8
0
class const(Stub):
    '''
    Constant memory namespace.
    '''
    _description_ = '<const>'

    array_like = Macro('const.array_like', const_array_like,
                             callable=True, argnames=['ary'])
    '''
Ejemplo n.º 9
0
class local(Stub):
    '''
    Local memory namespace.
    '''
    _description_ = '<local>'

    array = Macro('local.array', local_array, callable=True,
                        argnames=['shape', 'dtype'])
    '''
Ejemplo n.º 10
0
class const(Stub):
    """
    Constant memory namespace.
    """

    _description_ = "<const>"

    array_like = Macro("const.array_like",
                       const_array_like,
                       callable=True,
                       argnames=["ary"])
    """
Ejemplo n.º 11
0
class local(Stub):
    """
    Local memory namespace.
    """

    _description_ = "<local>"

    array = Macro("local.array",
                  local_array,
                  callable=True,
                  argnames=["shape", "dtype"])
    """
Ejemplo n.º 12
0
    y = Macro('ntid.y', SREG_SIGNATURE)
    z = Macro('ntid.z', SREG_SIGNATURE)


class gridDim(Stub):
    '''
    The shape of the grid of blocks, accressed through the attributes ``x``,
    ``y``, and ``z``.
    '''
    _description_ = '<gridDim.{x,y,z}>'
    x = Macro('nctaid.x', SREG_SIGNATURE)
    y = Macro('nctaid.y', SREG_SIGNATURE)
    z = Macro('nctaid.z', SREG_SIGNATURE)


warpsize = Macro('warpsize', SREG_SIGNATURE)
laneid = Macro('laneid', SREG_SIGNATURE)

#-------------------------------------------------------------------------------
# Grid Macro

def _ptx_grid1d(): pass


def _ptx_grid2d(): pass


def grid_expand(ndim):
    """grid(ndim)

    Return the absolute position of the current thread in the entire
Ejemplo n.º 13
0
    z = Macro("ntid.z", SREG_SIGNATURE)


class gridDim(Stub):
    """
    The shape of the grid of blocks, accressed through the attributes ``x``,
    ``y``, and ``z``.
    """

    _description_ = "<gridDim.{x,y,z}>"
    x = Macro("nctaid.x", SREG_SIGNATURE)
    y = Macro("nctaid.y", SREG_SIGNATURE)
    z = Macro("nctaid.z", SREG_SIGNATURE)


warpsize = Macro("warpsize", SREG_SIGNATURE)
laneid = Macro("laneid", SREG_SIGNATURE)

# -------------------------------------------------------------------------------
# Grid Macro


def _ptx_grid1d():
    pass


def _ptx_grid2d():
    pass


def grid_expand(ndim):