SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
Modules | Macros
Utilities for writing Aladdin kernels.

Macros to assist in writing code for Aladdin/LLVM-Tracer that translates into an efficient hardware model. More...

Modules

 Common math functions in Aladdin
 Macros for computing the min/max of a group of elements.
 

Macros

#define ALWAYS_INLINE
 We have to disable all function inlining at the global level for Aladdin + LLVM-Tracer to work, but sometimes we do want to force inline functions (otherwise we run into all the issues of function call barriers in Aladdin). More...
 
#define ASSERT(x)   assert(x)
 An assertion macro which disables asserts in LLVM-Tracer instrumented code.
 
#define ASSUME_ALIGNED(ptr, args...)   __builtin_assume_aligned((ptr), args)
 Tell the compiler to assume a pointer is aligned on some byte boundary. More...
 
#define MAYBE_UNUSED   __attribute__((__unused__))
 

Detailed Description

Macros to assist in writing code for Aladdin/LLVM-Tracer that translates into an efficient hardware model.

Macro Definition Documentation

◆ ALWAYS_INLINE

#define ALWAYS_INLINE

We have to disable all function inlining at the global level for Aladdin + LLVM-Tracer to work, but sometimes we do want to force inline functions (otherwise we run into all the issues of function call barriers in Aladdin).

Add ALWAYS_INLINE before the function declaration to force inlining on this function. Only add this on instrumented functions; it's usually unnecessary and often generates a lot of compiler warnings.

Definition at line 522 of file common.h.

◆ ASSUME_ALIGNED

#define ASSUME_ALIGNED (   ptr,
  args... 
)    __builtin_assume_aligned((ptr), args)

Tell the compiler to assume a pointer is aligned on some byte boundary.

This is not supported in clang 3.4.

Definition at line 541 of file common.h.