Skip to content

Commit

Permalink
[Bug] Remove the dataclass decorator from CuptiMetric, as it is not s…
Browse files Browse the repository at this point in the history
…upported in Python 3.6
  • Loading branch information
yolo2themoon committed Oct 21, 2021
1 parent 53e04c6 commit 07b3b22
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions python/taichi/profiler/kernelmetrics.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from dataclasses import dataclass

from taichi.core import ti_core as _ti_core


@dataclass
class CuptiMetric:
"""A data class to add CUPTI metric for :class:`~taichi.lang.KernelProfiler`.
"""A class to add CUPTI metric for :class:`~taichi.lang.KernelProfiler`.
This data class is designed to add user selected CUPTI metrics.
This class is designed to add user selected CUPTI metrics.
Only available for the CUDA backend now, i.e. you need ``ti.init(kernel_profiler=True, arch=ti.cuda)``.
For usage of this class, see examples in func :func:`~taichi.lang.set_kernel_profile_metrics` and :func:`~taichi.lang.collect_kernel_profile_metrics`.
Expand Down Expand Up @@ -49,10 +46,15 @@ class CuptiMetric:
Note:
For details about using CUPTI in Taichi, please visit https://docs.taichi.graphics/docs/lang/articles/misc/profiler#advanced-mode.
"""
name: str = ''
header: str = ''
format: str = ''
scale: float = 1.0
def __init__(self,
name='',
header='unnamed_header',
format=' {:8.0f} ',
scale=1.0):
self.name = name
self.header = header
self.format = format
self.scale = scale


# Global Memory Metrics
Expand Down

0 comments on commit 07b3b22

Please sign in to comment.