# Path: ANNarchy/generator/Profile/ProfileTemplate.py



from ANNarchy.core import Global
from .ProfileGenerator import ProfileGenerator
from .ProfileTemplate import papi_profile_template, papi_profile_header
        return prof_code

    def annotate_computesum_spiking(self, proj, code):
        """
        annotate the computesum compuation code
        """
        prof_begin = papi_profile_template['compute_psp']['before'] % {'name': 'proj'+str(proj.id)}
        prof_end = papi_profile_template['compute_psp']['after'] % {'name': 'proj'+str(proj.id)}

        prof_code = """
        // first run, measuring average time
        %(prof_begin)s
%(code)s
        %(prof_end)s
""" % {'code': code,
       'prof_begin': prof_begin,
       'prof_end': prof_end
       }
        return prof_code

    def annotate_update_synapse(self, proj, code):
        """
        annotate the update synapse code, generated by ProjectionGenerator.update_synapse()
        """
        prof_begin = papi_profile_template['update_synapse']['before']
        prof_end = papi_profile_template['update_synapse']['after']

        prof_code = """
// first run, measuring average time
%(prof_begin)s

# Path: ANNarchy/generator/Profile/ProfileTemplate.py



# Path: ANNarchy/generator/Profile/PAPIProfile.py
from ANNarchy.core import Global
from .ProfileGenerator import ProfileGenerator
from .ProfileTemplate import papi_profile_template, papi_profile_header

        return prof_code

    def annotate_computesum_spiking(self, proj, code):
        """
        annotate the computesum compuation code
        """
        prof_begin = papi_profile_template['compute_psp']['before'] % {'name': 'proj'+str(proj.id)}
        prof_end = papi_profile_template['compute_psp']['after'] % {'name': 'proj'+str(proj.id)}

        prof_code = """
        // first run, measuring average time
        %(prof_begin)s
%(code)s
        %(prof_end)s
""" % {'code': code,
       'prof_begin': prof_begin,
       'prof_end': prof_end
       }
        return prof_code

    def annotate_update_synapse(self, proj, code):
        """
        annotate the update synapse code, generated by ProjectionGenerator.update_synapse()
        """
        prof_begin = papi_profile_template['update_synapse']['before']
        prof_end = papi_profile_template['update_synapse']['after']

        prof_code = """
// first run, measuring average time
%(prof_begin)s

%(code)s