Skip to content

dnn(OpenCL): fix out of bound access in GEMM-like kernels#20661

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:dnn_ocl_fix_gemm_like_kernel
Sep 10, 2021
Merged

dnn(OpenCL): fix out of bound access in GEMM-like kernels#20661
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:dnn_ocl_fix_gemm_like_kernel

Conversation

@alalek
Copy link
Copy Markdown
Member

@alalek alalek commented Sep 6, 2021

  • dropped usage of CreateSubBuffer() - buffers lifetime management issue
  • fixed elementwise offset
  • avoid out of bounds read access

relates #20651 #20583 (CreateSubBuffer())

Tasks:

  • measure performance (up to 20% of degradation on Gen9 due to "#if 0" condition)
  • (backlog) remove CreateSubBuffer and other cleanup
force_builders=Custom,Linux AVX2,Linux OpenCL
build_image:Custom=ubuntu:18.04
buildworker:Custom=linux-5
test_opencl:Custom=ON

build_image:Linux AVX2=ubuntu:18.04
buildworker:Linux AVX2=linux-3
test_opencl:Linux AVX2=ON

buildworker:Custom Win=windows-3
build_image:Custom Win=msvs2019
test_opencl:Custom Win=ON
test_filter:Custom Win=*:-Test_Caffe_nets.FasterRCNN_vgg16/1

- dropped usage of CreateSubBuffer() - buffers lifetime management issue
- fixed elementwise offset
- avoid out of bounds read access
@diablodale
Copy link
Copy Markdown
Contributor

🎉Yahoo! Dropping CreateSubBuffer removes a blocking issue of my refactoring of the OpenCL allocator (context switching, svm, etc.). This is probably not your immediate focus, but it does help the longer-term work that I'm doing in parallel.👍

You have removed all uses of CreateSubBuffer in OpenCV. It is private to the class and only used in that DNN class. Can you remove the function? Or comment it out so that it isn't used by anyone?

@alalek
Copy link
Copy Markdown
Member Author

alalek commented Sep 10, 2021

👍

@opencv-pushbot opencv-pushbot merged commit 6ace801 into opencv:3.4 Sep 10, 2021
@alalek alalek mentioned this pull request Sep 11, 2021
@alalek alalek mentioned this pull request Oct 15, 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.

3 participants