[llvm-bugs] [Bug 50002] New: segmentation fault in libomptarget when using taskloop and target nowait
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Apr 16 11:57:38 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50002
Bug ID: 50002
Summary: segmentation fault in libomptarget when using taskloop
and target nowait
Product: OpenMP
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Runtime Library
Assignee: unassignedbugs at nondot.org
Reporter: xw111luoye at gmail.com
CC: llvm-bugs at lists.llvm.org
LIBOMP_USE_HIDDEN_HELPER_TASK=0 makes the reproducer to work. So there are some
correlations.
reproducer: clang++ -fopenmp -fopenmp-targets=nvptx64
taskloop_offload_nowait.cpp
#include <iostream>
#include <cstdlib>
#include <cmath>
bool almost_equal(float x, float gold, float tol) {
if ( std::signbit(x) != std::signbit(gold) )
{
x = std::abs(gold) - std::abs(x);
}
return std::abs(gold) * (1-tol) <= std::abs(x) && std::abs(x) <=
std::abs(gold) * (1 + tol);
}
int main()
{
const int N0 { 2 };
const int N1 { 182 };
const float expected_value { N0*N1 };
float counter_N0{};
#pragma omp target data map(tofrom: counter_N0)
{
#pragma omp taskloop shared(counter_N0)
for (int i0 = 0 ; i0 < N0 ; i0++ )
{
#pragma omp target teams distribute parallel for map(tofrom: counter_N0)
nowait
for (int i1 = 0 ; i1 < N1 ; i1++ )
{
#pragma omp atomic update
counter_N0 = counter_N0 + 1. ;
}
}
}
if (!almost_equal(counter_N0, expected_value, 0.1)) {
std::cerr << "Expected: " << expected_value << " Got: " << counter_N0 <<
std::endl;
std::exit(112);
}
}
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210416/6283144e/attachment.html>
More information about the llvm-bugs
mailing list