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
15 #define OCLOC_MAKE_VERSION(_major, _minor) \
17  ((_major << 16) | (_minor & 0x0000ffff))
18 #endif // OCLOC_MAKE_VERSION
19 
20 typedef enum _ocloc_version_t {
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 }
SIGNATURE
#define SIGNATURE
Definition: ocloc_api.h:29
oclocInvoke
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.
OCLOC_VERSION_CURRENT
@ OCLOC_VERSION_CURRENT
latest known version
Definition: ocloc_api.h:22
_ocloc_version_t
_ocloc_version_t
Definition: ocloc_api.h:20
oclocVersion
SIGNATURE oclocVersion()
Returns the current version of ocloc.
OCLOC_MAKE_VERSION
#define OCLOC_MAKE_VERSION(_major, _minor)
Generates ocloc API versions.
Definition: ocloc_api.h:16
oclocFreeOutput
SIGNATURE oclocFreeOutput(uint32_t *NumOutputs, uint8_t ***DataOutputs, uint64_t **LenOutputs, char ***NameOutputs)
Frees results of oclocInvoke.
ocloc_version_t
enum _ocloc_version_t ocloc_version_t
OCLOC_VERSION_1_0
@ OCLOC_VERSION_1_0
version 1.0
Definition: ocloc_api.h:21
OCLOC_VERSION_FORCE_UINT32
@ OCLOC_VERSION_FORCE_UINT32
Definition: ocloc_api.h:23