Compare commits

...
5 Commits
Author SHA1 Message Date
Hans Wennborg 366ce74b85 Merging r338757:
------------------------------------------------------------------------
r338757 | jlpeyton | 2018-08-02 21:13:07 +0200 (Thu, 02 Aug 2018) | 8 lines

[OpenMP] Fix doacross testing for gcc

This patch adds a test using the doacross clauses in OpenMP and removes gcc from
testing kmp_doacross_check.c which is only testing the kmp rather than the
gomp interface.

Differential Revision: https://reviews.llvm.org/D50014

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_70@338844 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 10:18:17 +00:00
Hans Wennborg e7966c0b87 Merging r338721:
------------------------------------------------------------------------
r338721 | hahnfeld | 2018-08-02 16:34:08 +0200 (Thu, 02 Aug 2018) | 7 lines

[OMPT] Disable by default on Windows

This is broken per PR36561 and PR36574, so disable it for now until
somebody interested can take a look. OMPT can still be activated manually
by passing -DLIBOMP_OMPT_SUPPORT=ON during configuration.

Differential Revision: https://reviews.llvm.org/D50086
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_70@338728 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 15:00:25 +00:00
Hans Wennborg 622cfa2c35 Merging r338720:
------------------------------------------------------------------------
r338720 | hahnfeld | 2018-08-02 16:34:03 +0200 (Thu, 02 Aug 2018) | 6 lines

[tests] Add annotations for taskloop features

Only supported since GCC 6 and Intel 17.0. However GCC 6.3.0 is
crashing on two of the tests, so disable them as well...

Differential Revision: https://reviews.llvm.org/D50085
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_70@338726 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 14:59:17 +00:00
Hans Wennborg 077040a3be Merging r338580:
------------------------------------------------------------------------
r338580 | jprotze | 2018-08-01 18:15:18 +0200 (Wed, 01 Aug 2018) | 15 lines

[OMPT,tests] Fix taskloop testcase scheduling effects

The taskloop testcase had scheduling effects. Tasks of the taskloop would
sometimes be scheduled before all task were created. The testing is now
split into two phases. First, the task creation on the master is tested,
than the scheduling events of the tasks are tested. Thus, the order of
creation and scheduling events is irrelavant.

Patch by Simon Convent

Reviewed by: protze.joachim, Hahnfeld

Subscribers: openmp-commits

Differential Revision: https://reviews.llvm.org/D50140
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_70@338704 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-02 11:33:13 +00:00
Hans Wennborg a86d025140 Creating release_70 branch off revision 338536
git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_70@338548 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 13:31:17 +00:00
8 changed files with 111 additions and 13 deletions
+1 -1
View File
@@ -194,7 +194,7 @@ Optional Features
**LIBOMP_OMPT_SUPPORT** = ``ON|OFF``
Include support for the OpenMP Tools Interface (OMPT).
This option is supported and ``ON`` by default for x86, x86_64, AArch64, and
PPC64 on Linux*, Windows*, and macOS*.
PPC64 on Linux* and macOS*.
This option is ``OFF`` if this feature is not supported for the platform.
**LIBOMP_OMPT_OPTIONAL** = ``ON|OFF``
+4 -1
View File
@@ -87,7 +87,9 @@ function(set_test_compiler_information dir)
# Determine major version.
string(REGEX MATCH "[0-9]+" major "${OPENMP_TEST_C_COMPILER_VERSION}")
string(REGEX MATCH "[0-9]+\\.[0-9]+" majorminor "${OPENMP_TEST_C_COMPILER_VERSION}")
set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${major}" PARENT_SCOPE)
set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${majorminor}" PARENT_SCOPE)
endif()
endfunction()
@@ -117,6 +119,7 @@ else()
# Cannot use CLANG_VERSION because we are not guaranteed that this is already set.
set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}")
set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_MAJOR_VERSION}")
set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_MAJOR_VERSION}.${LLVM_MINOR_VERSION}")
# TODO: Implement blockaddress in GlobalISel and remove this flag!
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp -fno-experimental-isel")
endif()
@@ -131,7 +134,7 @@ function(set_test_compiler_features)
# Just use the lowercase of the compiler ID as fallback.
string(TOLOWER "${OPENMP_TEST_COMPILER_ID}" comp)
endif()
set(OPENMP_TEST_COMPILER_FEATURES "['${comp}', '${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR}', '${comp}-${OPENMP_TEST_COMPILER_VERSION}']" PARENT_SCOPE)
set(OPENMP_TEST_COMPILER_FEATURES "['${comp}', '${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR}', '${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR}', '${comp}-${OPENMP_TEST_COMPILER_VERSION}']" PARENT_SCOPE)
endfunction()
set_test_compiler_features()
+1 -1
View File
@@ -302,7 +302,7 @@ endif()
# OMPT-support defaults to ON for OpenMP 5.0+ and if the requirements in
# cmake/config-ix.cmake are fulfilled.
set(OMPT_DEFAULT FALSE)
if ((${LIBOMP_OMP_VERSION} GREATER 49) AND (LIBOMP_HAVE_OMPT_SUPPORT))
if ((${LIBOMP_OMP_VERSION} GREATER 49) AND (LIBOMP_HAVE_OMPT_SUPPORT) AND (NOT WIN32))
set(OMPT_DEFAULT TRUE)
endif()
set(LIBOMP_OMPT_SUPPORT ${OMPT_DEFAULT} CACHE BOOL
+29 -10
View File
@@ -1,18 +1,28 @@
// RUN: %libomp-compile && %libomp-run | FileCheck %s
// RUN: %libomp-compile-and-run | FileCheck %s
// RUN: %libomp-compile-and-run | FileCheck --check-prefix=TASKS %s
// REQUIRES: ompt
// These compilers don't support the taskloop construct
// UNSUPPORTED: gcc-4, gcc-5, icc-16
// GCC 6 has support for taskloops, but at least 6.3.0 is crashing on this test
// UNSUPPORTED: gcc-6
#include "callback.h"
#include <omp.h>
int main() {
unsigned int i, j, x;
unsigned int i, x;
#pragma omp parallel num_threads(2)
{
#pragma omp barrier
#pragma omp master
#pragma omp taskloop
for (j = 0; j < 5; j += 3) {
x++;
for (i = 0; i < 5; i += 3) {
x++;
}
}
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
@@ -39,16 +49,12 @@ int main() {
// CHECK-SAME: new_task_id=[[TASK_ID2:[0-9]+]]
// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS]]
// CHECK-SAME: task_type=ompt_task_explicit=4
// CHECK-NOT: {{^}}[[MASTER_ID]]: ompt_event_task_create:
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_taskloop_end:
// CHECK-SAME: parallel_id=[[PARALLEL_ID]]
// CHECK-SAME: parent_task_id=[[IMPLICIT_TASK_ID1]]
// CHECK-SAME: count=2
// CHECK-DAG: {{^}}[[MASTER_ID]]: ompt_event_wait_taskgroup_begin:
// Schedule events:
// CHECK-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID1]]
// CHECK-DAG: {{^.*}}first_task_id=[[TASK_ID1]], second_task_id={{[0-9]+}}
// CHECK-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID2]]
// CHECK-DAG: {{^.*}}first_task_id=[[TASK_ID2]], second_task_id={{[0-9]+}}
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_taskgroup_end:
// CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID1]]
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_taskgroup_end:
@@ -58,5 +64,18 @@ int main() {
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_end:
// CHECK-SAME: parallel_id=[[PARALLEL_ID]]
// TASKS: ompt_event_task_create:{{.*}} new_task_id={{[0-9]+}}
// TASKS-SAME: task_type=ompt_task_initial
// TASKS: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_taskloop_begin:
// TASKS: ompt_event_task_create:{{.*}} new_task_id=[[TASK_ID1:[0-9]+]]
// TASKS-SAME: task_type=ompt_task_explicit
// TASKS-DAG: ompt_event_task_create:{{.*}} new_task_id=[[TASK_ID2:[0-9]+]]
// Schedule events:
// TASKS-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID1]]
// TASKS-DAG: {{^.*}}first_task_id=[[TASK_ID1]], second_task_id={{[0-9]+}}
// TASKS-DAG: {{^.*}}first_task_id={{[0-9]+}}, second_task_id=[[TASK_ID2]]
// TASKS-DAG: {{^.*}}first_task_id=[[TASK_ID2]], second_task_id={{[0-9]+}}
// TASKS-NOT: ompt_event_task_schedule
return 0;
}
@@ -1,5 +1,11 @@
// RUN: %libomp-compile-and-run
// RUN: %libomp-compile && env KMP_TASKLOOP_MIN_TASKS=1 %libomp-run
// These compilers don't support the taskloop construct
// UNSUPPORTED: gcc-4, gcc-5, icc-16
// GCC 6 has support for taskloops, but at least 6.3.0 is crashing on this test
// UNSUPPORTED: gcc-6
/*
* Test for taskloop
* Method: caculate how many times the iteration space is dispatched
@@ -1,5 +1,9 @@
// RUN: %libomp-compile-and-run
// RUN: %libomp-compile && env KMP_TASKLOOP_MIN_TASKS=1 %libomp-run
// These compilers don't support the taskloop construct
// UNSUPPORTED: gcc-4, gcc-5, icc-16
/*
* Test for taskloop
* Method: caculate how many times the iteration space is dispatched
@@ -1,4 +1,10 @@
// RUN: %libomp-compile-and-run
// UNSUPPORTED: gcc
// This test is incompatible with gcc because of the explicit call to
// __kmpc_doacross_fini(). gcc relies on an implicit call to this function
// when the last iteration is executed inside the GOMP_loop_*_next() functions.
// Hence, in gcc, having the explicit call leads to __kmpc_doacross_fini()
// being called twice.
#include <stdio.h>
#define N 1000
@@ -0,0 +1,60 @@
// RUN: %libomp-compile-and-run
// XFAIL: gcc-4, gcc-5, clang-3.7, clang-3.8, icc-15, icc-16
#include <stdio.h>
#include <stdlib.h>
#include "omp_testsuite.h"
#ifndef N
#define N 750
#endif
int test_doacross() {
int i, j;
// Allocate and zero out the matrix
int *m = (int *)malloc(sizeof(int) * N * N);
for (i = 0; i < N; ++i) {
for (j = 0; j < N; ++j) {
m[i * N + j] = 0;
}
}
// Have first row and column be 0, 1, 2, 3, etc.
for (i = 0; i < N; ++i)
m[i * N] = i;
for (j = 0; j < N; ++j)
m[j] = j;
// Perform wavefront which results in matrix:
// 0 1 2 3 4
// 1 2 3 4 5
// 2 3 4 5 6
// 3 4 5 6 7
// 4 5 6 7 8
#pragma omp parallel shared(m)
{
int row, col;
#pragma omp for ordered(2)
for (row = 1; row < N; ++row) {
for (col = 1; col < N; ++col) {
#pragma omp ordered depend(sink : row - 1, col) depend(sink : row, col - 1)
m[row * N + col] = m[(row - 1) * N + col] + m[row * N + (col - 1)] -
m[(row - 1) * N + (col - 1)];
#pragma omp ordered depend(source)
}
}
}
// Check the bottom right element to see if iteration dependencies were held
int retval = (m[(N - 1) * N + N - 1] == 2 * (N - 1));
free(m);
return retval;
}
int main(int argc, char **argv) {
int i;
int num_failed = 0;
for (i = 0; i < REPETITIONS; i++) {
if (!test_doacross()) {
num_failed++;
}
}
return num_failed;
}