DPC++ Runtime
Runtime libraries for oneAPI DPC++
ocloc_api.h
Go to the documentation of this file.
1 //===------- ocloc_api.h --------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // This file is copied from
10 // https://github.com/intel/compute-runtime/blob/master/shared/offline_compiler/source/ocloc_api.h
11 
12 #include <cstdint>
13 
14 #ifndef OCLOC_MAKE_VERSION
16 #define OCLOC_MAKE_VERSION(_major, _minor) \
17  ((_major << 16) | (_minor & 0x0000ffff))
18 #endif // OCLOC_MAKE_VERSION
19 
20 typedef enum _ocloc_version_t {
23  OCLOC_VERSION_FORCE_UINT32 = 0x7fffffff
25 
26 #ifdef _WIN32
27 #define SIGNATURE __declspec(dllexport) int __cdecl
28 #else
29 #define SIGNATURE int
30 #endif
31 
32 extern "C" {
85 SIGNATURE oclocInvoke(uint32_t NumArgs, const char *Argv[], uint32_t NumSources,
86  const uint8_t **DataSources, const uint64_t *LenSources,
87  const char **NameSources, uint32_t NumInputHeaders,
88  const uint8_t **DataInputHeaders,
89  const uint64_t *LenInputHeaders,
90  const char **NameInputHeaders, uint32_t *NumOutputs,
91  uint8_t ***DataOutputs, uint64_t **LenOutputs,
92  char ***NameOutputs);
93 
105 SIGNATURE oclocFreeOutput(uint32_t *NumOutputs, uint8_t ***DataOutputs,
106  uint64_t **LenOutputs, char ***NameOutputs);
107 
110 }
enum _ocloc_version_t ocloc_version_t
SIGNATURE oclocVersion()
Returns the current version of ocloc.
SIGNATURE oclocInvoke(uint32_t NumArgs, const char *Argv[], uint32_t NumSources, const uint8_t **DataSources, const uint64_t *LenSources, const char **NameSources, uint32_t NumInputHeaders, const uint8_t **DataInputHeaders, const uint64_t *LenInputHeaders, const char **NameInputHeaders, uint32_t *NumOutputs, uint8_t ***DataOutputs, uint64_t **LenOutputs, char ***NameOutputs)
Invokes ocloc API using C interface.
#define OCLOC_MAKE_VERSION(_major, _minor)
Generates ocloc API versions.
Definition: ocloc_api.h:16
_ocloc_version_t
Definition: ocloc_api.h:20
@ OCLOC_VERSION_CURRENT
latest known version
Definition: ocloc_api.h:22
@ OCLOC_VERSION_1_0
version 1.0
Definition: ocloc_api.h:21
@ OCLOC_VERSION_FORCE_UINT32
Definition: ocloc_api.h:23
SIGNATURE oclocFreeOutput(uint32_t *NumOutputs, uint8_t ***DataOutputs, uint64_t **LenOutputs, char ***NameOutputs)
Frees results of oclocInvoke.
#define SIGNATURE
Definition: ocloc_api.h:29