forked from OSchip/llvm-project
[OpenMP][OMPT] Update OMPT tests for newly added GOMP interface patches
This patch updates the expected results for the GOMP interface patches: D87267, D87269, and D87271. The taskwait-depend test is changed to really use taskwait-depend and copied to an task_if0-depend test. To pass the tests, the handling of the return address was fixed. Differential Revision: https://reviews.llvm.org/D87680
This commit is contained in:
parent
55cff5b288
commit
6104b30446
|
@ -1891,6 +1891,9 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_TASKWAIT_DEPEND)(void **depend) {
|
||||||
kmp_depend_info_t dep_list[ndeps];
|
kmp_depend_info_t dep_list[ndeps];
|
||||||
for (kmp_int32 i = 0; i < ndeps; i++)
|
for (kmp_int32 i = 0; i < ndeps; i++)
|
||||||
dep_list[i] = gomp_depends.get_kmp_depend(i);
|
dep_list[i] = gomp_depends.get_kmp_depend(i);
|
||||||
|
#if OMPT_SUPPORT
|
||||||
|
OMPT_STORE_RETURN_ADDRESS(gtid);
|
||||||
|
#endif
|
||||||
__kmpc_omp_wait_deps(&loc, gtid, ndeps, dep_list, 0, NULL);
|
__kmpc_omp_wait_deps(&loc, gtid, ndeps, dep_list, 0, NULL);
|
||||||
KA_TRACE(20, ("GOMP_taskwait_depend exit: T#%d\n", gtid));
|
KA_TRACE(20, ("GOMP_taskwait_depend exit: T#%d\n", gtid));
|
||||||
}
|
}
|
||||||
|
|
|
@ -520,7 +520,6 @@ kmp_int32 __kmpc_omp_task_with_deps(ident_t *loc_ref, kmp_int32 gtid,
|
||||||
|
|
||||||
#if OMPT_SUPPORT
|
#if OMPT_SUPPORT
|
||||||
if (ompt_enabled.enabled) {
|
if (ompt_enabled.enabled) {
|
||||||
OMPT_STORE_RETURN_ADDRESS(gtid);
|
|
||||||
if (!current_task->ompt_task_info.frame.enter_frame.ptr)
|
if (!current_task->ompt_task_info.frame.enter_frame.ptr)
|
||||||
current_task->ompt_task_info.frame.enter_frame.ptr =
|
current_task->ompt_task_info.frame.enter_frame.ptr =
|
||||||
OMPT_GET_FRAME_ADDRESS(0);
|
OMPT_GET_FRAME_ADDRESS(0);
|
||||||
|
@ -531,7 +530,7 @@ kmp_int32 __kmpc_omp_task_with_deps(ident_t *loc_ref, kmp_int32 gtid,
|
||||||
current_task ? &(current_task->ompt_task_info.frame) : NULL,
|
current_task ? &(current_task->ompt_task_info.frame) : NULL,
|
||||||
&(new_taskdata->ompt_task_info.task_data),
|
&(new_taskdata->ompt_task_info.task_data),
|
||||||
ompt_task_explicit | TASK_TYPE_DETAILS_FORMAT(new_taskdata), 1,
|
ompt_task_explicit | TASK_TYPE_DETAILS_FORMAT(new_taskdata), 1,
|
||||||
OMPT_LOAD_RETURN_ADDRESS(gtid));
|
OMPT_LOAD_OR_GET_RETURN_ADDRESS(gtid));
|
||||||
}
|
}
|
||||||
|
|
||||||
new_taskdata->ompt_task_info.frame.enter_frame.ptr = OMPT_GET_FRAME_ADDRESS(0);
|
new_taskdata->ompt_task_info.frame.enter_frame.ptr = OMPT_GET_FRAME_ADDRESS(0);
|
||||||
|
@ -700,7 +699,7 @@ void __kmpc_omp_wait_deps(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps,
|
||||||
current_task ? &(current_task->ompt_task_info.frame) : NULL,
|
current_task ? &(current_task->ompt_task_info.frame) : NULL,
|
||||||
taskwait_task_data,
|
taskwait_task_data,
|
||||||
ompt_task_explicit | ompt_task_undeferred | ompt_task_mergeable, 1,
|
ompt_task_explicit | ompt_task_undeferred | ompt_task_mergeable, 1,
|
||||||
OMPT_GET_RETURN_ADDRESS(0));
|
OMPT_LOAD_OR_GET_RETURN_ADDRESS(gtid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,11 @@ inline void *__ompt_load_return_address(int gtid) {
|
||||||
__kmp_threads[gtid]->th.ompt_thread_info.return_address = \
|
__kmp_threads[gtid]->th.ompt_thread_info.return_address = \
|
||||||
__builtin_return_address(0)
|
__builtin_return_address(0)
|
||||||
#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
|
#define OMPT_LOAD_RETURN_ADDRESS(gtid) __ompt_load_return_address(gtid)
|
||||||
|
#define OMPT_LOAD_OR_GET_RETURN_ADDRESS(gtid) \
|
||||||
|
((ompt_enabled.enabled && gtid >= 0 && __kmp_threads[gtid] && \
|
||||||
|
__kmp_threads[gtid]->th.ompt_thread_info.return_address)? \
|
||||||
|
__ompt_load_return_address(gtid): \
|
||||||
|
__builtin_return_address(0))
|
||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
// inline functions
|
// inline functions
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
|
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
|
||||||
// REQUIRES: ompt
|
// REQUIRES: ompt
|
||||||
|
|
||||||
// GCC does not pass in mutexinoutset
|
// GCC 9 introduced codegen for mutexinoutset
|
||||||
// clang 9 introduced codegen for mutexinoutset
|
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8
|
||||||
|
|
||||||
// UNSUPPORTED: gcc
|
// clang 9 introduced codegen for mutexinoutset
|
||||||
// UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8
|
// UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8
|
||||||
|
|
||||||
#include "callback.h"
|
#include "callback.h"
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
|
||||||
|
// REQUIRES: ompt
|
||||||
|
|
||||||
|
#include "callback.h"
|
||||||
|
#include <omp.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int x = 0;
|
||||||
|
#pragma omp parallel num_threads(2)
|
||||||
|
{
|
||||||
|
#pragma omp master
|
||||||
|
{
|
||||||
|
print_ids(0);
|
||||||
|
printf("%" PRIu64 ": address of x: %p\n", ompt_get_thread_data()->value,
|
||||||
|
&x);
|
||||||
|
#pragma omp task depend(out : x)
|
||||||
|
{ x++; }
|
||||||
|
print_fuzzy_address(1);
|
||||||
|
#pragma omp task if (0) depend(in : x)
|
||||||
|
{}
|
||||||
|
print_fuzzy_address(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if libomp supports the callbacks for this test.
|
||||||
|
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create'
|
||||||
|
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_dependences'
|
||||||
|
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_depende
|
||||||
|
|
||||||
|
// CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
|
||||||
|
|
||||||
|
// make sure initial data pointers are null
|
||||||
|
// CHECK-NOT: 0: new_task_data initially not null
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_implicit_task_begin:
|
||||||
|
// CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-9]+]],
|
||||||
|
// CHECK-SAME: task_id=[[IMPLICIT_TASK_ID:[0-9]+]]
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[PARALLEL_ID]],
|
||||||
|
// CHECK-SAME: task_id=[[IMPLICIT_TASK_ID]], exit_frame=[[EXIT:0x[0-f]+]],
|
||||||
|
// CHECK-SAME: reenter_frame=[[NULL]]
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: address of x: [[ADDRX:0x[0-f]+]]
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create:
|
||||||
|
// CHECK-SAME: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[EXIT]],
|
||||||
|
// CHECK-SAME: parent_task_frame.reenter={{0x[0-f]+}},
|
||||||
|
// CHECK-SAME: new_task_id=[[FIRST_TASK:[0-f]+]],
|
||||||
|
// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}},
|
||||||
|
// CHECK-SAME: task_type=ompt_task_explicit=4, has_dependences=yes
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_dependences:
|
||||||
|
// CHECK-SAME: task_id=[[FIRST_TASK]], deps=[([[ADDRX]],
|
||||||
|
// CHECK-SAME: ompt_dependence_type_inout)], ndeps=1
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]]
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create:
|
||||||
|
// CHECK-SAME: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[EXIT]],
|
||||||
|
// CHECK-SAME: parent_task_frame.reenter={{0x[0-f]+}},
|
||||||
|
// CHECK-SAME: new_task_id=[[SECOND_TASK:[0-f]+]],
|
||||||
|
// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}},
|
||||||
|
// CHECK-SAME: task_type=ompt_task_explicit|ompt_task_undeferred|
|
||||||
|
// CHECK-SAME: ompt_task_mergeable=1207959556, has_dependences=yes
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_dependences:
|
||||||
|
// CHECK-SAME: task_id=[[SECOND_TASK]], deps=[([[ADDRX]],
|
||||||
|
// CHECK-SAME: ompt_dependence_type_in)], ndeps=1
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_end: task_id=[[SECOND_TASK]]
|
||||||
|
|
||||||
|
// CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]]
|
|
@ -1,9 +1,13 @@
|
||||||
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
|
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
|
||||||
// REQUIRES: ompt
|
// REQUIRES: ompt
|
||||||
|
|
||||||
// The GOMP wrapper does not handle `task if(0) depend()` and drops the
|
// taskwait with depend clause was introduced with gcc-9
|
||||||
// dependency. Once this is fixed, reevaluate the GCC status:
|
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8
|
||||||
// XFAIL: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8, gcc-9, gcc-10
|
|
||||||
|
// clang does not yet support taskwait with depend clause
|
||||||
|
// clang-12 introduced parsing, but no codegen
|
||||||
|
// update expected result when codegen in clang was added
|
||||||
|
// XFAIL: clang
|
||||||
|
|
||||||
#include "callback.h"
|
#include "callback.h"
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
|
@ -20,9 +24,7 @@ int main() {
|
||||||
#pragma omp task depend(out : x)
|
#pragma omp task depend(out : x)
|
||||||
{ x++; }
|
{ x++; }
|
||||||
print_fuzzy_address(1);
|
print_fuzzy_address(1);
|
||||||
//#pragma omp taskwait depend(in: x) <-- currently not supported in clang
|
#pragma omp taskwait depend(in: x)
|
||||||
#pragma omp task if (0) depend(in : x)
|
|
||||||
{}
|
|
||||||
print_fuzzy_address(2);
|
print_fuzzy_address(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue