Open eyalroz opened 4 years ago
@codecircuit : Question for you as well.
Sticking to #1 for now - which means a bunch of changes to our current code.
Personally I stick to 2. I think it is not intuitive to call a multi dimensional object an "index". With indices I associate something linear. But sometimes I name index variables ..._id
because they represent something, which is only aligned in one dimension at all.
@codecircuit : Other people I asked have mostly told me the detriment of 2 would exceed the benefit - unless I expect people to only use my grid_info code, not read about indices and id's in the CUDA documentations and be generally isolated from the switched semantics. ... which is not what's going to happen.
I agree with you. Point 1. makes more sense here.
An index is either a "list of items" arranged in order, or "a number... used as an indicator or measure", or "a number ... associated with another to indicate... position in an arrangement".
An id is an identification, or " a document bearing identifying information".
So, if we have an item in a 3D block, the triplet of coordinates in each axes is - literally - that item's 'id' not its 'index'. If anything, it is its position in a linearization of that grid that could be considered its 'index'.
... Unfortunately, CUDA defines this exactly backwards: The 'index' in CUDA is the 3-dimensional entity, and the 'id' is the number.
Currently, in my code, I'm making a bit of a mess of these two conceptions. I'm going to sort that out, but the question is how?
_index()
functions in grid_info to returnuint3
's anddimensions_t
's.What do you think?