summaryrefslogtreecommitdiffstats
path: root/openmp/offload/src/compiler_if_target.h
blob: 49d2c1c609941d8ee2d14da1f8e6b0229b5e4176 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.txt for details.
//
//===----------------------------------------------------------------------===//


/*! \file
    \brief The interface between compiler-generated target code and runtime library
*/

#ifndef COMPILER_IF_TARGET_H_INCLUDED
#define COMPILER_IF_TARGET_H_INCLUDED

#include "offload_target.h"

#define OFFLOAD_TARGET_ENTER            OFFLOAD_PREFIX(target_enter)
#define OFFLOAD_TARGET_LEAVE            OFFLOAD_PREFIX(target_leave)
#define OFFLOAD_TARGET_MAIN             OFFLOAD_PREFIX(target_main)

/*! \fn OFFLOAD_TARGET_ENTER
    \brief Fill in variable addresses using VarDesc array.
    \brief Then call back the runtime library to fetch data.
    \param ofld         Offload descriptor created by runtime.
    \param var_desc_num Number of variable descriptors.
    \param var_desc     Pointer to VarDesc array.
    \param var_desc2    Pointer to VarDesc2 array.
*/
extern "C" void OFFLOAD_TARGET_ENTER(
    OFFLOAD ofld,
    int var_desc_num,
    VarDesc *var_desc,
    VarDesc2 *var_desc2
);

/*! \fn OFFLOAD_TARGET_LEAVE
    \brief Call back the runtime library to gather outputs using VarDesc array.
    \param ofld Offload descriptor created by OFFLOAD_TARGET_ACQUIRE.
*/
extern "C" void OFFLOAD_TARGET_LEAVE(
    OFFLOAD ofld
);

// Entry point for the target application.
extern "C" void OFFLOAD_TARGET_MAIN(void);

#endif // COMPILER_IF_TARGET_H_INCLUDED
OpenPOWER on IntegriCloud