That says: "align the pointer you give to me so that it starts on a 4*1024 byte boundary. No problem there. For example, pretend CUDA set smem to 0. It would fit that request.
That says, “take the pointer that was aligned on a 4*1024 byte boundary, and alias another float pointer to point to it.” No problem that I can see. You can access an array of floats starting on such a boundary. Using smem of 0, that means this pointer would start at address 0.
That says “take the pointer that was aligned on a 4*1024 byte boundary, add 4*1024 to it, and alias another float pointer to point to it.” No problem that I can see. Using smem of 0, that means this pointer would point to address 4096. It would be perfectly acceptable to have a float array whose starting address was 4096.
That says “take the pointer that was aligned on a 4*1024 byte boundary, add 4*1024 to it, and alias another float pointer to point to it.” No problem that I can see. Using smem of 0, this pointer would point to 3072. It would be perfectly acceptable to have a float array whose starting address was 3072.
Thank you!! I realized, align is for memory’s allocation in the disk, but my array setting is to use the memory, of which the two things are irrelevant! I fully understand your answer now!!!