MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / ispow2

Function ispow2

include/cutlass/array.h:81–84  ·  view source on GitHub ↗

Returns true if the argument is a power of 2

Source from the content-addressed store, hash-verified

79
80/// Returns true if the argument is a power of 2
81CUTLASS_HOST_DEVICE
82constexpr bool ispow2(unsigned x) {
83 return x && (!(x & (x - 1)));
84}
85
86////////////////////////////////////////////////////////////////////////////////////////////////////
87

Callers 3

floor_pow_2Function · 0.85
convert_helperMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected