Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8849613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:41:49+00:00 2026-06-14T12:41:49+00:00

I have to do a gpu implementation (opencl) of a image mapping. I seem

  • 0

I have to do a gpu implementation (opencl) of a image mapping.

I seem to remember having read somewhere that forward mapping is better suited for a parallel implementation, why is that?

And do anyone have some example code on how to do these mappings (preferably on the gpu)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:41:50+00:00Added an answer on June 14, 2026 at 12:41 pm

    To me the intuitive choice for a parallel implementation would be an inverse, not forward, mapping.

    Consider instances where several source pixels map to a single destination pixel. In forward mapping, if each source pixel were evaluated as a distinct work-item, you would have to implement some kind of synchronization on the destination pixel to co-ordinate the multiple writes. In inverse mapping there is no synchronization overhead, since it is guaranteed that only one work-item writes to each pixel.

    Example inverse-mapping kernel code, leveraging OpenCL’s image2d_t and sampler_t concepts for image manipulation:

    __kernel void warp(__read_only image2d_t srcImage,
                       __write_only image2d_t dstImage,
                       sample_r sampler)
    {
        int2 dstCoords = (int2){ get_global_id(0), get_global_id(1)};
        int2 srcCoords = my_warp_func_inverse(dstCoords);
        float4 srcPixel = read_imagef(srcImage, sampler, srcCoords);
        write_imagef(dstImage, dstCoords, srcPixel);
    }
    

    Of course there are exceptions where forward mapping might be preferable. For example if you had a very large source image and a small destination image, then forward mapping would allow you to split the source image into segments, then divide them amongst work-items or work-groups with the segment data cached in __private or __local address spaces. Without prior knowledge of the mapping function, an inverse mapping might need to access any part of the source image, which potentially restricts you to __global memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that performs the IDCT on the GPU. I've noticed that
I have a C# application that recolors an image using ColorMatrix. I understand that
i have a program that does some GPU computing with Optional OpenGL rendering. The
People have been telling me that GPU renders triangles only. But how do you
I have a question related to the implementation of image interpolation (bicubic and bilinear
I have a PC with a good CPU but slow GPU (integrated graphics card).
I have a large sprite library and I'd like to cut GPU memory requirements.
I am writing a massively parallel GPU application using CUDA. I have been optimizing
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I am new to OpenCL. I have written a vector addition code in OpenCL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.