- Remove UNSUPPORTED: intelgpu from 12 passing tests: * mapping/data_member_ref.cpp * offloading/bug50022.cpp, info.c * offloading/target_critical_region.cpp, target_depend_nowait.cpp, target_nowait_target.cpp * offloading/strided_update/* (6 tests) * unified_shared_memory/close_member.c - Change CUDA tests from XFAIL to UNSUPPORTED for Intel GPU: * offloading/CUDA/basic_launch.cu * offloading/CUDA/basic_launch_blocks_and_threads.cu * offloading/CUDA/basic_launch_multi_arg.cu * offloading/CUDA/launch_tu.cu - Add Intel GPU configuration section to lit.cfg to disable USM tests by default
41 lines
877 B
C++
41 lines
877 B
C++
// RUN: %libomptarget-compilexx-and-run-generic
|
|
// RUN: %libomptarget-compileoptxx-and-run-generic
|
|
|
|
#include <cassert>
|
|
#include <iostream>
|
|
#include <stdexcept>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
int a = 0;
|
|
std::cout << "outside a = " << a << " addr " << &a << std::endl;
|
|
#pragma omp target map(tofrom : a) depend(out : a) nowait
|
|
{
|
|
int sum = 0;
|
|
for (int i = 0; i < 100000; i++)
|
|
sum++;
|
|
a = 1;
|
|
}
|
|
|
|
#pragma omp task depend(inout : a) shared(a)
|
|
{
|
|
std::cout << "a = " << a << " addr " << &a << std::endl;
|
|
if (a != 1)
|
|
throw std::runtime_error("wrong result!");
|
|
a = 2;
|
|
}
|
|
|
|
#pragma omp task depend(inout : a) shared(a)
|
|
{
|
|
std::cout << "a = " << a << " addr " << &a << std::endl;
|
|
if (a != 2)
|
|
throw std::runtime_error("wrong result!");
|
|
a = 3;
|
|
}
|
|
|
|
#pragma omp taskwait
|
|
|
|
assert(a == 3 && "wrong result!");
|
|
|
|
return 0;
|
|
}
|