Skip to content

[OpenMP] Add a test for D158802 #70678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// clang-format off
// RUN: %libomptarget-compilexx-generic
// RUN: env LIBOMPTARGET_INFO=16 \
// RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic

// UNSUPPORTED: aarch64-unknown-linux-gnu
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
// UNSUPPORTED: x86_64-pc-linux-gnu
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO

int main(int argc, char *argv[]) {
constexpr const int block_size = 256;
constexpr const int grid_size = 4;
constexpr const int count = block_size * grid_size;

int *data = new int[count];

#pragma omp target teams distribute parallel for thread_limit(block_size) map(from: data[0:count])
for (int i = 0; i < count; ++i)
data[i] = i;

for (int i = 0; i < count; ++i)
if (data[i] != i)
return 1;

delete[] data;

return 0;
}

// CHECK: Launching kernel {{.*}} with 4 blocks and 256 threads in SPMD mode