summaryrefslogtreecommitdiffstats
path: root/openmp/offload/src/compiler_if_target.h
diff options
context:
space:
mode:
authorJim Cownie <james.h.cownie@intel.com>2014-04-09 15:40:23 +0000
committerJim Cownie <james.h.cownie@intel.com>2014-04-09 15:40:23 +0000
commit33f7b24d9f704afd80f768cf91f777a65f8f0718 (patch)
tree9e13f5de0d009a3469dd6a980bb60a6cb7fdc571 /openmp/offload/src/compiler_if_target.h
parent30d56a7b860b9eed3447ae3d96cacd600b58856f (diff)
downloadbcm5719-llvm-33f7b24d9f704afd80f768cf91f777a65f8f0718.tar.gz
bcm5719-llvm-33f7b24d9f704afd80f768cf91f777a65f8f0718.zip
Add the offload directory which contains the code needed to support
OpenMP 4.0 "target" directives. This will need more work for generality, but we want to get it out and visible to the community. llvm-svn: 205909
Diffstat (limited to 'openmp/offload/src/compiler_if_target.h')
-rw-r--r--openmp/offload/src/compiler_if_target.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/openmp/offload/src/compiler_if_target.h b/openmp/offload/src/compiler_if_target.h
new file mode 100644
index 00000000000..49d2c1c6099
--- /dev/null
+++ b/openmp/offload/src/compiler_if_target.h
@@ -0,0 +1,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