Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Remove the dataclass decorator from CuptiMetric, as it is not supported in Python 3.6 #3246

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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