__brev
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Reverses the bit order of the input data and returns the reversed value.
Prototype
1 | unsigned int __brev(unsigned int x) |
1 | unsigned long long __brev(unsigned long long x) |
1 | unsigned long __brev(unsigned long x) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
x |
Input |
Source operand. |
Returns
Reversed value of the bit order of the input data. If the input type is uint32_t, the nth bit of the return value corresponds to the 31–nth bit of the input data. If the input type is uint64_t, the nth bit of the return value corresponds to the 63–nth bit of the input data.
- If x is 0 and the type is uint32_t, the return value is 0.
- If x is 0 and the type is uint64_t, the return value is 0.
- If x is 1 and the type is uint32_t, the return value is 2147483648.
- If x is 1 and the type is uint64_t, the return value is 9223372036854775808.
Restrictions
For SIMT programming, this API is not supported.
Header File to Be Included
To use this API, the simt_api/device_functions.h header file must be included.
Examples
1 2 3 4 5 | __simt_vf__ __launch_bounds__(1024) inline void KernelBrev(__gm__ unsigned int* dst, __gm__ unsigned int* x) { int idx = threadIdx.x + blockIdx.x * blockDim.x; dst[idx] = __brev(x[idx]); } |
1 2 3 4 5 | __simt_vf__ __launch_bounds__(1024) inline void KernelBrev(__gm__ unsigned long long* dst, __gm__ unsigned long long* x) { int idx = threadIdx.x + blockIdx.x * blockDim.x; dst[idx] = __brev(x[idx]); } |