mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 06:26:29 +08:00
Merge pull request #12620 from alalek:ocl_extra_build_options
This commit is contained in:
commit
682180e0cd
@ -238,6 +238,20 @@ static const bool CV_OPENCL_DISABLE_BUFFER_RECT_OPERATIONS = utils::getConfigura
|
||||
#endif
|
||||
);
|
||||
|
||||
static const String getBuildExtraOptions()
|
||||
{
|
||||
static String param_buildExtraOptions;
|
||||
static bool initialized = false;
|
||||
if (!initialized)
|
||||
{
|
||||
param_buildExtraOptions = utils::getConfigurationParameterString("OPENCV_OPENCL_BUILD_EXTRA_OPTIONS", "");
|
||||
initialized = true;
|
||||
if (!param_buildExtraOptions.empty())
|
||||
CV_LOG_WARNING(NULL, "OpenCL: using extra build options: '" << param_buildExtraOptions << "'");
|
||||
}
|
||||
return param_buildExtraOptions;
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCL
|
||||
|
||||
struct UMat2D
|
||||
@ -3522,6 +3536,9 @@ struct Program::Impl
|
||||
buildflags = joinBuildOptions(buildflags, " -D AMD_DEVICE");
|
||||
else if (device.isIntel())
|
||||
buildflags = joinBuildOptions(buildflags, " -D INTEL_DEVICE");
|
||||
const String param_buildExtraOptions = getBuildExtraOptions();
|
||||
if (!param_buildExtraOptions.empty())
|
||||
buildflags = joinBuildOptions(buildflags, param_buildExtraOptions);
|
||||
}
|
||||
compile(ctx, src_, errmsg);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user