diff --git a/loopy/codegen/__init__.py b/loopy/codegen/__init__.py index 57bf4c6a8aa31c3c5aad3be3b34ccbab7caa9b37..4d847612bc517056a8d3ab4ef25437d7348bb321 100644 --- a/loopy/codegen/__init__.py +++ b/loopy/codegen/__init__.py @@ -513,7 +513,7 @@ def generate_code_v2(kernel): _DataObliviousInstruction)): pass else: - raise NotImplementedError("register_knl not made for %s type of" + raise NotImplementedError("register_knl not made for %s type of " "instruciton" % (str(type(insn)))) # }}} diff --git a/loopy/codegen/auxiliary_kernels.py b/loopy/codegen/auxiliary_kernels.py index 799ab59bf5e78fcac58bb71e6e9b61ffc7aa4b22..6c4166bd39e3cac76fc5fde3453d7bc3550ea9e2 100644 --- a/loopy/codegen/auxiliary_kernels.py +++ b/loopy/codegen/auxiliary_kernels.py @@ -153,7 +153,7 @@ def generate_auxiliary_kernel_device_code(kernel, target): _DataObliviousInstruction)): pass else: - raise NotImplementedError("register_knl not made for %s type of" + raise NotImplementedError("register_knl not made for %s type of " "instruciton" % (str(type(insn)))) # }}} diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index 25737786cdf2fb4fdda115a22c5e644bfabbebe6..b87e55ca99996a4bdd799373c8e142d7f8414501 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -143,7 +143,6 @@ class LoopKernel(ImmutableRecordWithoutPickling): to instances of :class:`loopy.kernel.data.IndexTag`. .. attribute:: function_manglers - .. attribute:: function_identifiers .. attribute:: symbol_manglers .. attribute:: substitutions @@ -201,7 +200,6 @@ class LoopKernel(ImmutableRecordWithoutPickling): default_function_mangler, single_arg_function_mangler, ], - function_identifiers=set(), scoped_functions={}, symbol_manglers=[], @@ -268,10 +266,6 @@ class LoopKernel(ImmutableRecordWithoutPickling): assert all(dom.get_ctx() == isl.DEFAULT_CONTEXT for dom in domains) assert assumptions.get_ctx() == isl.DEFAULT_CONTEXT - # Populating the function identifiers based on the target and the default - # function identifiers - function_identifiers = target.get_device_ast_builder().function_identifiers() - ImmutableRecordWithoutPickling.__init__(self, domains=domains, instructions=instructions, @@ -291,7 +285,6 @@ class LoopKernel(ImmutableRecordWithoutPickling): cache_manager=cache_manager, applied_iname_rewrites=applied_iname_rewrites, function_manglers=function_manglers, - function_identifiers=function_identifiers, scoped_functions=scoped_functions, symbol_manglers=symbol_manglers, index_dtype=index_dtype, @@ -350,6 +343,14 @@ class LoopKernel(ImmutableRecordWithoutPickling): # }}} + # {{{ target function identifiers + + @property + def function_identifiers(self): + return self.target.get_device_ast_builder().function_identifiers() + + # }}} + # {{{ symbol mangling def mangle_symbol(self, ast_builder, identifier): diff --git a/loopy/kernel/creation.py b/loopy/kernel/creation.py index b8100f3ab05fd0fd5579160bcd0fbf6e9bca18f0..b97639c910f26b1390314c7364643de87ef9889d 100644 --- a/loopy/kernel/creation.py +++ b/loopy/kernel/creation.py @@ -1974,7 +1974,7 @@ class ScopedFunctionCollector(CombineMapper): def scope_functions(kernel): - func_ids = kernel.function_identifiers.copy() + func_ids = kernel.function_identifiers from loopy.kernel.instruction import CInstruction, _DataObliviousInstruction function_scoper = FunctionScoper(func_ids) diff --git a/loopy/library/random123.py b/loopy/library/random123.py index b28d11ba6f9948094a966eddae6c521dc0565121..5cc3dd9ce9d3befc2ccbb5112e549a4d40124093 100644 --- a/loopy/library/random123.py +++ b/loopy/library/random123.py @@ -225,6 +225,7 @@ def random123_function_mangler(kernel, name, arg_dtypes): def random123_with_types(in_knl_callable, arg_id_to_dtype, target): + # FIXME: Translate the mangler to this. name = in_knl_callable.name if name not in FUNC_NAMES_TO_RNG: