add ocloc versioning

Adds versioning of ocloc and new api function returning ocloc
version.
This commit is contained in:
Krystian Chmielewski
2020-12-18 12:14:58 +01:00
committed by Compute-Runtime-Automation
parent c3083592ad
commit 903ed4e6d4
3 changed files with 22 additions and 0 deletions

View File

@@ -7,6 +7,17 @@
#include <cstdint>
#ifndef OCLOC_MAKE_VERSION
/// Generates ocloc API versions
#define OCLOC_MAKE_VERSION(_major, _minor) ((_major << 16) | (_minor & 0x0000ffff))
#endif // OCLOC_MAKE_VERSION
typedef enum _ocloc_version_t {
OCLOC_VERSION_1_0 = OCLOC_MAKE_VERSION(1, 0), ///< version 1.0
OCLOC_VERSION_CURRENT = OCLOC_MAKE_VERSION(1, 0), ///< latest known version
OCLOC_VERSION_FORCE_UINT32 = 0x7fffffff
} ocloc_version_t;
#ifdef _WIN32
#define SIGNATURE __declspec(dllexport) int __cdecl
#else
@@ -82,4 +93,7 @@ SIGNATURE oclocInvoke(unsigned int numArgs, const char *argv[],
///
/// \returns 0 on succes. Returns non-0 in case of failure.
SIGNATURE oclocFreeOutput(uint32_t *numOutputs, uint8_t ***dataOutputs, uint64_t **lenOutputs, char ***nameOutputs);
/// Returns the current version of oclock
SIGNATURE oclocVersion();
}