Compare commits
5
Commits
release_80
...
release_70
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
366ce74b85 | ||
|
|
e7966c0b87 | ||
|
|
622cfa2c35 | ||
|
|
077040a3be | ||
|
|
a86d025140 |
+1
-1
@@ -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``
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user