]> granicus.if.org Git - clang/commitdiff
[OPENMP]Add codegen for task reduction vars with allocate clause, NFC.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 4 Apr 2019 18:58:17 +0000 (18:58 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Thu, 4 Apr 2019 18:58:17 +0000 (18:58 +0000)
Added test for the task reduction variables with the allocate clause.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357717 91177308-0d34-0410-b5e6-96231b3b80d8

test/OpenMP/task_in_reduction_codegen.cpp
test/OpenMP/taskgroup_task_reduction_codegen.cpp

index e96d12689fb16b39b44f318b81dc2de51c43bcd9..2370b2bc4197841da132524483fcb94034390c35 100644 (file)
 #ifndef HEADER
 #define HEADER
 
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
 // CHECK: [[PRIVATES:%.+]] = type { i8*, i8* }
 
 struct S {
@@ -31,7 +41,7 @@ int main(int argc, char **argv) {
   {
 #pragma omp taskgroup task_reduction(-:c, d)
 #pragma omp parallel
-#pragma omp task in_reduction(+:a) in_reduction(-:d)
+#pragma omp task in_reduction(+:a) in_reduction(-:d) allocate(omp_high_bw_mem_alloc: d)
     a += d[a];
   }
   return 0;
index 02a5ba664e5e9ee9be6f914b30bf9f60a63fdd2c..686bb6ff57e4c2476c293c97b6e660106f3a8e09 100644 (file)
 #ifndef HEADER
 #define HEADER
 
+typedef void **omp_allocator_handle_t;
+extern const omp_allocator_handle_t omp_default_mem_alloc;
+extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
+extern const omp_allocator_handle_t omp_const_mem_alloc;
+extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
+extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
+extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
+extern const omp_allocator_handle_t omp_pteam_mem_alloc;
+extern const omp_allocator_handle_t omp_thread_mem_alloc;
+
 // CHECK-DAG: @reduction_size.[[ID:.+]]_[[CID:[0-9]+]].artificial.
 // CHECK-DAG: @reduction_size.[[ID]]_[[CID]].artificial..cache.
 
@@ -29,7 +39,7 @@ int main(int argc, char **argv) {
   float b;
   S c[5];
   short d[argc];
-#pragma omp taskgroup task_reduction(+: a, b, argc)
+#pragma omp taskgroup allocate(omp_pteam_mem_alloc: a) task_reduction(+: a, b, argc)
   {
 #pragma omp taskgroup task_reduction(-:c, d)
     ;