Code Monkey home page Code Monkey logo

Comments (6)

jszuppe avatar jszuppe commented on June 14, 2024

total_size += sizeof(int) * some_other_size * 3; - this might be the problem. Alignment might be wrong. hipcub_buffer should have the same alignment as if it was allocated directly with hipMalloc.

from rocprim.

ntrost57 avatar ntrost57 commented on June 14, 2024

Then it should work, if the hipcub_buffer is the first chunk of buffer data in the row, right?

from rocprim.

jszuppe avatar jszuppe commented on June 14, 2024

I guess. I don't see any other problem right now, but only looked at your code. If you are allocating multiple buffers with one hipMalloc I'd recommend aligning every buffer to 256 bytes. It's not much and it helps.

from rocprim.

ntrost57 avatar ntrost57 commented on June 14, 2024

Works, thanks!
Btw: Buffer size returned by rocprim is not a multiple of 256.
I think I remember that for some nvidia cards pointer alignment is not always 256, do you happen to have any information on that or am I wrong.

from rocprim.

jszuppe avatar jszuppe commented on June 14, 2024

Btw: Buffer size returned by rocprim is not a multiple of 256.

That's true. Temporary buffer size does not have to be a multiple of 256. However, its pointer may need to be aligned to 256 bytes.

I think I remember that for some nvidia cards pointer alignment is not always 256, do you happen to have any information on that or am I wrong.

From NVIDIA docs: "Any address of a variable residing in global memory or returned by one of the memory allocation routines from the driver or runtime API is always aligned to at least 256 bytes." It might be more on newer GPUs, but 256 bytes is good enough for everything to work correctly.

from rocprim.

ntrost57 avatar ntrost57 commented on June 14, 2024

Great, thanks a lot!

from rocprim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.