Results 1 to 3 of 3

Thread: Webcam - Image vs. Mapped Buffer

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    19

    Webcam - Image vs. Mapped Buffer

    So this is more of a general question. I'm doing some image processing on a webcam feed, so speed is crucial. I've been using Images, as pixel-wise access in kernels is faster than for buffers, but Images have the added overhead of needing to execute two copy commands to transfer the data to/from memory. Another way to do this would be to use mapped buffers - this would take a speed hit on the kernel side, but removes the need for the two memory transfers. Has anybody experienced/played with this tradeoff? Any advice?

    Thanks in advance,
    Spencer

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Webcam - Image vs. Mapped Buffer

    Why not use mapped images? clEnqueueMapImage()/clEnqueueUnmapMemObject(). Just make sure to allocate your images with CL_MEM_ALLOC_HOST_PTR or CL_MEM_USE_HOST_PTR.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    19

    Re: Webcam - Image vs. Mapped Buffer

    Wow - not sure how I missed that one. That works perfectly! Why would one NOT want to always use this??

Similar Threads

  1. Buffer Vs Image
    By clint3112 in forum OpenCL
    Replies: 7
    Last Post: 11-06-2012, 02:26 AM
  2. PCI address of mapped OpenCL buffer object?
    By grabner in forum OpenCL
    Replies: 0
    Last Post: 05-03-2012, 02:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •