blob: 8150f7421575fe74f2293507d8839e09dc0c46e6 [file] [log] [blame]
Jonas Hahnfeld43322802017-12-06 21:59:07 +00001//===---------- private.h - Target independent OpenMP target RTL ----------===//
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// Private function declarations and helper macros for debugging output.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef _OMPTARGET_PRIVATE_H
15#define _OMPTARGET_PRIVATE_H
16
17#include <omptarget.h>
18
19#include <cstdint>
20
Jonas Hahnfelda7c4f322017-12-06 21:59:15 +000021extern int target_data_begin(DeviceTy &Device, int32_t arg_num,
22 void **args_base, void **args, int64_t *arg_sizes, int64_t *arg_types);
23
24extern int target_data_end(DeviceTy &Device, int32_t arg_num, void **args_base,
25 void **args, int64_t *arg_sizes, int64_t *arg_types);
26
27extern void target_data_update(DeviceTy &Device, int32_t arg_num,
28 void **args_base, void **args, int64_t *arg_sizes, int64_t *arg_types);
29
Jonas Hahnfeld43322802017-12-06 21:59:07 +000030extern int target(int64_t device_id, void *host_ptr, int32_t arg_num,
31 void **args_base, void **args, int64_t *arg_sizes, int64_t *arg_types,
32 int32_t team_num, int32_t thread_limit, int IsTeamConstruct);
33
Jonas Hahnfelda7c4f322017-12-06 21:59:15 +000034extern int CheckDeviceAndCtors(int64_t device_id);
35
Jonas Hahnfeld43322802017-12-06 21:59:07 +000036#ifdef OMPTARGET_DEBUG
37extern int DebugLevel;
38
39#define DP(...) \
40 do { \
41 if (DebugLevel > 0) { \
42 DEBUGP("Libomptarget", __VA_ARGS__); \
43 } \
44 } while (false)
45#else // OMPTARGET_DEBUG
46#define DP(...) {}
47#endif // OMPTARGET_DEBUG
48
49#endif