How to use the pytools.Record.__init__ function in pytools

To help you get started, we’ve selected a few pytools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inducer / sumpy / test / test_misc.py View on Github external
def __init__(self,
            source, center1, center2, target, expansion1, expansion2, conv_factor):

        if isinstance(conv_factor, str):
            conv_factor = self.eval(conv_factor, source, center1, center2, target)

        Record.__init__(self,
                source=source,
                center1=center1,
                center2=center2,
                target=target,
                expansion1=expansion1,
                expansion2=expansion2,
                conv_factor=conv_factor)
github inducer / hedge / hedge / bad_cell.py View on Github external
def __init__(self, **kwargs):
        from hedge.optemplate.primitives import make_common_subexpression as cse

        Record.__init__(self, dict((name, cse(expr, name))
            for name, expr in kwargs.iteritems()))
github inducer / loopy / loopy / kernel.py View on Github external
processed_args.append(new_arg)

        # }}}

        index_dtype = np.dtype(index_dtype)
        if index_dtype.kind != 'i':
            raise TypeError("index_dtype must be an integer")
        if np.iinfo(index_dtype).min >= 0:
            raise TypeError("index_dtype must be signed")

        if get_grid_sizes is not None:
            # overwrites method down below
            self.get_grid_sizes = get_grid_sizes

        Record.__init__(self,
                device=device, domains=domains,
                instructions=parsed_instructions,
                args=processed_args,
                schedule=schedule,
                name=name,
                preambles=preambles,
                preamble_generators=preamble_generators,
                assumptions=assumptions,
                iname_slab_increments=iname_slab_increments,
                temporary_variables=temporary_variables,
                local_sizes=local_sizes,
                iname_to_tag=iname_to_tag,
                iname_to_tag_requests=iname_to_tag_requests,
                substitutions=substitutions,
                cache_manager=cache_manager,
                applied_iname_rewrites=applied_iname_rewrites,
github inducer / hedge / hedge / backends / cuda / tools.py View on Github external
def __init__(self):
        Record.__init__(self, gpudata=0)
github inducer / loopy / loopy / kernel.py View on Github external
if shape is not None:
            shape = process_tuple(shape)

        if strides is None and shape is not None:
            from pyopencl.compyte.array import (
                    f_contiguous_strides,
                    c_contiguous_strides)

            if order == "F":
                strides = f_contiguous_strides(1, shape)
            elif order == "C":
                strides = c_contiguous_strides(1, shape)
            else:
                raise ValueError("invalid order: %s" % order)

        Record.__init__(self,
                name=name,
                dtype=dtype,
                strides=strides,
                offset=offset,
                shape=shape)
github inducer / loopy / loopy / kernel.py View on Github external
def __init__(self, name, arguments, expression):
        assert isinstance(arguments, tuple)

        Record.__init__(self,
                name=name, arguments=arguments, expression=expression)
github inducer / codepy / codepy / toolchain.py View on Github external
def __init__(self, *args, **kwargs):
        if 'features' not in kwargs:
            kwargs['features'] = set()
        Record.__init__(self, *args, **kwargs)
github inducer / loopy / loopy / options.py View on Github external
write_wrapper=False, highlight_wrapper=False,
            write_cl=False, highlight_cl=False,
            edit_cl=False, cl_build_options=[],
            allow_terminal_colors=None,
            disable_global_barriers=False,
            ):

        if allow_terminal_colors is None:
            try:
                import colorama  # noqa
            except ImportError:
                allow_terminal_colors = False
            else:
                allow_terminal_colors = True

        Record.__init__(
                self,

                annotate_inames=annotate_inames,
                trace_assignments=trace_assignments,
                trace_assignment_values=trace_assignment_values,
                ignore_boostable_into=ignore_boostable_into,
                eliminate_common_subscripts=eliminate_common_subscripts,

                skip_arg_checks=skip_arg_checks, no_numpy=no_numpy,
                return_dict=return_dict,
                write_wrapper=write_wrapper, highlight_wrapper=highlight_wrapper,
                write_cl=write_cl, highlight_cl=highlight_cl,
                edit_cl=edit_cl, cl_build_options=cl_build_options,
                allow_terminal_colors=allow_terminal_colors,
                disable_global_barriers=disable_global_barriers,
                )
github inducer / hedge / hedge / timestep / multirate_ab / methods.py View on Github external
def __init__(self, loop_end=n):
        Record.__init__(self, loop_end=loop_end)
github inducer / hedge / hedge / backends / mpi / __init__.py View on Github external
def __init__(
            self,
            mesh,
            global2local_elements,
            global2local_vertex_indices,
            neighbor_ranks,
            global_periodic_opposite_faces,
            old_el_numbers=None,
            tag_to_elements=None
            ):
        pytools.Record.__init__(self, locals())