wgtmac commented on code in PR #14585: URL: https://github.com/apache/arrow/pull/14585#discussion_r1037901735
########## cpp/cmake_modules/FindQPL.cmake: ########## @@ -0,0 +1,54 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and Review Comment: The license header looks incomplete. ########## cpp/src/arrow/util/bit_stream_utils.h: ########## @@ -190,6 +195,14 @@ class BitReader { /// Maximum byte length of a vlq encoded int64 static constexpr int kMaxVlqByteLengthForInt64 = 10; + const uint8_t* getBuffer() { return buffer_ - 1; } Review Comment: Use buffer() or GetBuffer() ? ########## cpp/src/arrow/util/qpl_job_pool.cc: ########## @@ -0,0 +1,122 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "arrow/status.h" + +#ifdef ARROW_WITH_QPL +#include "arrow/util/qpl_job_pool.h" + +namespace arrow { +namespace util { +namespace internal { + +std::array<qpl_job*, QplJobHWPool::MAX_JOB_NUMBER> QplJobHWPool::hw_job_ptr_pool; +std::array<std::atomic_bool, QplJobHWPool::MAX_JOB_NUMBER> QplJobHWPool::job_ptr_locks; +bool QplJobHWPool::iaa_job_ready = false; +std::unique_ptr<uint8_t[]> QplJobHWPool::hw_jobs_buffer; + +QplJobHWPool& QplJobHWPool::instance() { + static QplJobHWPool pool; Review Comment: Can we create it lazily? ########## cpp/src/arrow/util/bit_stream_utils.h: ########## @@ -200,6 +213,7 @@ class BitReader { int byte_offset_; // Offset in buffer_ int bit_offset_; // Offset in buffered_values_ + int val_offset_; // index of value to be read Review Comment: ```suggestion int read_offset_; // Index of next value to read ``` ########## cpp/cmake_modules/ThirdpartyToolchain.cmake: ########## @@ -2203,6 +2206,42 @@ if(ARROW_WITH_RAPIDJSON) endif() endif() +macro(build_qpl) Review Comment: Is it possible to add the dependency to `cpp/thirdparty/versions.txt`? It will be a lot easier for developers if offline build is supported. ########## cpp/src/parquet/encoding.cc: ########## @@ -1493,9 +1494,24 @@ class DictDecoderImpl : public DecoderImpl, virtual public DictDecoder<Type> { int Decode(T* buffer, int num_values) override { num_values = std::min(num_values, num_values_); - int decoded_values = + int decoded_values; + +#ifdef ARROW_WITH_QPL Review Comment: Is it possible to wrap the dispatch logic within idx_decoder_? -- 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]
