Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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()))
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,
def __init__(self):
Record.__init__(self, gpudata=0)
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)
def __init__(self, name, arguments, expression):
assert isinstance(arguments, tuple)
Record.__init__(self,
name=name, arguments=arguments, expression=expression)
def __init__(self, *args, **kwargs):
if 'features' not in kwargs:
kwargs['features'] = set()
Record.__init__(self, *args, **kwargs)
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,
)
def __init__(self, loop_end=n):
Record.__init__(self, loop_end=loop_end)
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())