1 // RUN: %libomptarget-compile-generic && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-generic 2>&1 | %fcheck-generic -allow-empty -check-prefix=DEBUG
2 // REQUIRES: libomptarget-debug
8 // Data structure definitions copied from OpenMP RTL.
9 struct __tgt_target_non_contig
{
15 enum tgt_map_type
{ OMP_TGT_MAPTYPE_NON_CONTIG
= 0x100000000000 };
17 // OpenMP RTL interfaces
21 void __tgt_target_data_update(int64_t device_id
, int32_t arg_num
,
22 void **args_base
, void **args
, int64_t *arg_sizes
,
30 // int arr[3][4][5][6];
31 // #pragma omp target update to(arr[0:2][1:3][1:2][:])
33 __tgt_target_non_contig non_contig
[5] = {
34 {0, 2, 480}, {1, 3, 120}, {1, 2, 24}, {0, 6, 4}, {0, 1, 4}};
35 int64_t size
= 4, type
= OMP_TGT_MAPTYPE_NON_CONTIG
;
38 void *begin
= &non_contig
;
39 int64_t *sizes
= &size
;
40 int64_t *types
= &type
;
42 // The below diagram is the visualization of the non-contiguous transfer after
43 // optimization. Note that each element represent the innermost dimension
44 // (unit size = 24) since the stride * count of last dimension is equal to the
45 // stride of second last dimension.
51 __tgt_target_data_update(/*device_id*/ -1, /*arg_num*/ 1, &base
, &begin
,
61 // double darr[3][4][5];
62 // #pragma omp target update to(darr[0:2:2][2:2][:2:2])
64 __tgt_target_non_contig non_contig_2
[4] = {
65 {0, 2, 320}, {2, 2, 40}, {0, 2, 16}, {0, 1, 8}};
66 int64_t size_2
= 4, type_2
= OMP_TGT_MAPTYPE_NON_CONTIG
;
69 void *begin_2
= &non_contig_2
;
70 int64_t *sizes_2
= &size_2
;
71 int64_t *types_2
= &type_2
;
73 // The below diagram is the visualization of the non-contiguous transfer after
74 // optimization. Note that each element represent the innermost dimension
75 // (unit size = 24) since the stride * count of last dimension is equal to the
76 // stride of second last dimension.
82 __tgt_target_data_update(/*device_id*/ -1, /*arg_num*/ 1, &base_2
, &begin_2
,