-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenMP] Clang Codegen Interop : Accept multiple init (#82604)
Modifying clang/lib/CodeGen/CGStmtOpenMP.cpp to accept multiple `init` clauses with `interop` directive. --------- Co-authored-by: Sunil Kuravinakop
- Loading branch information
1 parent
95aab69
commit 230b06b
Showing
2 changed files
with
53 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// expected-no-diagnostics | ||
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s | ||
|
||
#ifndef HEADER | ||
#define HEADER | ||
|
||
typedef void *omp_interop_t; | ||
#define omp_interop_none 0 | ||
#define omp_ipr_fr_id -1 | ||
typedef long omp_intptr_t; | ||
#define NULL 0 | ||
|
||
extern omp_intptr_t omp_get_interop_int(const omp_interop_t, int, int *); | ||
|
||
int main() { | ||
omp_interop_t obj = omp_interop_none; | ||
omp_interop_t i1 = omp_interop_none; | ||
omp_interop_t i2 = omp_interop_none; | ||
omp_interop_t i3 = omp_interop_none; | ||
omp_interop_t i4 = omp_interop_none; | ||
omp_interop_t i5 = omp_interop_none; | ||
|
||
#pragma omp interop init(targetsync: i1) init(targetsync: obj) | ||
int id = (int )omp_get_interop_int(obj, omp_ipr_fr_id, NULL); | ||
int id1 = (int )omp_get_interop_int(i1, omp_ipr_fr_id, NULL); | ||
|
||
|
||
} | ||
#endif | ||
|
||
// CHECK-LABEL: define {{.+}}main{{.+}} | ||
// CHECK: call {{.+}}__tgt_interop_init({{.+}}i1{{.*}}) | ||
// CHECK: call {{.+}}__tgt_interop_init({{.+}}obj{{.*}}) |