DPC++ Runtime
Runtime libraries for oneAPI DPC++
ocloc_api.h File Reference
#include <cstdint>
Include dependency graph for ocloc_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OCLOC_MAKE_VERSION(_major, _minor)   ((_major << 16) | (_minor & 0x0000ffff))
 Generates ocloc API versions. More...
 
#define SIGNATURE   int
 

Typedefs

typedef enum _ocloc_version_t ocloc_version_t
 

Enumerations

enum  _ocloc_version_t { OCLOC_VERSION_1_0 = OCLOC_MAKE_VERSION(1, 0), OCLOC_VERSION_CURRENT = OCLOC_MAKE_VERSION(1, 0), OCLOC_VERSION_FORCE_UINT32 = 0x7fffffff }
 

Functions

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. More...
 
SIGNATURE oclocFreeOutput (uint32_t *NumOutputs, uint8_t ***DataOutputs, uint64_t **LenOutputs, char ***NameOutputs)
 Frees results of oclocInvoke. More...
 
SIGNATURE oclocVersion ()
 Returns the current version of ocloc. More...
 

Macro Definition Documentation

◆ OCLOC_MAKE_VERSION

#define OCLOC_MAKE_VERSION (   _major,
  _minor 
)    ((_major << 16) | (_minor & 0x0000ffff))

Generates ocloc API versions.

Definition at line 16 of file ocloc_api.h.

◆ SIGNATURE

#define SIGNATURE   int

Definition at line 29 of file ocloc_api.h.

Typedef Documentation

◆ ocloc_version_t

Enumeration Type Documentation

◆ _ocloc_version_t

Enumerator
OCLOC_VERSION_1_0 

version 1.0

OCLOC_VERSION_CURRENT 

latest known version

OCLOC_VERSION_FORCE_UINT32 

Definition at line 20 of file ocloc_api.h.

Function Documentation

◆ oclocFreeOutput()

SIGNATURE oclocFreeOutput ( uint32_t *  NumOutputs,
uint8_t ***  DataOutputs,
uint64_t **  LenOutputs,
char ***  NameOutputs 
)

Frees results of oclocInvoke.

Parameters
NumOutputsis number of outputs as returned by oclocInvoke().
DataOutputsis array of outputs as returned by oclocInvoke().
LenOutputsis array of sizes of outputs as returned by oclocInvoke().
NameOutputsis array of names of outputs as returned by oclocInvoke()
Returns
0 on succes. Returns non-0 in case of failure.

Referenced by cl::sycl::ext::intel::experimental::detail::compileToSPIRV().

◆ 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.

Supported commands match the functionality of ocloc executable (check ocloc's "help" for reference : shared/offline_compiler/source/ocloc_api.cpp) at https://github.com/intel/compute-runtime.

NumArgs and argv params represent the command line. Remaining params represent I/O. Output params should be freed using oclocFreeOutput() when no longer needed. List and names of outputs match outputs of ocloc executable.

Parameters
NumArgsis the number of arguments to pass to ocloc.
Argvis an array of arguments to be passed to ocloc.
NumSourcesis the number of in-memory representations of source files to be passed to ocloc.
DataSourcesis an array of in-memory representations of source files to be passed to ocloc.
LenSourcesis an array of sizes of in-memory representations of source files passed to ocloc as DataSources.
NameSourcesis an array of names of in-memory representations of source files passed to ocloc as DataSources.
NumInputHeadersis the number of in-memory representations of header files to be passed to ocloc.
DataInputHeadersis an array of in-memory representations of header files to be passed to ocloc.
LenInputHeadersis an array of sizes of in-memory representations of header files passed to ocloc as DataInputHeaders.
NameInputHeadersis an array of names of in-memory representations of header files passed to ocloc as DataInputHeaders.
NumOutputsreturns the number of outputs.
DataOutputsreturns an array of in-memory representations of output files.
LenOutputsreturns an array of sizes of in-memory representations of output files.
NameOutputsreturns an array of names of in-memory representations of output files. Special name stdout.log describes output that contains messages generated by ocloc (e.g. compiler errors/warnings).
Returns
0 on succes. Returns non-0 in case of failure.

Referenced by cl::sycl::ext::intel::experimental::detail::compileToSPIRV().

◆ oclocVersion()

SIGNATURE oclocVersion ( )

Returns the current version of ocloc.

Referenced by cl::sycl::ext::intel::experimental::detail::compileToSPIRV().