Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
76c2db5
Add Python script to generate version.h
adamreeve May 17, 2024
7df09ef
Generate separate version headers for each GLib project
adamreeve May 14, 2024
4671fc5
Use correct version macros in gandiva glib
adamreeve May 17, 2024
d8220bf
Add built headers to library sources
adamreeve May 17, 2024
644220e
Update use of version macros in headers
adamreeve May 17, 2024
ef49fb9
Add version header includes
adamreeve May 17, 2024
f08a6c4
Add extra available_in annotations
adamreeve May 17, 2024
e8f260f
Move and rename header generation script
adamreeve May 20, 2024
d67ace3
Find python3 for command instead of python script
adamreeve May 20, 2024
97b2610
Simplify string replacement in header generation
adamreeve May 20, 2024
75b684c
Use configure_file instead of custom_target so headers are used in mk…
adamreeve May 20, 2024
239ca7c
Include c_glib in flake8 formatting
adamreeve May 20, 2024
f32f12e
Include version.h in -glib.h headers
adamreeve May 21, 2024
6cb7935
Generate separate version macros for all libraries
adamreeve May 21, 2024
609541d
Update versions list in utils-prepare.sh
adamreeve May 21, 2024
0d555ca
Add 17.0.0 version
adamreeve May 21, 2024
d020442
Only add new glib major version if it isn't already present
adamreeve May 21, 2024
9d89466
Update bump-versions-test
adamreeve May 21, 2024
a0e59a6
Tidy ups from code review
adamreeve May 21, 2024
09096b2
Keep expected changes sorted by path value
adamreeve May 21, 2024
f90a0d4
Better fix for only adding new major versions
adamreeve May 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
hooks:
- id: flake8
name: Python Format
files: ^(python|dev|integration)/
files: ^(python|dev|c_glib|integration)/
types:
- file
- python
Expand Down
2 changes: 2 additions & 0 deletions c_glib/arrow-cuda-glib/arrow-cuda-glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

#include <arrow-glib/arrow-glib.h>

#include <arrow-cuda-glib/version.h>

#include <arrow-cuda-glib/cuda.h>
38 changes: 38 additions & 0 deletions c_glib/arrow-cuda-glib/cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@

#include <arrow-glib/arrow-glib.h>

#include <arrow-cuda-glib/version.h>

G_BEGIN_DECLS

#define GARROW_CUDA_TYPE_DEVICE_MANAGER (garrow_cuda_device_manager_get_type())
GARROW_CUDA_AVAILABLE_IN_0_12
G_DECLARE_DERIVABLE_TYPE(GArrowCUDADeviceManager,
garrow_cuda_device_manager,
GARROW_CUDA,
Expand All @@ -35,6 +38,7 @@ struct _GArrowCUDADeviceManagerClass
};

#define GARROW_CUDA_TYPE_CONTEXT (garrow_cuda_context_get_type())
GARROW_CUDA_AVAILABLE_IN_0_12
G_DECLARE_DERIVABLE_TYPE(
GArrowCUDAContext, garrow_cuda_context, GARROW_CUDA, CONTEXT, GObject)
struct _GArrowCUDAContextClass
Expand All @@ -43,6 +47,7 @@ struct _GArrowCUDAContextClass
};

#define GARROW_CUDA_TYPE_BUFFER (garrow_cuda_buffer_get_type())
GARROW_CUDA_AVAILABLE_IN_0_12
G_DECLARE_DERIVABLE_TYPE(
GArrowCUDABuffer, garrow_cuda_buffer, GARROW_CUDA, BUFFER, GArrowBuffer)
struct _GArrowCUDABufferClass
Expand All @@ -51,6 +56,7 @@ struct _GArrowCUDABufferClass
};

#define GARROW_CUDA_TYPE_HOST_BUFFER (garrow_cuda_host_buffer_get_type())
GARROW_CUDA_AVAILABLE_IN_0_12
G_DECLARE_DERIVABLE_TYPE(GArrowCUDAHostBuffer,
garrow_cuda_host_buffer,
GARROW_CUDA,
Expand All @@ -62,6 +68,7 @@ struct _GArrowCUDAHostBufferClass
};

#define GARROW_CUDA_TYPE_IPC_MEMORY_HANDLE (garrow_cuda_ipc_memory_handle_get_type())
GARROW_CUDA_AVAILABLE_IN_0_12
G_DECLARE_DERIVABLE_TYPE(GArrowCUDAIPCMemoryHandle,
garrow_cuda_ipc_memory_handle,
GARROW_CUDA,
Expand All @@ -73,6 +80,7 @@ struct _GArrowCUDAIPCMemoryHandleClass
};

#define GARROW_CUDA_TYPE_BUFFER_INPUT_STREAM (garrow_cuda_buffer_input_stream_get_type())
GARROW_CUDA_AVAILABLE_IN_0_12
G_DECLARE_DERIVABLE_TYPE(GArrowCUDABufferInputStream,
garrow_cuda_buffer_input_stream,
GARROW_CUDA,
Expand All @@ -85,6 +93,7 @@ struct _GArrowCUDABufferInputStreamClass

#define GARROW_CUDA_TYPE_BUFFER_OUTPUT_STREAM \
(garrow_cuda_buffer_output_stream_get_type())
GARROW_CUDA_AVAILABLE_IN_0_12
G_DECLARE_DERIVABLE_TYPE(GArrowCUDABufferOutputStream,
garrow_cuda_buffer_output_stream,
GARROW_CUDA,
Expand All @@ -95,71 +104,100 @@ struct _GArrowCUDABufferOutputStreamClass
GArrowOutputStreamClass parent_class;
};

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDADeviceManager *
garrow_cuda_device_manager_new(GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDAContext *
garrow_cuda_device_manager_get_context(GArrowCUDADeviceManager *manager,
gint gpu_number,
GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
gsize
garrow_cuda_device_manager_get_n_devices(GArrowCUDADeviceManager *manager);

GARROW_CUDA_AVAILABLE_IN_0_12
gint64
garrow_cuda_context_get_allocated_size(GArrowCUDAContext *context);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDABuffer *
garrow_cuda_buffer_new(GArrowCUDAContext *context, gint64 size, GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDABuffer *
garrow_cuda_buffer_new_ipc(GArrowCUDAContext *context,
GArrowCUDAIPCMemoryHandle *handle,
GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDABuffer *
garrow_cuda_buffer_new_record_batch(GArrowCUDAContext *context,
GArrowRecordBatch *record_batch,
GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GBytes *
garrow_cuda_buffer_copy_to_host(GArrowCUDABuffer *buffer,
gint64 position,
gint64 size,
GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
gboolean
garrow_cuda_buffer_copy_from_host(GArrowCUDABuffer *buffer,
const guint8 *data,
gint64 size,
GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDAIPCMemoryHandle *
garrow_cuda_buffer_export(GArrowCUDABuffer *buffer, GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDAContext *
garrow_cuda_buffer_get_context(GArrowCUDABuffer *buffer);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowRecordBatch *
garrow_cuda_buffer_read_record_batch(GArrowCUDABuffer *buffer,
GArrowSchema *schema,
GArrowReadOptions *options,
GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDAHostBuffer *
garrow_cuda_host_buffer_new(gint gpu_number, gint64 size, GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDAIPCMemoryHandle *
garrow_cuda_ipc_memory_handle_new(const guint8 *data, gsize size, GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowBuffer *
garrow_cuda_ipc_memory_handle_serialize(GArrowCUDAIPCMemoryHandle *handle,
GError **error);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDABufferInputStream *
garrow_cuda_buffer_input_stream_new(GArrowCUDABuffer *buffer);

GARROW_CUDA_AVAILABLE_IN_0_12
GArrowCUDABufferOutputStream *
garrow_cuda_buffer_output_stream_new(GArrowCUDABuffer *buffer);

GARROW_CUDA_AVAILABLE_IN_0_12
gboolean
garrow_cuda_buffer_output_stream_set_buffer_size(GArrowCUDABufferOutputStream *stream,
gint64 size,
GError **error);
GARROW_CUDA_AVAILABLE_IN_0_12
gint64
garrow_cuda_buffer_output_stream_get_buffer_size(GArrowCUDABufferOutputStream *stream);

GARROW_CUDA_AVAILABLE_IN_0_12
gint64
garrow_cuda_buffer_output_stream_get_buffered_size(GArrowCUDABufferOutputStream *stream);

Expand Down
9 changes: 8 additions & 1 deletion c_glib/arrow-cuda-glib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ cpp_headers = files(
'cuda.hpp',
)

version_h = configure_file(
input: 'version.h.in',
output: 'version.h',
command: [python3, generate_version_header_py, '--library', 'GARROW_CUDA', '--version', version, '--input', '@INPUT@', '--output', '@OUTPUT@'],
)

c_headers += version_h

headers = c_headers + cpp_headers
install_headers(headers, subdir: 'arrow-cuda-glib')


dependencies = [
arrow_cuda,
arrow_glib,
Expand Down
157 changes: 157 additions & 0 deletions c_glib/arrow-cuda-glib/version.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/*
* 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.
*/

#pragma once

#include <arrow-glib/version.h>

/**
* SECTION: version
* @section_id: version-macros
* @title: Version related macros
* @include: arrow-cuda-glib/arrow-cuda-glib.h
*
* Apache Arrow CUDA GLib provides macros that can be used by C pre-processor.
* They are useful to check version related things at compile time.
*/

/**
* GARROW_CUDA_VERSION_MAJOR:
*
* The major version.
*
* Since: 17.0.0
*/
#define GARROW_CUDA_VERSION_MAJOR (@VERSION_MAJOR@)

/**
* GARROW_CUDA_VERSION_MINOR:
*
* The minor version.
*
* Since: 17.0.0
*/
#define GARROW_CUDA_VERSION_MINOR (@VERSION_MINOR@)

/**
* GARROW_CUDA_VERSION_MICRO:
*
* The micro version.
*
* Since: 17.0.0
*/
#define GARROW_CUDA_VERSION_MICRO (@VERSION_MICRO@)

/**
* GARROW_CUDA_VERSION_TAG:
*
* The version tag. Normally, it's an empty string. It's "SNAPSHOT"
* for snapshot version.
*
* Since: 17.0.0
*/
#define GARROW_CUDA_VERSION_TAG "@VERSION_TAG@"

/**
* GARROW_CUDA_VERSION_CHECK:
* @major: A major version to check for.
* @minor: A minor version to check for.
* @micro: A micro version to check for.
*
* You can use this macro in C pre-processor.
*
* Returns: %TRUE if the compile time Apache Arrow GLib version is the
* same as or newer than the passed version, %FALSE otherwise.
*
* Since: 17.0.0
*/
#define GARROW_CUDA_VERSION_CHECK(major, minor, micro) \
(GARROW_CUDA_VERSION_MAJOR > (major) || \
(GARROW_CUDA_VERSION_MAJOR == (major) && \
GARROW_CUDA_VERSION_MINOR > (minor)) || \
(GARROW_CUDA_VERSION_MAJOR == (major) && \
GARROW_CUDA_VERSION_MINOR == (minor) && \
GARROW_CUDA_VERSION_MICRO >= (micro)))

/**
* GARROW_CUDA_DISABLE_DEPRECATION_WARNINGS:
*
* If this macro is defined, no deprecated warnings are produced.
*
* You must define this macro before including the
* arrow-glib/arrow-glib.h header.
*
* Since: 17.0.0
*/

#ifdef GARROW_CUDA_DISABLE_DEPRECATION_WARNINGS
# define GARROW_CUDA_DEPRECATED
# define GARROW_CUDA_DEPRECATED_FOR(function)
# define GARROW_CUDA_UNAVAILABLE(major, minor)
#else
# define GARROW_CUDA_DEPRECATED G_DEPRECATED
# define GARROW_CUDA_DEPRECATED_FOR(function) G_DEPRECATED_FOR(function)
# define GARROW_CUDA_UNAVAILABLE(major, minor) G_UNAVAILABLE(major, minor)
#endif

@ENCODED_VERSIONS@

/**
* GARROW_CUDA_VERSION_MIN_REQUIRED:
*
* You can use this macro for compile time API version check.
*
* This macro value must be one of the predefined version macros such
* as %GARROW_CUDA_VERSION_0_10.
*
* If you use any functions that is defined by newer version than
* %GARROW_CUDA_VERSION_MIN_REQUIRED, deprecated warnings are produced at
* compile time.
*
* You must define this macro before including the
* arrow-cuda-glib/arrow-cuda-glib.h header.
*
* Since: 17.0.0
*/
#ifndef GARROW_CUDA_VERSION_MIN_REQUIRED
# define GARROW_CUDA_VERSION_MIN_REQUIRED GARROW_VERSION_MIN_REQUIRED
#endif

/**
* GARROW_CUDA_VERSION_MAX_ALLOWED:
*
* You can use this macro for compile time API version check.
*
* This macro value must be one of the predefined version macros such
* as %GARROW_CUDA_VERSION_0_10.
*
* If you use any functions that is defined by newer version than
* %GARROW_CUDA_VERSION_MAX_ALLOWED, deprecated warnings are produced at
* compile time.
*
* You must define this macro before including the
* arrow-cuda-glib/arrow-cuda-glib.h header.
*
* Since: 17.0.0
*/
#ifndef GARROW_CUDA_VERSION_MAX_ALLOWED
# define GARROW_CUDA_VERSION_MAX_ALLOWED GARROW_VERSION_MAX_ALLOWED
#endif

@AVAILABILITY_MACROS@
2 changes: 2 additions & 0 deletions c_glib/arrow-dataset-glib/arrow-dataset-glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include <arrow-glib/arrow-glib.h>

#include <arrow-dataset-glib/version.h>

#include <arrow-dataset-glib/dataset-factory.h>
#include <arrow-dataset-glib/dataset.h>
#include <arrow-dataset-glib/enums.h>
Expand Down
3 changes: 3 additions & 0 deletions c_glib/arrow-dataset-glib/dataset-definition.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@

#include <arrow-glib/arrow-glib.h>

#include <arrow-dataset-glib/version.h>

G_BEGIN_DECLS

#define GADATASET_TYPE_DATASET (gadataset_dataset_get_type())
GADATASET_AVAILABLE_IN_5_0
G_DECLARE_DERIVABLE_TYPE(GADatasetDataset, gadataset_dataset, GADATASET, DATASET, GObject)
struct _GADatasetDatasetClass
{
Expand Down
Loading