Skip to content

add_barrier_cross_sync#139

Open
SHshenhao wants to merge 1 commit intomainfrom
sh/cross
Open

add_barrier_cross_sync#139
SHshenhao wants to merge 1 commit intomainfrom
sh/cross

Conversation

@SHshenhao
Copy link
Collaborator

@SHshenhao SHshenhao commented Jan 26, 2026

Introduce a new DSL primitive barrier_cross_sync that automatically emits the previously hand-written pair
set_cross_flag+ wait_cross_flag inside for-loops with async_task.

@CLAassistant
Copy link

CLAassistant commented Jan 26, 2026

CLA assistant check
All committers have signed the CLA.

Comment on lines +80 to +91
+ def __get_async_task(node):
+ if not isinstance(node, ast.With):
+ return ""
+ for item in node.items:
+ context_expr = item.context_expr
+ if isinstance(context_expr, ast.Call):
+ func = context_expr.func
+ if isinstance(func, ast.Attribute):
+ if func.attr == 'async_task':
+ for keyword in context_expr.keywords:
+ if isinstance(keyword.value, ast.Attribute):
+ return keyword.value.attr
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能添加一个测试用例说明具体功能么

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在加了


@builtin
def barrier_cross_sync(_semantic=None):
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提交的代码不完整么?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

定义一个函数占位符,在ast到ttir的转换中会被替换掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants