Skip to content

remove g_isOpenCVActivated errant assign and clarify variable#19133

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
diablodale:fix19132-opencvactivated
Dec 23, 2020
Merged

remove g_isOpenCVActivated errant assign and clarify variable#19133
opencv-pushbot merged 1 commit intoopencv:masterfrom
diablodale:fix19132-opencvactivated

Conversation

@diablodale
Copy link
Copy Markdown
Contributor

Fixes #19132

  • Remove errant assignment in getOpenCLAllocator_()
  • Rename variable in the 4 places from g_isOpenCVActivated to g_isOpenCLActivated

Tests are successful. Here is output of opencv_test_cored.exe. The 4 test fails are unrelated.

[----------] Global test environment tear-down
[ SKIPSTAT ] 34 tests skipped
[ SKIPSTAT ] TAG='mem_6gb' skip 1 tests
[ SKIPSTAT ] TAG='skip_bigdata' skip 1 tests
[ SKIPSTAT ] TAG='skip_other' skip 32 tests
[==========] 11608 tests from 245 test cases ran. (417470 ms total)
[  PASSED  ] 11604 tests.
[  FAILED  ] 4 tests, listed below:
[  FAILED  ] Core_InputOutput.filestorage_base64_basic_read_XML
[  FAILED  ] Core_InputOutput.filestorage_base64_basic_read_YAML
[  FAILED  ] Core_InputOutput.filestorage_base64_basic_read_JSON
[  FAILED  ] Core_globbing.accuracy

 4 FAILED TESTS
  YOU HAVE 19 DISABLED TESTS

Pull Request Readiness Checklist

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for contribution 👍


// true if we have initialized OpenCL subsystem with available platforms
static bool g_isOpenCVActivated = false;
static bool g_isOpenCLActivated = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is a typo.

static OpenCLAllocator* getOpenCLAllocator_() // call once guarantee
{
static OpenCLAllocator* g_allocator = new OpenCLAllocator(); // avoid destructor call (using of this object is too wide)
g_isOpenCVActivated = true;
Copy link
Copy Markdown
Member

@alalek alalek Dec 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, Not necessary too.

UMat::getStdAllocator() triggers this flag through ocl::useOpenCL() call.

@opencv-pushbot opencv-pushbot merged commit 1526591 into opencv:master Dec 23, 2020
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conflict assignment of g_isOpenCVActivated in OpenCL subsystem

3 participants