Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,72 @@
// RUN: %libomp-compile && env OMP_PLACES=cores %libomp-run | FileCheck %s
// REQUIRES: ompt, linux
#include "callback.h"
#include <omp.h>
#define __USE_GNU
#include <sched.h>
#undef __USE_GNU
void print_list(char* function_name, int list[])
{
printf("%" PRIu64 ": %s(0)=(%d", ompt_get_thread_data()->value, function_name, list[0]);
int i;
for(i = 1; i < omp_get_place_num_procs(0); i++)
{
printf(",%d", list[i]);
}
printf(")\n");
}
int main()
{
#pragma omp parallel num_threads(1)
{
printf("%" PRIu64 ": omp_get_num_places()=%d\n", ompt_get_thread_data()->value, omp_get_num_places());
printf("%" PRIu64 ": ompt_get_num_places()=%d\n", ompt_get_thread_data()->value, ompt_get_num_places());
int omp_ids[omp_get_place_num_procs(0)];
omp_get_place_proc_ids(0, omp_ids);
print_list("omp_get_place_proc_ids" ,omp_ids);
int ompt_ids[omp_get_place_num_procs(0)];
ompt_get_place_proc_ids(0, omp_get_place_num_procs(0), ompt_ids);
print_list("ompt_get_place_proc_ids", ompt_ids);
printf("%" PRIu64 ": omp_get_place_num()=%d\n", ompt_get_thread_data()->value, omp_get_place_num());
printf("%" PRIu64 ": ompt_get_place_num()=%d\n", ompt_get_thread_data()->value, ompt_get_place_num());
int omp_nums[omp_get_partition_num_places()];
omp_get_partition_place_nums(omp_nums);
print_list("omp_get_partition_place_nums" ,omp_nums);
int ompt_nums[omp_get_partition_num_places()];
ompt_get_partition_place_nums(omp_get_partition_num_places(), ompt_nums);
print_list("ompt_get_partition_place_nums", ompt_nums);
printf("%" PRIu64 ": sched_getcpu()=%d\n", ompt_get_thread_data()->value, sched_getcpu());
printf("%" PRIu64 ": ompt_get_proc_id()=%d\n", ompt_get_thread_data()->value, ompt_get_proc_id());
printf("%" PRIu64 ": omp_get_num_procs()=%d\n", ompt_get_thread_data()->value, omp_get_num_procs());
printf("%" PRIu64 ": ompt_get_num_procs()=%d\n", ompt_get_thread_data()->value, ompt_get_num_procs());
}
// Check if libomp supports the callbacks for this test.
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: omp_get_num_places()=[[NUM_PLACES:[0-9]+]]
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_num_places()=[[NUM_PLACES]]
// CHECK: {{^}}[[MASTER_ID]]: omp_get_place_proc_ids(0)=([[PROC_IDS:[0-9\,]+]])
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_place_proc_ids(0)=([[PROC_IDS]])
// CHECK: {{^}}[[MASTER_ID]]: omp_get_place_num()=[[PLACE_NUM:[-]?[0-9]+]]
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_place_num()=[[PLACE_NUM]]
// CHECK: {{^}}[[MASTER_ID]]: sched_getcpu()=[[CPU_ID:[0-9]+]]
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_proc_id()=[[CPU_ID]]
// CHECK: {{^}}[[MASTER_ID]]: omp_get_num_procs()=[[NUM_PROCS:[-]?[0-9]+]]
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_num_procs()=[[NUM_PROCS]]
return 0;
}

View File

@ -0,0 +1,29 @@
// RUN: %libomp-compile-and-run | FileCheck %s
// REQUIRES: ompt
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
#define TEST_NEED_PRINT_FRAME_FROM_OUTLINED_FN
#include "callback.h"
#include <omp.h>
int main()
{
#pragma omp parallel num_threads(1)
{
print_frame_from_outlined_fn(1);
print_frame(0);
omp_control_tool(omp_control_tool_flush, 1, NULL);
print_current_address(0);
}
// Check if libomp supports the callbacks for this test.
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_control_tool'
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: __builtin_frame_address({{.}})=[[EXIT_FRAME:0x[0-f]*]]
// CHECK: {{^}}[[MASTER_ID]]: __builtin_frame_address(0)=[[REENTER_FRAME:0x[0-f]*]]
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_control_tool: command=3, modifier=1, arg=[[NULL]], codeptr_ra=[[RETURN_ADDRESS:0x[0-f]*]], current_task_frame.exit=[[EXIT_FRAME]], current_task_frame.reenter=[[REENTER_FRAME]]
// CHECK-NEXT: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]
return 0;
}

View File

@ -0,0 +1,12 @@
// RUN: %libomp-compile-and-run
#include <omp.h>
int main()
{
#pragma omp parallel num_threads(1)
{
omp_control_tool(omp_control_tool_flush, 1, NULL);
}
return 0;
}

View File

@ -0,0 +1,32 @@
// RUN: %libomp-compile-and-run | FileCheck %s
// REQUIRES: ompt
#include "callback.h"
#include <omp.h>
int main()
{
int x = 0;
#pragma omp parallel num_threads(3)
{
#pragma omp atomic
x++;
}
#pragma omp parallel num_threads(2)
{
#pragma omp atomic
x++;
}
printf("x=%d\n", x);
// Check if libomp supports the callbacks for this test.
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_idle'
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_idle_begin:
// CHECK: {{^}}[[THREAD_ID]]: ompt_event_idle_end:
return 0;
}

View File

@ -0,0 +1,29 @@
// RUN: %libomp-compile-and-run | FileCheck %s
// REQUIRES: ompt
#include "callback.h"
#include <omp.h>
int main()
{
#pragma omp parallel num_threads(1)
{
}
ompt_set_callback(ompt_callback_parallel_begin, NULL);
#pragma omp parallel num_threads(1)
{
}
// Check if libomp supports the callbacks for this test.
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_idle'
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_parallel_begin:
// CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end:
// CHECK-NOT: {{^}}[[THREAD_ID]]: ompt_event_parallel_begin:
// CHECK: {{^}}[[THREAD_ID]]: ompt_event_parallel_end:
return 0;
}