MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get_aligned_power2

Function get_aligned_power2

dnn/src/common/utils.h:374–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372 */
373template <typename T>
374static inline T get_aligned_power2(T val, T align) {
375 auto d = val & (align - 1);
376 val += (align - d) & (align - 1);
377 return val;
378}
379
380template <typename T, typename S>
381inline T saturate(S x, S lower, S upper) {

Callers 2

defragMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected