Results 1 to 5 of 5

Thread: __constant vs const __global

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    5

    __constant vs const __global

    what's exactly the difference between the __constant qualifier and the const __global one?? they're just directions for device memory allocation or they implies different initialization for the associated variables?

    What i observed is that while my kernels with const __global arguments run without errors, when i change to __constant i get 0xc0000005 Access violation errors.

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

    Re: __constant vs const __global

    Typically on GPUs you will get much better performance from __constant kernel arguments than from const __global. Keep in mind, though, that there's a limited amount of __constant storage in any GPU, so you can't usually put, say, 100MB worth of data in __constant memory.

    The problems you are seeing are probably a driver bug. What OpenCL implementation are you using?
    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
    Apr 2010
    Posts
    5

    Re: __constant vs const __global

    i'm running on a nvidia geforce 310m gpu ( notebook ) with the latest sdk. Actually i don't get this error with the ati stream sdk.

  4. #4
    Junior Member
    Join Date
    May 2010
    Posts
    5

    Re: __constant vs const __global

    On nvidia hardware the __constant qualifier has the added benefit of allowing caching of said memory. However, the amount of constant memory is quite limited so it might be possible that you've overflown the capacity of the constant memory. I suggest checking the specifications of the GPU being used.

  5. #5
    Junior Member
    Join Date
    Apr 2010
    Posts
    5

    Re: __constant vs const __global

    i'm working with 16 cl_float, my problem is not due to constant memory overflow

Similar Threads

  1. Replies: 7
    Last Post: 02-09-2011, 05:59 PM
  2. Replies: 7
    Last Post: 01-07-2011, 03:44 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
  •