1 //===-- OpenMP/InteropAPI.h - OpenMP interoperability types and API - C++ -===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
11 #ifndef OMPTARGET_OPENMP_INTEROP_API_H
12 #define OMPTARGET_OPENMP_INTEROP_API_H
16 #include "omptarget.h"
20 typedef enum kmp_interop_type_t
{
21 kmp_interop_type_unknown
= -1,
22 kmp_interop_type_platform
,
23 kmp_interop_type_device
,
24 kmp_interop_type_tasksync
,
27 /// The interop value type, aka. the interop object.
28 typedef struct omp_interop_val_t
{
29 /// Device and interop-type are determined at construction time and fix.
30 omp_interop_val_t(intptr_t device_id
, kmp_interop_type_t interop_type
)
31 : interop_type(interop_type
), device_id(device_id
) {}
32 const char *err_str
= nullptr;
33 __tgt_async_info
*async_info
= nullptr;
34 __tgt_device_info device_info
;
35 const kmp_interop_type_t interop_type
;
36 const intptr_t device_id
;
37 const omp_foreign_runtime_ids_t vendor_id
= cuda
;
38 const intptr_t backend_type_id
= omp_interop_backend_type_cuda_1
;
43 #endif // OMPTARGET_OPENMP_INTEROP_API_H