1 // RUN: %libomptarget-compilexx-run-and-check-generic
8 // Data structure definitions copied from OpenMP RTL.
9 struct MapComponentInfoTy
{
15 MapComponentInfoTy() = default;
16 MapComponentInfoTy(void *Base
, void *Begin
, int64_t Size
, int64_t Type
,
18 : Base(Base
), Begin(Begin
), Size(Size
), Type(Type
), Name(Name
) {}
21 struct MapperComponentsTy
{
22 std::vector
<MapComponentInfoTy
> Components
;
25 // OpenMP RTL interfaces
29 int64_t __tgt_mapper_num_components(void *rt_mapper_handle
);
30 void __tgt_push_mapper_component(void *rt_mapper_handle
, void *base
,
31 void *begin
, int64_t size
, int64_t type
,
37 int main(int argc
, char *argv
[]) {
38 MapperComponentsTy MC
;
41 // Push 2 elements into MC.
42 __tgt_push_mapper_component((void *)&MC
, base
, begin
, size
, type
, nullptr);
43 __tgt_push_mapper_component((void *)&MC
, base
, begin
, size
, type
, nullptr);
44 int64_t num
= __tgt_mapper_num_components((void *)&MC
);
46 printf("num=%" PRId64
"\n", num
);