//
// AUTOGENERATED, DO NOT EDIT
//
-#ifndef ADDITIONAL_FN_DEFINITIONS
-#define ADDITIONAL_FN_DEFINITIONS
-#endif
-
// generated by parser_clamdblas.py
enum OPENCLAMDBLAS_FN_ID {
// OPENCLAMDBLAS_FN_clAmdBlasAddScratchImage = 0,
NULL/*&clAmdBlasiDamax_definition*/,
NULL/*&clAmdBlasiSamax_definition*/,
NULL/*&clAmdBlasiZamax_definition*/,
- ADDITIONAL_FN_DEFINITIONS // macro for custom functions
};
// number of enabled functions: 6
//
// AUTOGENERATED, DO NOT EDIT
//
-#ifndef ADDITIONAL_FN_DEFINITIONS
-#define ADDITIONAL_FN_DEFINITIONS
-#endif
-
// generated by parser_clamdfft.py
enum OPENCLAMDFFT_FN_ID {
OPENCLAMDFFT_FN_clAmdFftBakePlan = 0,
&clAmdFftSetResultLocation_definition,
&clAmdFftSetup_definition,
&clAmdFftTeardown_definition,
- ADDITIONAL_FN_DEFINITIONS // macro for custom functions
};
// number of enabled functions: 15
//
// AUTOGENERATED, DO NOT EDIT
//
-
-#ifndef ADDITIONAL_FN_DEFINITIONS
-#define ADDITIONAL_FN_DEFINITIONS
-#endif
-
// generated by parser_cl.py
enum OPENCL_FN_ID {
OPENCL_FN_clBuildProgram = 0,
&clUnloadCompiler_definition,
&clUnloadPlatformCompiler_definition,
&clWaitForEvents_definition,
- ADDITIONAL_FN_DEFINITIONS // macro for custom functions
};
// number of enabled functions: 88
else:
print ' NULL/*&%s_definition*/,' % (fn['name'])
first = False
- print ' ADDITIONAL_FN_DEFINITIONS // macro for custom functions'
print '};'
@outputToString
-#ifndef ADDITIONAL_FN_DEFINITIONS
-#define ADDITIONAL_FN_DEFINITIONS
-#endif
-
@CL_FN_ENUMS@
namespace {
-#ifndef ADDITIONAL_FN_DEFINITIONS
-#define ADDITIONAL_FN_DEFINITIONS
-#endif
-
@CL_FN_ENUMS@
namespace {
-
-#ifndef ADDITIONAL_FN_DEFINITIONS
-#define ADDITIONAL_FN_DEFINITIONS
-#endif
-
@CL_FN_ENUMS@
namespace {
#define CUSTOM_FUNCTION_ID 1000
-#undef ADDITIONAL_FN_DEFINITIONS
-
//
// END OF CUSTOM FUNCTIONS HERE
//
static void* openclamdblas_check_fn(int ID)
{
- ID = (ID <= CUSTOM_FUNCTION_ID) ? ID : ID - CUSTOM_FUNCTION_ID;
assert(ID >= 0 && ID < (int)(sizeof(openclamdblas_fn)/sizeof(openclamdblas_fn[0])));
const struct DynamicFnEntry* e = openclamdblas_fn[ID];
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
#define CUSTOM_FUNCTION_ID 1000
-#undef ADDITIONAL_FN_DEFINITIONS
-
//
// END OF CUSTOM FUNCTIONS HERE
//
static void* openclamdfft_check_fn(int ID)
{
- ID = (ID <= CUSTOM_FUNCTION_ID) ? ID : ID - CUSTOM_FUNCTION_ID;
assert(ID >= 0 && ID < (int)(sizeof(openclamdfft_fn)/sizeof(openclamdfft_fn[0])));
const struct DynamicFnEntry* e = openclamdfft_fn[ID];
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
#include "runtime_common.hpp"
+#include "autogenerated/opencl_core_impl.hpp"
+
//
// BEGIN OF CUSTOM FUNCTIONS
//
#define CUSTOM_FUNCTION_ID 1000
-#undef ADDITIONAL_FN_DEFINITIONS
-
//
// END OF CUSTOM FUNCTIONS HERE
//
-#include "autogenerated/opencl_core_impl.hpp"
-
static void* opencl_check_fn(int ID)
{
- ID = (ID <= CUSTOM_FUNCTION_ID) ? ID : ID - CUSTOM_FUNCTION_ID;
- assert(ID >= 0 && ID < (int)(sizeof(opencl_fn_list)/sizeof(opencl_fn_list[0])));
- const struct DynamicFnEntry* e = opencl_fn_list[ID];
+ const struct DynamicFnEntry* e = NULL;
+ if (ID < CUSTOM_FUNCTION_ID)
+ {
+ assert(ID >= 0 && ID < (int)(sizeof(opencl_fn_list)/sizeof(opencl_fn_list[0])));
+ e = opencl_fn_list[ID];
+ }
+ else
+ {
+ CV_ErrorNoReturn(cv::Error::StsBadArg, "Invalid function ID");
+ }
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
if (!func)
{