VI_and | VBI_and | VSI_and | VLI_and | VQI_and | |
VU_and | VUB_and | VUS_and | VUL_and | VUQ_and | VUI_and |
|
Function | Bit-wise AND operation. |
|
Syntax C/C++ | #include <VImath.h>
void VI_and( iVector Y, iVector X, ui size, int C );
(similarly all other functions of this family) |
C++ VecObj | #include <OptiVec.h>
void vector<T>::and( const vector<T>& X, const T& C ); |
Pascal/Delphi | uses VImath;
procedure VI_and( Y, X:iVector; size:UIntSize; C:Integer );
(similarly all other functions of this family) |
|
CUDA function C/C++ | #include <cudaVImath.h>
int cudaVI_and( iVector d_Y, iVector d_X, ui size, int C );
int cusdVI_and( iVector d_Y, iVector d_X, ui size, int *d_C );
void VIcu_and( iVector h_Y, iVector h_X, ui size, int C );
|
CUDA function Pascal/Delphi | uses VImath;
function cudaVI_and( d_Y, d_X:iVector; size:UIntSize; C:Integer ): IntBool;
function cusdVI_and( d_Y, d_X:iVector; size:UIntSize; d_C:PInteger ): IntBool;
procedure VIcu_and( h_Y, h_X:iVector; size:UIntSize; C:Integer );
|
|
Description | Yi = (Xi) & C
The bit-wise AND operation is performed on each element Xi with the bit-mask given by C. A bit is 1 in Yi, if it was 1 both in Xi and in C, and 0 otherwise. Perhaps the most useful application of this family of functions is the fast "modulo" operation on unsigned or positive numbers with the modulus being an integer power of 2. For example, a modulo division by 64 is performed by
VU_and( Y, X, size, 64−1 ); |
|
|
|
|