@@ -89,8 +89,8 @@ struct SharedMemorySmartStackTy {
8989 // / Compute the size of the storage space reserved for a thread.
9090 uint32_t computeThreadStorageTotal () {
9191 uint32_t NumLanesInBlock = mapping::getNumberOfThreadsInBlock ();
92- return utils::alignDown (( state::SharedScratchpadSize / NumLanesInBlock) ,
93- allocator::ALIGNMENT);
92+ return __builtin_align_down ( state::SharedScratchpadSize / NumLanesInBlock,
93+ allocator::ALIGNMENT);
9494 }
9595
9696 // / Return the top address of the warp data stack, that is the first address
@@ -121,7 +121,7 @@ void *SharedMemorySmartStackTy::push(uint64_t Bytes) {
121121 // First align the number of requested bytes.
122122 // / FIXME: The stack shouldn't require worst-case padding. Alignment needs to
123123 // / be passed in as an argument and the stack rewritten to support it.
124- uint64_t AlignedBytes = utils::alignPtr (Bytes, allocator::ALIGNMENT);
124+ uint64_t AlignedBytes = __builtin_align_up (Bytes, allocator::ALIGNMENT);
125125
126126 uint32_t StorageTotal = computeThreadStorageTotal ();
127127
@@ -149,7 +149,7 @@ void *SharedMemorySmartStackTy::push(uint64_t Bytes) {
149149}
150150
151151void SharedMemorySmartStackTy::pop (void *Ptr, uint64_t Bytes) {
152- uint64_t AlignedBytes = utils::alignPtr (Bytes, allocator::ALIGNMENT);
152+ uint64_t AlignedBytes = __builtin_align_up (Bytes, allocator::ALIGNMENT);
153153 if (utils::isSharedMemPtr (Ptr)) {
154154 int TId = mapping::getThreadIdInBlock ();
155155 Usage[TId] -= AlignedBytes;
0 commit comments