Skip to content

Commit 497babc

Browse files
committed
Remove main and callback decorators
1 parent 50cef31 commit 497babc

File tree

4 files changed

+0
-31
lines changed

4 files changed

+0
-31
lines changed

pykokkos/core/translators/members.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ def __init__(self):
3030

3131
self.pk_workunits: Dict[cppast.DeclRefExpr, ast.FunctionDef] = {}
3232
self.pk_functions: Dict[cppast.DeclRefExpr, ast.FunctionDef] = {}
33-
self.pk_mains: Dict[cppast.DeclRefExpr, ast.FunctionDef] = {}
34-
self.pk_callbacks: Dict[cppast.DeclRefExpr, ast.FunctionDef] = {}
3533

3634
self.classtype_methods: Dict[cppast.DeclRefExpr, List[cppast.DeclRefExpr]] = {}
3735

@@ -102,9 +100,6 @@ def extract(self, entity: PyKokkosEntity, classtypes: List[PyKokkosEntity]) -> N
102100
self.pk_functions = self.get_decorated_functions(
103101
AST, Decorator.KokkosFunction
104102
)
105-
self.pk_callbacks = self.get_decorated_functions(
106-
AST, Decorator.KokkosCallback
107-
)
108103
else:
109104
self.pk_workunits[cppast.DeclRefExpr(AST.name)] = AST
110105
self.pk_functions = self.get_decorated_functions(
@@ -113,10 +108,6 @@ def extract(self, entity: PyKokkosEntity, classtypes: List[PyKokkosEntity]) -> N
113108

114109
self.classtype_methods = self.get_classtype_methods(classtypes)
115110

116-
if len(self.pk_mains) > 1:
117-
print("ERROR: Only one pk.main function can be translated")
118-
sys.exit(1)
119-
120111
def get_fields(
121112
self, classdef: ast.ClassDef, source: Tuple[List[str], int], pk_import: str
122113
) -> Dict[cppast.DeclRefExpr, cppast.PrimitiveType]:

pykokkos/core/translators/static.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ def check_symbols(self, classtypes: List[PyKokkosEntity], path: str) -> None:
172172
symbols_pass = SymbolsPass(self.pk_members, self.pk_import, path)
173173

174174
error_messages: List[str] = []
175-
for AST in self.pk_members.pk_mains.values():
176-
error_messages.extend(symbols_pass.check_symbols(AST))
177175
for AST in self.pk_members.pk_workunits.values():
178176
error_messages.extend(symbols_pass.check_symbols(AST))
179177
for AST in self.pk_members.pk_functions.values():

pykokkos/interface/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@
3838
complex128,
3939
)
4040
from .decorators import (
41-
callback,
4241
classtype,
4342
Decorator,
4443
function,
4544
functor,
46-
main,
4745
workunit,
4846
)
4947
from .execution_policy import (

pykokkos/interface/decorators.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ class Decorator(Enum):
77
WorkUnit = "workunit"
88
KokkosClasstype = "classtype"
99
KokkosFunction = "function"
10-
KokkosMain = "main"
11-
KokkosCallback = "callback"
1210
Space = "space"
1311

1412
@staticmethod
@@ -27,14 +25,6 @@ def is_kokkos_classtype(decorator: str) -> bool:
2725
def is_kokkos_function(decorator: str) -> bool:
2826
return decorator == Decorator.KokkosFunction.value
2927

30-
@staticmethod
31-
def is_kokkos_main(decorator: str) -> bool:
32-
return decorator == Decorator.KokkosMain.value
33-
34-
@staticmethod
35-
def is_kokkos_callback(decorator: str) -> bool:
36-
return decorator == Decorator.KokkosCallback.value
37-
3828
@staticmethod
3929
def is_space(decorator: str) -> bool:
4030
return decorator == Decorator.Space.value
@@ -74,11 +64,3 @@ def classtype(func):
7464

7565
def function(func):
7666
return func
77-
78-
79-
def main(func):
80-
return func
81-
82-
83-
def callback(func):
84-
return func

0 commit comments

Comments
 (0)