diff --git a/doc/ref_kernel.rst b/doc/ref_kernel.rst index 409cbef576d654be973dd6d1424ac40d3ea60982..af35221ad5dcd736190e40a454656a7fa069a787 100644 --- a/doc/ref_kernel.rst +++ b/doc/ref_kernel.rst @@ -151,6 +151,42 @@ Tag Meaning .. }}} +Identifiers +----------- + +Reserved Identifiers +^^^^^^^^^^^^^^^^^^^^ + +The identifier prefix ``_lp_`` is reserved for internal usage; when creating +*inames*, *argument names*, *temporary variable names*, *substitution rule +names*, *instruction IDs*, and other identifiers, users should *not* use names +beginning with ``_lp_``. This prefix is used for identifiers created +internally when operating on Loopy's kernel IR. For Loopy developers, further +information on name prefixes used within submodules is below. + +Identifier Registry +^^^^^^^^^^^^^^^^^^^ + +Functionality in :mod:`loopy` *must* use identifiers beginning with ``_lp_`` for +all internally-created identifiers. Additionally, each name beginning with +``_lp_`` must start with one of the reserved prefixes below. New prefixes may +be registered by adding them to the table below. New prefixes may not themselves +be the prefix of an existing prefix. + +**Reserved Identifier Prefixes** + +======================= ================================== +Reserved Prefix Usage (module or purpose) +======================= ================================== +``_lp_linchk_`` :mod:`loopy.linearization.checker` +======================= ================================== + +.. note:: + + Existing Loopy code may not yet fully satisfy these naming requirements. + Name changes are in progress, and prefixes will be added to this registry + as they are created. + .. _instructions: Instructions diff --git a/loopy/target/pyopencl.py b/loopy/target/pyopencl.py index 826ba2a8f09b8a19d19200ef6d936a8276cf3688..845e0a4326dbb24e509f98c808a9ce3ac3cb52be 100644 --- a/loopy/target/pyopencl.py +++ b/loopy/target/pyopencl.py @@ -1,3 +1,4 @@ +# coding: utf-8 """OpenCL target integrated with PyOpenCL.""" from __future__ import division, absolute_import @@ -285,6 +286,9 @@ class PyOpenCLTarget(OpenCLTarget): warnings) and support for complex numbers. """ + # FIXME make prefixes conform to naming rules + # (see Reference: Loopy’s Model of a Kernel) + host_program_name_prefix = "_lpy_host_" host_program_name_suffix = ""