wesm commented on code in PR #13654:
URL: https://github.com/apache/arrow/pull/13654#discussion_r925639444
##########
cpp/src/arrow/compute/kernels/scalar_compare.cc:
##########
@@ -158,11 +158,183 @@ struct Maximum {
// Implement Less, LessEqual by flipping arguments to Greater, GreaterEqual
-template <typename OutType, typename ArgType, typename Op>
-struct CompareTimestamps
- : public applicator::ScalarBinaryEqualTypes<OutType, ArgType, Op> {
- using Base = applicator::ScalarBinaryEqualTypes<OutType, ArgType, Op>;
+template <int batch_size>
+void PackBits(const int* values, uint8_t* out) {
+ for (int i = 0; i < batch_size / 8; ++i) {
+ *out++ = (values[0] | values[1] << 1 | values[2] << 2 | values[3] << 3 |
+ values[4] << 4 | values[5] << 5 | values[6] << 6 | values[7] <<
7);
+ values += 8;
+ }
+}
+
+template <typename T, typename Op>
+struct ComparePrimitive {
+ static void Exec(const void* left_values_void, const void* right_values_void,
+ int64_t length, void* out_bitmap_void) {
+ const T* left_values = reinterpret_cast<const T*>(left_values_void);
+ const T* right_values = reinterpret_cast<const T*>(right_values_void);
+ uint8_t* out_bitmap = reinterpret_cast<uint8_t*>(out_bitmap_void);
+ static constexpr int kBatchSize = 32;
+ int64_t num_batches = length / kBatchSize;
+ int temp_output[kBatchSize];
Review Comment:
I tried uint8_t but weirdly it made things slower. I changed to uint32_t
which is the type used by util/bpacking.h
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]