Skip to content

Commit

Permalink
Update HalideBuffer.h
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-johnson committed Jun 27, 2023
1 parent 6579c66 commit 4ecaffc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/HalideBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,10 @@ class Buffer {
// https://www.ralfj.de/blog/2020/12/14/provenance.html),
// so, if our compiler has builtins for this, use them;
// if not, fall back to casting as necessary.
#if defined(__has_builtin) && __has_builtin(__builtin_align_up)
#if !defined(__has_builtin)
#define __has_builtin(x) (0)
#endif
#if __has_builtin(__builtin_align_up)
return __builtin_align_up(value, alignment);
#else
if constexpr (std::is_pointer<SomeType>::value) {
Expand Down

0 comments on commit 4ecaffc

Please sign in to comment.