Compute Library
 23.11
arm_compute::helpers::bit_ops Namespace Reference

Functions

template<typename T , ARM_COMPUTE_REQUIRES_TA(std::is_integral< T >::value) >
bool is_bit_set (T v, unsigned int idx)
 Checks if the idx-th bit is set in an integral type. More...
 

Function Documentation

◆ is_bit_set()

bool arm_compute::helpers::bit_ops::is_bit_set ( v,
unsigned int  idx 
)

Checks if the idx-th bit is set in an integral type.

Parameters
[in]vIntegral input
[in]idxIndex of the bit to check
Returns
True if the idx-th bit is set else false

Definition at line 45 of file bit_ops.h.

46 {
47  return (v & 1 << idx) != 0;
48 }

Referenced by arm_compute::helpers::tensor_transform::calculate_end_on_index(), arm_compute::helpers::tensor_transform::calculate_start_on_index(), arm_compute::helpers::tensor_transform::compute_strided_slice_output_shape(), CLStridedSliceKernel::configure(), and NEStridedSliceKernel::run_op().