Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(13)  |  Derive(0)  |  Import(3)

src/b/l/blaze-0.1/blaze/datadescriptor/broadcast_ckernel.py   blaze(Download)
 
from ..error import BroadcastError
from ..py3help import izip
 
from .as_py import dd_as_py
                se = src.element_read_iter()
                with dst.element_write_iter() as de:
                    for dst_ptr, src_ptr in izip(de, se):
                        ck(dst_ptr, src_ptr)
        else:
                    execute_unary_single(dst_dd, src_dd, dst_ds, src_ds, ck)
            else:
                for dst_dd, src_dd in izip(dst, src):
                    execute_unary_single(dst_dd, src_dd, dst_ds, src_ds, ck)
 
        raise ValueError('The length of src_list and src_ds_list must match')
    src_ndim_list = [len(src.dshape) - len(src_ds)
                    for src, src_ds in izip(src_list, src_ds_list)]
    dst_ndim = len(dst.dshape) - len(dst_ds)
    for src, src_ds, src_ndim in izip(src_list, src_ds_list, src_ndim_list):

src/b/l/blaze-0.1/blaze/executive/simple_exec.py   blaze(Download)
from itertools import product as it_product
import ctypes
from ..py3help import izip
 
from ..datashape.util import to_ctypes
 
            arg_structs = [arg_type._type_(None, shape)
                           for arg_type, shape in izip(cfunc.argtypes,
                                                       shapes)]
 
        with dd.element_appender() as dst:
            for element in it_product(*[xrange(x) for x in self.outer_dims]):
                for struct, reader, typ in izip(arg_s[:-1], r,
                                                self.c_types[:-1]):
                    self._patch(struct, reader.read_single(element), typ)
        dst = dd.element_writer(len(self.outer_dims))
        for element in it_product(*[xrange(x) for x in self.outer_dims]):
            for struct, reader, typ in izip(arg_s[:-1], r, self.c_types[:-1]):
                self._patch(struct, reader.read_single(element), typ)
            with dst.buffered_ptr(element) as dst_buf:
        # Will patch the pointer to data later..
        arg_structs = [arg_type._type_(None, shape)
                       for arg_type, shape in izip(cfunc.argtypes, shapes)]
 
        self.cfunc = cfunc # kernel to call...

src/b/l/blaze-0.1/blaze/blaze_kernels.py   blaze(Download)
from .ckernel import (ExprSingleOperation, JITKernelData,
                UnboundCKernelFunction)
from .py3help import izip, _strtypes, c_ssize_t
from .datashape import Fixed, TypeVar
from .datashape.util import to_ctypes, dshape as make_dshape
            kernel_data_fields = [Type.struct([i8_p_type]*3)]
            kernel_data_ctypes_fields = [('base', JITKernelData)]
            for i, (kind, a) in enumerate(izip(self.kinds, self.argtypes)):
                if isinstance(kind, tuple):
                    if kind[0] != lla.C_CONTIGUOUS:
            # appropriate kinds for the llvm call
            args = []
            for i, (kind, atype) in enumerate(izip(self.kinds[:-1], self.argtypes)):
                if kind == SCALAR:
                    src_ptr = builder.bitcast(builder.load(
                def bind_func(estruct, dst_dd, src_dd_list):
                    for i, (ds, dd) in enumerate(
                                    izip(self.dshapes, src_dd_list + [dst_dd])):
                        shape = [operator.index(dim)
                                        for dim in dd.dshape[-len(ds):-1]]