-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Mark parallel_for_work_item even when called indirectly (#12805)
Previously, we would mark parallel_for_work_item FunctionDecl only when called directly from a parallel_for_work_group region. This change marks it when called even indirectly.
- Loading branch information
1 parent
ea400f7
commit 19bb017
Showing
3 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -internal-isystem %S/Inputs -emit-llvm %s -o - | FileCheck %s | ||
// This test checks if the parallel_for_work_item called indirecly from | ||
// parallel_for_work_group gets the work_item_scope marker on it. | ||
#include <sycl.hpp> | ||
|
||
void foo(sycl::group<1> work_group) { | ||
work_group.parallel_for_work_item(); | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
sycl::queue q; | ||
q.submit([&](sycl::handler &cgh) { | ||
cgh.parallel_for_work_group( | ||
sycl::range<1>{1}, sycl::range<1>{1024}, ([=](sycl::group<1> wGroup) { | ||
foo(wGroup); | ||
})); | ||
}); | ||
return 0; | ||
} | ||
|
||
// CHECK: define {{.*}} void @{{.*}}sycl{{.*}}group{{.*}}parallel_for_work_item{{.*}}(ptr addrspace(4) noundef align 1 dereferenceable_or_null(1) %this) {{.*}}!work_item_scope {{.*}}!parallel_for_work_item |