forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenMP] Implement support for the
scan
directive in target regions
The `scan` directive is already supported on the host side. This patch implements the directive inside a target region, more specifically, the `target teams distribute parallel for` construct. The clang/CodeGen takes care of splitting the 'for' loop-body into the 'BeforeScan' and 'AfterScan' blocks based upon the location of the `scan` directive. The code generator generates two kernels - one for each of the aforementioned blocks to ensure thread synchronization across the whole grid. The code generator for the first kernel embeds a call to the DeviceRTL entry point that implements the Cross-Team Parallel Prefix- -sum/Scan algorithm. The Cross-Team scan codegen machinery is activated by passing the option `-fopenmp-target-xteam-scan`. This patch also adds IR tests and execution tests for the implementation. This is the No-Loop Xteam Scan Kernel codegen which assumes that loop tripcount is same as (num_threads * num_teams). Working on Segmented scan which will accommodate all loop trip count sizes agnostic from num_teams and num_threads. For more details, visit: https://confluence.amd.com/x/mu6HJg Change-Id: Id01381a5f54fd919370155391bc98d126002ddf4
- Loading branch information
1 parent
b8f9d29
commit 5ef5244
Showing
21 changed files
with
4,122 additions
and
131 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
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
Oops, something went wrong.