Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
cuda_arrow_ipc.h
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 #ifndef ARROW_GPU_CUDA_ARROW_IPC_H
19 #define ARROW_GPU_CUDA_ARROW_IPC_H
20 
21 #include <cstdint>
22 #include <memory>
23 
24 #include "arrow/buffer.h"
25 #include "arrow/status.h"
26 #include "arrow/util/visibility.h"
27 
28 #include "arrow/gpu/cuda_memory.h"
29 
30 namespace arrow {
31 
32 class MemoryPool;
33 class RecordBatch;
34 class Schema;
35 
36 namespace ipc {
37 
38 class Message;
39 
40 } // namespace ipc
41 
42 namespace gpu {
43 
49 ARROW_EXPORT
51  std::shared_ptr<CudaBuffer>* out);
52 
60 ARROW_EXPORT
62  std::unique_ptr<ipc::Message>* message);
63 
69 ARROW_EXPORT
70 Status ReadRecordBatch(const std::shared_ptr<Schema>& schema,
71  const std::shared_ptr<CudaBuffer>& buffer, MemoryPool* pool,
72  std::shared_ptr<RecordBatch>* out);
73 
74 } // namespace gpu
75 } // namespace arrow
76 
77 #endif // ARROW_GPU_CUDA_ARROW_IPC_H
Status SerializeRecordBatch(const RecordBatch &batch, MemoryPool *pool, std::shared_ptr< Buffer > *out)
Serialize record batch as encapsulated IPC message in a new buffer.
An IPC message including metadata and body.
Definition: message.h:58
Collection of equal-length arrays matching a particular Schema.
Definition: table.h:118
Friendlier interface to the CUDA driver API.
Definition: cuda_context.h:67
Status ReadRecordBatch(const std::shared_ptr< Schema > &schema, io::InputStream *stream, std::shared_ptr< RecordBatch > *out)
Read record batch as encapsulated IPC message with metadata size prefix and header.
Status ReadMessage(const int64_t offset, const int32_t metadata_length, io::RandomAccessFile *file, std::unique_ptr< Message > *message)
Read encapulated RPC message from position in file.
Definition: status.h:106
File interface for zero-copy read from CUDA buffers.
Definition: cuda_memory.h:124
Top-level namespace for Apache Arrow C++ API.
Definition: allocator.h:29
std::shared_ptr< Schema > schema(const std::vector< std::shared_ptr< Field >> &fields, const std::shared_ptr< const KeyValueMetadata > &metadata=NULLPTR)
Create a Schema instance.
Base class for memory allocation.
Definition: memory_pool.h:34