MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / reverse

Function reverse

examples/common/idxio.h:32–39  ·  view source on GitHub ↗

http://stackoverflow.com/a/9144870/2192361

Source from the content-addressed store, hash-verified

30
31// http://stackoverflow.com/a/9144870/2192361
32unsigned reverse(unsigned x) {
33 x = ((x >> 1) & 0x55555555u) | ((x & 0x55555555u) << 1);
34 x = ((x >> 2) & 0x33333333u) | ((x & 0x33333333u) << 2);
35 x = ((x >> 4) & 0x0f0f0f0fu) | ((x & 0x0f0f0f0fu) << 4);
36 x = ((x >> 8) & 0x00ff00ffu) | ((x & 0x00ff00ffu) << 8);
37 x = ((x >> 16) & 0xffffu) | ((x & 0xffffu) << 16);
38 return x;
39}
40
41template<class ty>
42void read_idx(std::vector<dim_t> &dims, std::vector<ty> &data,

Callers 2

setup_mnistFunction · 0.85
read_idxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected