.. default-domain:: chpl .. module:: GpuDiagnostics :synopsis: Supports counting and reporting GPU operations. GpuDiagnostics ============== **Usage** .. code-block:: chapel use GpuDiagnostics; or .. code-block:: chapel import GpuDiagnostics; Supports counting and reporting GPU operations. .. warning:: This module is unstable and its interface is subject to change in the future. GPU support is a relatively new feature to Chapel and is under active development. For the most up-to-date information about GPU support see the :ref:`technical note ` about it. .. record:: chpl_gpuDiagnostics Aggregated GPU operation counts. ``host_to_device``, ``device_to_host`` and ``device_to_device`` will be non-zero only when ``CHPL_GPU_MEM_STRATEGY==array_on_device`` and ``CHPL_GPU!=cpu``. .. attribute:: var kernel_launch: uint(64) .. attribute:: var host_to_device: uint(64) .. attribute:: var device_to_host: uint(64) .. attribute:: var device_to_device: uint(64) .. type:: type gpuDiagnostics = chpl_gpuDiagnostics The Chapel record type inherits the runtime definition of it. .. function:: proc startVerboseGpu() Start on-the-fly reporting of GPU operations initiated on any locale. .. function:: proc stopVerboseGpu() Stop on-the-fly reporting of GPU operations initiated on any locale. .. function:: proc startGpuDiagnostics() Start counting GPU operations across the whole program. .. function:: proc stopGpuDiagnostics() Stop counting GPU operations across the whole program. .. function:: proc resetGpuDiagnostics() Reset aggregate GPU operation counts across the whole program. .. function:: proc getGpuDiagnostics() Retrieve aggregate GPU operation counts for the whole program. :returns: array of counts of GPU ops initiated on each locale :rtype: `[LocaleSpace] gpuDiagnostics`