Search code examples
cudaptx

PTX command for reading specific amount of bit at a time


I understand that this is achievable by using a loop with bit manipulation functions, however I wonder if there is faster and more direct way of doing this. I am using about 64 bits as a header for my data structure which may be many different things. Threads decode the header and then allocate the correct structure to then operate on that data structure. However right now I am using bit manipulation functions for reading and writing into the header which is less then ideal, I had a read through cuda and ptx documentation and didn't find anything that can help me out. I wonder If I did miss any or there is in fact none specific function that is dedicated to reading a single bit at a time.


Solution

  • You didn't find what you are looking for because it doesn't exist.

    PTX only supports memory transactions on 8, 16, 32 and 64 bit types, or 2 or 4 element vectors of those same basic types. There are no instructions for loading or storing individual bits from an arbitrary word in memory.