brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · f5ada41 Raw
84 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s3// REQUIRES: ompt4// clang-format on5 6#include "callback.h"7#include <omp.h>8 9int main() {10#pragma omp parallel num_threads(1)11  {12    // region 013#pragma omp parallel num_threads(1)14    {15      // region 116#pragma omp parallel num_threads(1)17      {18        // region 219        // region 2's implicit task20        print_ids(0);21        // region 1's implicit task22        print_ids(1);23        // region 0's implicit task24        print_ids(2);25        // initial task26        print_ids(3);27      }28    }29  }30 31  // clang-format off32  // Check if libomp supports the callbacks for this test.33  // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create'34  // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'35 36 37  // CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]38  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_initial_task_begin: parallel_id=[[INITIAL_PARALLEL_ID:[0-f]+]], task_id=[[INITIAL_TASK_ID:[0-f]+]], actual_parallelism=1, index=1, flags=139 40  // region 041  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_begin42  // CHECK-SAME: parent_task_frame.exit=[[NULL]], parent_task_frame.reenter=[[INITIAL_TASK_FRAME_ENTER:(0x)?[0-f]+]],43  // CHECK-SAME: parallel_id=[[PARALLEL_ID_0:[0-9]+]]44  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID_0]], task_id=[[TASK_ID_0:[0-9]+]]45 46  // region 147  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_begin48  // CHECK-SAME: parent_task_frame.exit=[[REGION_0_FRAME_EXIT:(0x)?[0-f]+]], parent_task_frame.reenter=[[REGION_0_FRAME_ENTER:(0x)?[0-f]+]],49  // CHECK-SAME: parallel_id=[[PARALLEL_ID_1:[0-9]+]]50  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID_1]], task_id=[[TASK_ID_1:[0-9]+]]51 52  // region 253  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_begin54  // CHECK-SAME: parent_task_frame.exit=[[REGION_1_FRAME_EXIT:(0x)?[0-f]+]], parent_task_frame.reenter=[[REGION_1_FRAME_ENTER:(0x)?[0-f]+]],55  // CHECK-SAME: parallel_id=[[PARALLEL_ID_2:[0-9]+]]56  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID_2]], task_id=[[TASK_ID_2:[0-9]+]]57 58  // region 2's implicit task information (exit frame should be set, while enter should be NULL)59  // CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[PARALLEL_ID_2]], task_id=[[TASK_ID_2]]60  // CHECK-SAME: exit_frame={{(0x)?[0-f]+}}61  // CHECK-SAME: reenter_frame=[[NULL]]62  // CHECK-SAME: task_type=ompt_task_implicit63 64  // region 1's implicit task information (both exit and enter frames should be set)65  // CHECK: {{^}}[[MASTER_ID]]: task level 1: parallel_id=[[PARALLEL_ID_1]], task_id=[[TASK_ID_1]]66  // CHECK-SAME: exit_frame=[[REGION_1_FRAME_EXIT]]67  // CHECK-SAME: reenter_frame=[[REGION_1_FRAME_ENTER]]68  // CHECK-SAME: task_type=ompt_task_implicit69 70  // region 0's implicit task information (both exit and enter frames should be set)71  // CHECK: {{^}}[[MASTER_ID]]: task level 2: parallel_id=[[PARALLEL_ID_0]], task_id=[[TASK_ID_0]]72  // CHECK-SAME: exit_frame=[[REGION_0_FRAME_EXIT]]73  // CHECK-SAME: reenter_frame=[[REGION_0_FRAME_ENTER]]74  // CHECK-SAME: task_type=ompt_task_implicit75 76  // region 0's initial task information (both exit and enter frames should be set)77  // CHECK: {{^}}[[MASTER_ID]]: task level 3: parallel_id=[[INITIAL_PARALLEL_ID]], task_id=[[INITIAL_TASK_ID]]78  // CHECK-SAME: exit_frame=[[NULL]]79  // CHECK-SAME: reenter_frame=[[INITIAL_TASK_FRAME_ENTER]]80  // CHECK-SAME: task_type=ompt_task_initial81  // clang-format on82 83  return 0;84}