| 366 | |
| 367 | template <typename FromType, typename ToType> |
| 368 | Status StaticCastBuffer(const Buffer& input, const int64_t length, MemoryPool* pool, |
| 369 | std::shared_ptr<Buffer>* out) { |
| 370 | ARROW_ASSIGN_OR_RAISE(auto result, AllocateBuffer(sizeof(ToType) * length, pool)); |
| 371 | |
| 372 | auto in_values = reinterpret_cast<const FromType*>(input.data()); |
| 373 | auto out_values = reinterpret_cast<ToType*>(result->mutable_data()); |
| 374 | for (int64_t i = 0; i < length; ++i) { |
| 375 | *out_values++ = static_cast<ToType>(*in_values++); |
| 376 | } |
| 377 | *out = std::move(result); |
| 378 | return Status::OK(); |
| 379 | } |
| 380 | |
| 381 | template <typename T> |
| 382 | void CopyStridedBytewise(int8_t* input_data, int64_t length, int64_t stride, |
nothing calls this directly
no test coverage detected