Jim Cownie | 33f7b24 | 2014-04-09 15:40:23 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.txt for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | |
| 11 | /*! \file |
| 12 | \brief The interface between compiler-generated target code and runtime library |
| 13 | */ |
| 14 | |
| 15 | #ifndef COMPILER_IF_TARGET_H_INCLUDED |
| 16 | #define COMPILER_IF_TARGET_H_INCLUDED |
| 17 | |
| 18 | #include "offload_target.h" |
| 19 | |
| 20 | #define OFFLOAD_TARGET_ENTER OFFLOAD_PREFIX(target_enter) |
| 21 | #define OFFLOAD_TARGET_LEAVE OFFLOAD_PREFIX(target_leave) |
| 22 | #define OFFLOAD_TARGET_MAIN OFFLOAD_PREFIX(target_main) |
| 23 | |
| 24 | /*! \fn OFFLOAD_TARGET_ENTER |
| 25 | \brief Fill in variable addresses using VarDesc array. |
| 26 | \brief Then call back the runtime library to fetch data. |
| 27 | \param ofld Offload descriptor created by runtime. |
| 28 | \param var_desc_num Number of variable descriptors. |
| 29 | \param var_desc Pointer to VarDesc array. |
| 30 | \param var_desc2 Pointer to VarDesc2 array. |
| 31 | */ |
| 32 | extern "C" void OFFLOAD_TARGET_ENTER( |
| 33 | OFFLOAD ofld, |
| 34 | int var_desc_num, |
| 35 | VarDesc *var_desc, |
| 36 | VarDesc2 *var_desc2 |
| 37 | ); |
| 38 | |
| 39 | /*! \fn OFFLOAD_TARGET_LEAVE |
| 40 | \brief Call back the runtime library to gather outputs using VarDesc array. |
| 41 | \param ofld Offload descriptor created by OFFLOAD_TARGET_ACQUIRE. |
| 42 | */ |
| 43 | extern "C" void OFFLOAD_TARGET_LEAVE( |
| 44 | OFFLOAD ofld |
| 45 | ); |
| 46 | |
| 47 | // Entry point for the target application. |
| 48 | extern "C" void OFFLOAD_TARGET_MAIN(void); |
| 49 | |
| 50 | #endif // COMPILER_IF_TARGET_H_INCLUDED |