-
Notifications
You must be signed in to change notification settings - Fork 1.1k
POC implementation for task_group dynamic dependencies - part 1 - task_tracker #1682
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
base: master
Are you sure you want to change the base?
Conversation
@@ -87,6 +87,9 @@ class function_task : public task_handle_task { | |||
d1::task* execute(d1::execution_data& ed) override { | |||
__TBB_ASSERT(ed.context == &this->ctx(), "The task group context should be used for all tasks"); | |||
task* res = task_ptr_or_nullptr(m_func); | |||
#if __TBB_PREVIEW_TASK_GROUP_EXTENSIONS | |||
this->complete_task(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No-op in this part, would be used in part 2 for bypassing the successor task
@@ -1,5 +1,5 @@ | |||
/* | |||
Copyright (c) 2020-2024 Intel Corporation | |||
Copyright (c) 2020-2025 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright (c) 2020-2025 Intel Corporation | |
Copyright (c) 2020-2024 Intel Corporation | |
Copyright (c) 2025 UXL Foundation contributors |
|
||
if (m_state.compare_exchange_strong(current_state, new_state)) { | ||
// Reserve a task co-ownership for dynamic_state | ||
new_state->reserve(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that two trackers T1 and T2 to the same handle H are constructor concurrently? And if so, what if T2 is destroyed before T1 finishes its call to get_dynamic_state. Is it possible for the destruction of T2 to delete the task_dynamic_state before T1 has reserved it? I think T1 could succeed at exchanging a newly create state, T2 could see it and reserve and release, before T1 reserves.
@@ -1222,3 +1222,124 @@ TEST_CASE("task_handle cannot be scheduled into other task_group of the same con | |||
} | |||
|
|||
#endif // TBB_USE_EXCEPTIONS | |||
|
|||
#if __TBB_PREVIEW_TASK_GROUP_EXTENSIONS | |||
TEST_CASE("test task_tracker") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case that I think are missing:
- is concurrent creation / destruction of trackers to same handle
- creation of tracker to deferred task but handle is destroyed without being run
Description
First part of POC implementation for task_group dynamic dependencies.
Design described in the RFC #1664
This PR extends the
task_group
tasks with the dynamic state, that currently allows tracking the progress of the task using the new objecttask_tracker
.In the future parts, dynamic state of the task would be reused for setting and transferring dependencies between tasks.
Fixes # - issue number(s) if exists
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@
to send notificationsOther information