CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
// RUN: %libomptarget-compilexx-run-and-check-aarch64-unknown-linux-gnu
|
|
// RUN: %libomptarget-compilexx-run-and-check-powerpc64-ibm-linux-gnu
|
|
// RUN: %libomptarget-compilexx-run-and-check-powerpc64le-ibm-linux-gnu
|
|
// RUN: %libomptarget-compilexx-run-and-check-x86_64-unknown-linux-gnu
|
|
// RUN: %libomptarget-compilexx-run-and-check-nvptx64-nvidia-cuda
|
|
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
|
|
typedef struct {
|
|
short *a;
|
|
long d1, d2;
|
|
} DV_A;
|
|
|
|
typedef struct {
|
|
DV_A b;
|
|
long d3;
|
|
} C;
|
|
|
|
typedef struct {
|
|
C *c;
|
|
long d4, d5;
|
|
} DV_B;
|
|
|
|
int main() {
|
|
|
|
short arr1[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
|
|
short arr2[10] = {20, 31, 22, 23, 24, 25, 26, 27, 28, 29};
|
|
|
|
C c1[2];
|
|
c1[0].b.a = (short *)arr1;
|
|
c1[1].b.a = (short *)arr2;
|
|
c1[0].b.d1 = 111;
|
|
|
|
DV_B dvb1;
|
|
dvb1.c = (C *)&c1;
|
|
|
|
// CHECK: 10 111
|
|
printf("%d %ld %p %p %p %p\n", dvb1.c[0].b.a[0], dvb1.c[0].b.d1, &dvb1,
|
|
&dvb1.c[0], &dvb1.c[0].b, &dvb1.c[0].b.a[0]);
|
|
#pragma omp target map(to : dvb1, dvb1.c[0 : 2]) \
|
|
map(tofrom : dvb1.c[0].b.a[0 : 10], dvb1.c[1].b.a[0 : 10])
|
|
{
|
|
// CHECK: 10 111
|
|
printf("%d %ld %p %p %p %p\n", dvb1.c[0].b.a[0], dvb1.c[0].b.d1, &dvb1,
|
|
&dvb1.c[0], &dvb1.c[0].b, &dvb1.c[0].b.a[0]);
|
|
dvb1.c[0].b.a[0] = 333;
|
|
dvb1.c[0].b.d1 = 444;
|
|
}
|
|
// CHECK: 333 111
|
|
printf("%d %ld %p %p %p %p\n", dvb1.c[0].b.a[0], dvb1.c[0].b.d1, &dvb1,
|
|
&dvb1.c[0], &dvb1.c[0].b, &dvb1.c[0].b.a[0]);
|
|
}
|