mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
[FRONTEND] decorating static methods with @staticmethod (#1069)
This commit is contained in:
@@ -1619,7 +1619,8 @@ class CudaUtils(object):
|
||||
cls.instance = super(CudaUtils, cls).__new__(cls)
|
||||
return cls.instance
|
||||
|
||||
def _generate_src(self):
|
||||
@staticmethod
|
||||
def _generate_src():
|
||||
return """
|
||||
#include <cuda.h>
|
||||
|
||||
|
||||
@@ -139,13 +139,16 @@ class dtype:
|
||||
def is_bool(self):
|
||||
return self.is_int1()
|
||||
|
||||
def is_void(self):
|
||||
@staticmethod
|
||||
def is_void():
|
||||
raise RuntimeError("Not implemented")
|
||||
|
||||
def is_block(self):
|
||||
@staticmethod
|
||||
def is_block():
|
||||
return False
|
||||
|
||||
def is_ptr(self):
|
||||
@staticmethod
|
||||
def is_ptr():
|
||||
return False
|
||||
|
||||
def __eq__(self, other: dtype):
|
||||
|
||||
@@ -157,7 +157,8 @@ class Libdevice(ExternLibrary):
|
||||
super().__init__("libdevice", path)
|
||||
self._symbol_groups = {}
|
||||
|
||||
def _extract_symbol(self, line) -> Optional[Symbol]:
|
||||
@staticmethod
|
||||
def _extract_symbol(line) -> Optional[Symbol]:
|
||||
# Extract symbols from line in the following format:
|
||||
# "define [internal] <ret_type> @<name>(<arg_types>,)"
|
||||
entries = line.split("@")
|
||||
|
||||
@@ -33,7 +33,8 @@ class MockTensor:
|
||||
def __init__(self, dtype):
|
||||
self.dtype = dtype
|
||||
|
||||
def data_ptr(self):
|
||||
@staticmethod
|
||||
def data_ptr():
|
||||
return 0 # optimistically assumes multiple of 16
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user