Skip to content

Commit

Permalink
GH-40882: [C++] Suppress shorten-64-to-32 warnings in CUDA/Skyhook codes
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 29, 2024
1 parent 3d5e9aa commit 55606c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cpp/src/arrow/gpu/cuda_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ Result<std::shared_ptr<MemoryManager>> DefaultMemoryMapper(ArrowDeviceType devic
case ARROW_DEVICE_CUDA:
case ARROW_DEVICE_CUDA_HOST:
case ARROW_DEVICE_CUDA_MANAGED: {
ARROW_ASSIGN_OR_RAISE(auto device, arrow::cuda::CudaDevice::Make(device_id));
ARROW_ASSIGN_OR_RAISE(auto device,
arrow::cuda::CudaDevice::Make(static_cast<int>(device_id)));
return device->default_memory_manager();
}
default:
Expand All @@ -505,7 +506,8 @@ Result<std::shared_ptr<MemoryManager>> DefaultMemoryMapper(ArrowDeviceType devic
namespace {

Result<std::shared_ptr<MemoryManager>> DefaultCUDADeviceMapper(int64_t device_id) {
ARROW_ASSIGN_OR_RAISE(auto device, arrow::cuda::CudaDevice::Make(device_id));
ARROW_ASSIGN_OR_RAISE(auto device,
arrow::cuda::CudaDevice::Make(static_cast<int>(device_id)));
return device->default_memory_manager();
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/skyhook/cls/cls_skyhook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class RandomAccessObject : public arrow::io::RandomAccessFile {

if (nbytes > 0) {
std::shared_ptr<ceph::bufferlist> bl = std::make_shared<ceph::bufferlist>();
cls_cxx_read(hctx_, position, nbytes, bl.get());
cls_cxx_read(hctx_, static_cast<int>(position), static_cast<int>(nbytes), bl.get());
chunks_.push_back(bl);
return std::make_shared<arrow::Buffer>((uint8_t*)bl->c_str(), bl->length());
}
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/skyhook/protocol/skyhook_protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ arrow::Status SerializeTable(const std::shared_ptr<arrow::Table>& table,
ARROW_RETURN_NOT_OK(writer->Close());

ARROW_ASSIGN_OR_RAISE(auto buffer, buffer_output_stream->Finish());
bl->append(reinterpret_cast<const char*>(buffer->data()), buffer->size());
bl->append(reinterpret_cast<const char*>(buffer->data()),
static_cast<unsigned int>(buffer->size()));
return arrow::Status::OK();
}

Expand Down

0 comments on commit 55606c4

Please sign in to comment.