Results 1 to 3 of 3

Thread: 2 times sin() vs one local memory access

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    165

    2 times sin() vs one local memory access

    Hello,

    I need to implement an access function to a discrete circular shaped object in a kernel. I have two option:
    1. Calculate each access with floor(n*sin(t)+0.5f)
    2. calculate all access indices once and access them in local memory

    Does anyone know how much cycles a local memory access takes? I found numbers in CUDA for sin() function with ~16 cycles and Global Memory with ~400 cycles.

    Greetings
    Clint3112

  2. #2
    Senior Member
    Join Date
    Aug 2011
    Posts
    271

    Re: 2 times sin() vs one local memory access

    The AMD APP programming guide has some fairly detailed numbers on memory/l1/lds/constants throughout chapter 4 - although it's not the same hardware it should be roughly comparable.

    You might consider the constant space for these as that is exactly what it is for (if the values are constant between runs anyway).

    Personally I would just try them all and see if it makes any difference because in a running kernel there are many considerations which affect performance (register usage, lds usage, concurrency, etc), and this is a fairly simple thing to try out.

  3. #3
    Senior Member
    Join Date
    Oct 2012
    Posts
    165

    Re: 2 times sin() vs one local memory access

    Thanks alot for the hint.

    I will have a look and keep you up2date about this problem.

    Problem with local and contant mem could be the size of both, because there might be too much data I have to store in there. But I will have a look on that.

    Greetings,
    Clint3112

Similar Threads

  1. Replies: 6
    Last Post: 02-28-2013, 04:59 PM
  2. Local memory access question in the specification
    By ikedanaruki in forum OpenCL
    Replies: 3
    Last Post: 10-26-2009, 11:36 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
  •