core/ocl: runtime, remove unused declarations

This commit is contained in:
Alexander Alekhin 2014-01-09 19:07:39 +04:00
parent a75cfe13e7
commit f7b0940d44
10 changed files with 12 additions and 43 deletions

View File

@ -1,10 +1,6 @@
// //
// AUTOGENERATED, DO NOT EDIT // AUTOGENERATED, DO NOT EDIT
// //
#ifndef ADDITIONAL_FN_DEFINITIONS
#define ADDITIONAL_FN_DEFINITIONS
#endif
// generated by parser_clamdblas.py // generated by parser_clamdblas.py
enum OPENCLAMDBLAS_FN_ID { enum OPENCLAMDBLAS_FN_ID {
// OPENCLAMDBLAS_FN_clAmdBlasAddScratchImage = 0, // OPENCLAMDBLAS_FN_clAmdBlasAddScratchImage = 0,
@ -1251,7 +1247,6 @@ static const struct DynamicFnEntry* openclamdblas_fn[] = {
NULL/*&clAmdBlasiDamax_definition*/, NULL/*&clAmdBlasiDamax_definition*/,
NULL/*&clAmdBlasiSamax_definition*/, NULL/*&clAmdBlasiSamax_definition*/,
NULL/*&clAmdBlasiZamax_definition*/, NULL/*&clAmdBlasiZamax_definition*/,
ADDITIONAL_FN_DEFINITIONS // macro for custom functions
}; };
// number of enabled functions: 6 // number of enabled functions: 6

View File

@ -1,10 +1,6 @@
// //
// AUTOGENERATED, DO NOT EDIT // AUTOGENERATED, DO NOT EDIT
// //
#ifndef ADDITIONAL_FN_DEFINITIONS
#define ADDITIONAL_FN_DEFINITIONS
#endif
// generated by parser_clamdfft.py // generated by parser_clamdfft.py
enum OPENCLAMDFFT_FN_ID { enum OPENCLAMDFFT_FN_ID {
OPENCLAMDFFT_FN_clAmdFftBakePlan = 0, OPENCLAMDFFT_FN_clAmdFftBakePlan = 0,
@ -393,7 +389,6 @@ static const struct DynamicFnEntry* openclamdfft_fn[] = {
&clAmdFftSetResultLocation_definition, &clAmdFftSetResultLocation_definition,
&clAmdFftSetup_definition, &clAmdFftSetup_definition,
&clAmdFftTeardown_definition, &clAmdFftTeardown_definition,
ADDITIONAL_FN_DEFINITIONS // macro for custom functions
}; };
// number of enabled functions: 15 // number of enabled functions: 15

View File

@ -1,11 +1,6 @@
// //
// AUTOGENERATED, DO NOT EDIT // AUTOGENERATED, DO NOT EDIT
// //
#ifndef ADDITIONAL_FN_DEFINITIONS
#define ADDITIONAL_FN_DEFINITIONS
#endif
// generated by parser_cl.py // generated by parser_cl.py
enum OPENCL_FN_ID { enum OPENCL_FN_ID {
OPENCL_FN_clBuildProgram = 0, OPENCL_FN_clBuildProgram = 0,
@ -666,7 +661,6 @@ static const struct DynamicFnEntry* opencl_fn_list[] = {
&clUnloadCompiler_definition, &clUnloadCompiler_definition,
&clUnloadPlatformCompiler_definition, &clUnloadPlatformCompiler_definition,
&clWaitForEvents_definition, &clWaitForEvents_definition,
ADDITIONAL_FN_DEFINITIONS // macro for custom functions
}; };
// number of enabled functions: 88 // number of enabled functions: 88

View File

@ -161,7 +161,6 @@ def generateListOfDefinitions(fns, name='opencl_fn_list'):
else: else:
print ' NULL/*&%s_definition*/,' % (fn['name']) print ' NULL/*&%s_definition*/,' % (fn['name'])
first = False first = False
print ' ADDITIONAL_FN_DEFINITIONS // macro for custom functions'
print '};' print '};'
@outputToString @outputToString

View File

@ -1,7 +1,3 @@
#ifndef ADDITIONAL_FN_DEFINITIONS
#define ADDITIONAL_FN_DEFINITIONS
#endif
@CL_FN_ENUMS@ @CL_FN_ENUMS@
namespace { namespace {

View File

@ -1,7 +1,3 @@
#ifndef ADDITIONAL_FN_DEFINITIONS
#define ADDITIONAL_FN_DEFINITIONS
#endif
@CL_FN_ENUMS@ @CL_FN_ENUMS@
namespace { namespace {

View File

@ -1,8 +1,3 @@
#ifndef ADDITIONAL_FN_DEFINITIONS
#define ADDITIONAL_FN_DEFINITIONS
#endif
@CL_FN_ENUMS@ @CL_FN_ENUMS@
namespace { namespace {

View File

@ -100,8 +100,6 @@ static void* openclamdblas_check_fn(int ID);
#define CUSTOM_FUNCTION_ID 1000 #define CUSTOM_FUNCTION_ID 1000
#undef ADDITIONAL_FN_DEFINITIONS
// //
// END OF CUSTOM FUNCTIONS HERE // END OF CUSTOM FUNCTIONS HERE
// //
@ -110,7 +108,6 @@ static void* openclamdblas_check_fn(int ID);
static void* openclamdblas_check_fn(int ID) 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]))); assert(ID >= 0 && ID < (int)(sizeof(openclamdblas_fn)/sizeof(openclamdblas_fn[0])));
const struct DynamicFnEntry* e = openclamdblas_fn[ID]; const struct DynamicFnEntry* e = openclamdblas_fn[ID];
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);

View File

@ -100,8 +100,6 @@ static void* openclamdfft_check_fn(int ID);
#define CUSTOM_FUNCTION_ID 1000 #define CUSTOM_FUNCTION_ID 1000
#undef ADDITIONAL_FN_DEFINITIONS
// //
// END OF CUSTOM FUNCTIONS HERE // END OF CUSTOM FUNCTIONS HERE
// //
@ -110,7 +108,6 @@ static void* openclamdfft_check_fn(int ID);
static void* openclamdfft_check_fn(int ID) 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]))); assert(ID >= 0 && ID < (int)(sizeof(openclamdfft_fn)/sizeof(openclamdfft_fn[0])));
const struct DynamicFnEntry* e = openclamdfft_fn[ID]; const struct DynamicFnEntry* e = openclamdfft_fn[ID];
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);

View File

@ -169,25 +169,30 @@ static void* opencl_check_fn(int ID);
#include "runtime_common.hpp" #include "runtime_common.hpp"
#include "autogenerated/opencl_core_impl.hpp"
// //
// BEGIN OF CUSTOM FUNCTIONS // BEGIN OF CUSTOM FUNCTIONS
// //
#define CUSTOM_FUNCTION_ID 1000 #define CUSTOM_FUNCTION_ID 1000
#undef ADDITIONAL_FN_DEFINITIONS
// //
// END OF CUSTOM FUNCTIONS HERE // END OF CUSTOM FUNCTIONS HERE
// //
#include "autogenerated/opencl_core_impl.hpp"
static void* opencl_check_fn(int ID) static void* opencl_check_fn(int ID)
{ {
ID = (ID <= CUSTOM_FUNCTION_ID) ? ID : ID - CUSTOM_FUNCTION_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]))); assert(ID >= 0 && ID < (int)(sizeof(opencl_fn_list)/sizeof(opencl_fn_list[0])));
const struct DynamicFnEntry* e = opencl_fn_list[ID]; e = opencl_fn_list[ID];
}
else
{
CV_ErrorNoReturn(cv::Error::StsBadArg, "Invalid function ID");
}
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); void* func = CV_CL_GET_PROC_ADDRESS(e->fnName);
if (!func) if (!func)
{ {