Results 1 to 2 of 2

Thread: huge delay between GPU and CPU

  1. #1
    Junior Member
    Join Date
    Apr 2011

    huge delay between GPU and CPU


    I am writing a school project (implementation of Maximum Intensity Projection on GPU (OpenCL)) and now I am facing an interesting problem.
    With CL_DEVICE_TYPE_CPU kernel took nearly 2-3 seconds and returns correct results.
    This is good result in comparison to C++ program (~30s). But when the same kernel is executed on GPU, it took 60 seconds (with correct result) and computer seem to be frozen.

    I have done some research and I thought that it could be in incorrect memory usage, but in this case, it should be same problem on CPU. But it isn't.

    Have anybody encountered similar problem? How can this be solved?

    Thanks a lot for replies

    CPU : i5 430m
    GPU : AMD m5650

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

    Re: huge delay between GPU and CPU

    It's not possible to answer your question without understanding the algorithms you are using and seeing the code.

    There are several reasons why some OpenCL application may be slower running on a GPU than running on a GPU. For example:

    • The code memory bound, not ALU bound. What is the ratio of bytes of data transferred from/to global memory compared with the number of ALU instructions?In some cases you may benefit from using local memory.

      The code has very complex control flow. GPUs are basically SIMD processors and if different work-items take different code paths execution will be slower.

      Some work-items take a lot more to finish than others. You may need to transform the algorithm or break the work into smaller pieces so that this doesn't happen.

      The code or some part of it does not have significant parallelism.

    Using a profiling tool to find out where time is being spent in your application and kernels is strongly recommended.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. CPU vs GPU optimizations
    By akhal in forum OpenCL
    Replies: 6
    Last Post: 07-31-2011, 11:01 AM
  2. Faster on CPU than on the GPU
    By vijaykiran in forum OpenCL
    Replies: 1
    Last Post: 08-12-2010, 10:44 PM
  3. Different output on GPU vs CPU
    By flyingtabmow in forum OpenCL
    Replies: 3
    Last Post: 07-13-2010, 06:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean