diff --git a/.github/workflows/build-and-test-device.yaml b/.github/workflows/build-and-test-device.yaml index 47345289a..d1247c305 100644 --- a/.github/workflows/build-and-test-device.yaml +++ b/.github/workflows/build-and-test-device.yaml @@ -28,7 +28,6 @@ on: - 'CMakeLists.txt' - '.github/workflows/build-and-test-device.yaml' - 'src/nanoarrow/**' - - 'extensions/nanoarrow_device/**' permissions: contents: read @@ -46,28 +45,52 @@ jobs: config: - {label: default-build} - {label: namespaced-build, cmake_args: "-DNANOARROW_NAMESPACE=SomeUserNamespace"} - - {label: bundled-build, cmake_args: "-DNANOARROW_DEVICE_BUNDLE=ON"} + - {label: bundled-build, cmake_args: "-DNANOARROW_BUNDLE=ON"} env: - SUBDIR: 'extensions/nanoarrow_device' + SUBDIR: '${{ github.workspace }}' NANOARROW_ARROW_TESTING_DIR: '${{ github.workspace }}/arrow-testing' steps: - uses: actions/checkout@v4 + - name: Checkout arrow-testing + uses: actions/checkout@v4 + with: + repository: apache/arrow-testing + path: arrow-testing + - name: Install memcheck dependencies if: matrix.config.label == 'default-build' run: | sudo apt-get update && sudo apt-get install -y valgrind + - name: Cache Arrow C++ Build + id: cache-arrow-build + uses: actions/cache@v4 + with: + path: arrow + # Bump the number at the end of this line to force a new Arrow C++ build + key: arrow-${{ runner.os }}-${{ runner.arch }}-1 + + - name: Build Arrow C++ + if: steps.cache-arrow-build.outputs.cache-hit != 'true' + shell: bash + run: | + ci/scripts/build-arrow-cpp-minimal.sh 15.0.2 arrow + - name: Build run: | + ARROW_PATH="$(pwd)/arrow" cd $SUBDIR export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/dist/lib sudo ldconfig mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE=Debug -DNANOARROW_DEVICE_BUILD_TESTS=ON ${{ matrix.config.cmake_args }} + cmake .. -DCMAKE_BUILD_TYPE=Debug -DNANOARROW_DEVICE=ON \ + -DNANOARROW_BUILD_TESTS=ON -DCMAKE_PREFIX_PATH="${ARROW_PATH}" \ + ${{ matrix.config.cmake_args }} + cmake --build . - name: Check for non-namespaced symbols in namespaced build @@ -112,4 +135,4 @@ jobs: uses: actions/upload-artifact@main with: name: nanoarrow-device-memcheck - path: extensions/nanoarrow_device/build/Testing/Temporary/MemoryChecker.*.log + path: build/Testing/Temporary/MemoryChecker.*.log diff --git a/.github/workflows/bundle.yaml b/.github/workflows/bundle.yaml index 2a1ea1bdc..c3db6820c 100644 --- a/.github/workflows/bundle.yaml +++ b/.github/workflows/bundle.yaml @@ -52,11 +52,11 @@ jobs: - name: Bundle nanoarrow_device run: | - cd extensions/nanoarrow_device + rm -rf build mkdir build && cd build - cmake .. -DNANOARROW_DEVICE_BUNDLE=ON + cmake .. -DNANOARROW_BUNDLE=ON -DNANOARROW_DEVICE=ON cmake --build . - cmake --install . --prefix=../../../nanoarrow-latest + cmake --install . --prefix=../nanoarrow-latest - name: Compress bundle run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 203d7e2fc..6788c8d89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,10 +53,24 @@ option(NANOARROW_NAMESPACE "A prefix for exported symbols" OFF) option(NANOARROW_ARROW_STATIC "Use a statically-linked Arrow C++ build when linking tests" OFF) +option(NANOARROW_DEVICE_WITH_METAL "Build Apple metal libraries" OFF) +option(NANOARROW_DEVICE_WITH_CUDA "Build CUDA libraries" OFF) + +set(NANOARROW_DEVICE + NANOARROW_DEVICE + OR + NANOARROW_DEVICE_WITH_MDETAL + OR + NANOARROW_DEVICE_WITH_CUDA) + if(NANOARROW_IPC) add_library(ipc_coverage_config INTERFACE) endif() +if(NANOARROW_DEVICE) + add_library(device_coverage_config INTERFACE) +endif() + if(NANOARROW_NAMESPACE) set(NANOARROW_NAMESPACE_DEFINE "#define NANOARROW_NAMESPACE ${NANOARROW_NAMESPACE}") else() @@ -237,6 +251,39 @@ if(NANOARROW_BUNDLE) # Also install the flatcc headers install(DIRECTORY thirdparty/flatcc/include/flatcc DESTINATION ".") endif() + + if(NANOARROW_DEVICE) + # The CMake build step is creating nanoarrow_device.c and nanoarrow_device.h; + # the CMake install step is copying them to a specific location + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/amalgamation) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow) + + # nanoarrow_device.h is currently standalone + set(NANOARROW_DEVICE_H_TEMP + ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow/nanoarrow_device.h) + file(READ src/nanoarrow/nanoarrow_device.h SRC_FILE_CONTENTS) + file(WRITE ${NANOARROW_DEVICE_H_TEMP} "${SRC_FILE_CONTENTS}") + + # nanoarrow_device.c is currently standalone + set(NANOARROW_DEVICE_C_TEMP + ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow/nanoarrow_device.c) + file(READ src/nanoarrow/nanoarrow_device.c SRC_FILE_CONTENTS) + file(WRITE ${NANOARROW_DEVICE_C_TEMP} "${SRC_FILE_CONTENTS}") + + # Add a library that the tests can link against (but don't install it) + if(NANOARROW_BUILD_TESTS) + add_library(nanoarrow_device ${NANOARROW_DEVICE_C_TEMP}) + + target_include_directories(nanoarrow_device + PUBLIC $ + $ + $ + ) + endif() + + # Install the amalgamated header and sources + install(FILES ${NANOARROW_DEVICE_H_TEMP} ${NANOARROW_DEVICE_C_TEMP} DESTINATION ".") + endif() else() add_library(nanoarrow src/nanoarrow/array.c src/nanoarrow/schema.c src/nanoarrow/array_stream.c src/nanoarrow/utils.c) @@ -329,7 +376,7 @@ else() PUBLIC $ $ $ - $ + $) install(TARGETS nanoarrow_ipc DESTINATION lib) @@ -337,6 +384,70 @@ else() src/nanoarrow/nanoarrow_ipc_flatcc_generated.h DESTINATION include/nanoarrow) endif() + + if(NANOARROW_DEVICE) + if(NANOARROW_DEVICE_WITH_METAL) + if(NOT EXISTS "${CMAKE_BINARY_DIR}/metal-cpp") + message(STATUS "Fetching metal-cpp") + file(DOWNLOAD + "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS12_iOS15.zip" + "${CMAKE_BINARY_DIR}/metal-cpp.zip") + file(ARCHIVE_EXTRACT + INPUT + ${CMAKE_BINARY_DIR}/metal-cpp.zip + DESTINATION + ${CMAKE_BINARY_DIR}) + endif() + + if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) + endif() + set(CMAKE_CXX_STANDARD_REQUIRED ON) + + find_library(METAL_LIBRARY Metal REQUIRED) + message(STATUS "Metal framework found at '${METAL_LIBRARY}'") + + find_library(FOUNDATION_LIBRARY Foundation REQUIRED) + message(STATUS "Foundation framework found at '${FOUNDATION_LIBRARY}'") + + find_library(QUARTZ_CORE_LIBRARY QuartzCore REQUIRED) + message(STATUS "CoreFoundation framework found at '${QUARTZ_CORE_LIBRARY}'") + + set(NANOARROW_DEVICE_SOURCES_METAL src/nanoarrow/nanoarrow_device_metal.cc) + set(NANOARROW_DEVICE_INCLUDE_METAL ${CMAKE_BINARY_DIR}/metal-cpp) + set(NANOARROW_DEVICE_LIBS_METAL ${METAL_LIBRARY} ${FOUNDATION_LIBRARY} + ${QUARTZ_CORE_LIBRARY}) + set(NANOARROW_DEVICE_DEFS_METAL "NANOARROW_DEVICE_WITH_METAL") + endif() + + if(NANOARROW_DEVICE_WITH_CUDA) + find_package(CUDAToolkit REQUIRED) + set(NANOARROW_DEVICE_SOURCES_CUDA src/nanoarrow/nanoarrow_device_cuda.c) + set(NANOARROW_DEVICE_LIBS_CUDA CUDA::cuda_driver) + set(NANOARROW_DEVICE_DEFS_CUDA "NANOARROW_DEVICE_WITH_CUDA") + endif() + + add_library(nanoarrow_device + src/nanoarrow/nanoarrow_device.c ${NANOARROW_DEVICE_SOURCES_METAL} + ${NANOARROW_DEVICE_SOURCES_CUDA}) + + target_include_directories(nanoarrow_device + PUBLIC $ + $ + $ + $ + $) + + target_compile_definitions(nanoarrow_device PRIVATE ${NANOARROW_DEVICE_DEFS_METAL} + ${NANOARROW_DEVICE_DEFS_CUDA}) + target_link_libraries(nanoarrow_device PUBLIC ${NANOARROW_DEVICE_LIBS_METAL} + ${NANOARROW_DEVICE_LIBS_CUDA}) + target_compile_definitions(nanoarrow_device + PUBLIC "$<$:NANOARROW_DEBUG>") + + install(TARGETS nanoarrow_device DESTINATION lib) + install(FILES src/nanoarrow/nanoarrow_device.h DESTINATION include/nanoarrow) + endif() endif() # Always build integration test if building tests @@ -493,6 +604,55 @@ if(NANOARROW_BUILD_TESTS) gtest_discover_tests(nanoarrow_ipc_files_test) gtest_discover_tests(nanoarrow_ipc_hpp_test) endif() + + if(NANOARROW_DEVICE) + enable_testing() + add_executable(nanoarrow_device_test src/nanoarrow/nanoarrow_device_test.cc) + add_executable(nanoarrow_device_hpp_test src/nanoarrow/nanoarrow_device_hpp_test.cc) + + if(NANOARROW_DEVICE_CODE_COVERAGE) + target_compile_options(device_coverage_config INTERFACE -O0 -g --coverage) + target_link_options(device_coverage_config INTERFACE --coverage) + target_link_libraries(nanoarrow_device PRIVATE device_coverage_config) + endif() + + target_link_libraries(nanoarrow_device_test + nanoarrow_device + nanoarrow + gtest_main + device_coverage_config) + target_link_libraries(nanoarrow_device_hpp_test + nanoarrow_device + nanoarrow + gtest_main + device_coverage_config) + + include(GoogleTest) + gtest_discover_tests(nanoarrow_device_test) + gtest_discover_tests(nanoarrow_device_hpp_test) + + if(NANOARROW_DEVICE_WITH_METAL) + add_executable(nanoarrow_device_metal_test + src/nanoarrow/nanoarrow_device_metal_test.cc) + target_link_libraries(nanoarrow_device_metal_test + nanoarrow_device + nanoarrow + gtest_main + device_coverage_config) + gtest_discover_tests(nanoarrow_device_metal_test) + endif() + + if(NANOARROW_DEVICE_WITH_CUDA) + add_executable(nanoarrow_device_cuda_test + src/nanoarrow/nanoarrow_device_cuda_test.cc) + target_link_libraries(nanoarrow_device_cuda_test + nanoarrow_device + nanoarrow + gtest_main + device_coverage_config) + gtest_discover_tests(nanoarrow_device_cuda_test) + endif() + endif() endif() if(NANOARROW_BUILD_APPS) @@ -502,10 +662,6 @@ if(NANOARROW_BUILD_APPS) endif() endif() -if(NANOARROW_DEVICE) - add_subdirectory(extensions/nanoarrow_device) -endif() - if(NANOARROW_BUILD_BENCHMARKS) add_subdirectory(dev/benchmarks) endif() diff --git a/ci/scripts/build-docs.sh b/ci/scripts/build-docs.sh index d8a6c1858..4bc9875bc 100755 --- a/ci/scripts/build-docs.sh +++ b/ci/scripts/build-docs.sh @@ -72,11 +72,6 @@ main() { doxygen popd - show_header "Run Doxygen for device extension" - pushd extensions/nanoarrow_device/src/apidoc - doxygen - popd - show_header "Build nanoarrow Python" pushd python diff --git a/ci/scripts/coverage.sh b/ci/scripts/coverage.sh index 772775b52..532fe8dd9 100755 --- a/ci/scripts/coverage.sh +++ b/ci/scripts/coverage.sh @@ -73,21 +73,8 @@ function main() { pushd "${SANDBOX_DIR}/nanoarrow" cmake "${TARGET_NANOARROW_DIR}" \ - -DNANOARROW_IPC=ON -DNANOARROW_BUILD_TESTS=ON -DNANOARROW_CODE_COVERAGE=ON - cmake --build . - CTEST_OUTPUT_ON_FAILURE=1 ctest . - - popd - - pushd "${SANDBOX_DIR}" - - # Build + run tests with gcov for device extension - show_header "Build + test nanoarrow_device" - mkdir "${SANDBOX_DIR}/nanoarrow_device" - pushd "${SANDBOX_DIR}/nanoarrow_device" - - cmake "${TARGET_NANOARROW_DIR}/extensions/nanoarrow_device" \ - -DNANOARROW_DEVICE_BUILD_TESTS=ON -DNANOARROW_DEVICE_CODE_COVERAGE=ON + -DNANOARROW_DEVICE=ON -DNANOARROW_IPC=ON \ + -DNANOARROW_BUILD_TESTS=ON -DNANOARROW_CODE_COVERAGE=ON cmake --build . CTEST_OUTPUT_ON_FAILURE=1 ctest . diff --git a/docs/source/conf.py b/docs/source/conf.py index d1c6286de..883a60951 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -66,8 +66,6 @@ def get_version(): # Breathe configuration breathe_projects = { "nanoarrow_c": "../../src/apidoc/xml", - "nanoarrow_ipc": "../../src/apidoc/xml", - "nanoarrow_device": "../../extensions/nanoarrow_device/src/apidoc/xml", } breathe_default_project = "nanoarrow_c" diff --git a/docs/source/reference/device.rst b/docs/source/reference/device.rst index 8313d5fcb..56cc54285 100644 --- a/docs/source/reference/device.rst +++ b/docs/source/reference/device.rst @@ -22,20 +22,20 @@ C API ------------------------ .. doxygengroup:: nanoarrow_device - :project: nanoarrow_device + :project: nanoarrow_c :members: C++ Helpers ------------------------ .. doxygengroup:: nanoarrow_device_hpp-unique - :project: nanoarrow_device + :project: nanoarrow_c :members: Arrow C Device Interface ------------------------ .. doxygengroup:: nanoarrow_device-arrow-cdata - :project: nanoarrow_device + :project: nanoarrow_c :members: :undoc-members: diff --git a/docs/source/reference/ipc.rst b/docs/source/reference/ipc.rst index fb009c1af..7d3ae1e1c 100644 --- a/docs/source/reference/ipc.rst +++ b/docs/source/reference/ipc.rst @@ -22,12 +22,12 @@ C API ------------------------ .. doxygengroup:: nanoarrow_ipc - :project: nanoarrow_ipc + :project: nanoarrow_c :members: C++ Helpers ------------------------ .. doxygengroup:: nanoarrow_ipc_hpp-unique - :project: nanoarrow_ipc + :project: nanoarrow_c :members: diff --git a/extensions/nanoarrow_device/.gitignore b/extensions/nanoarrow_device/.gitignore deleted file mode 100644 index ed6ccba4e..000000000 --- a/extensions/nanoarrow_device/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -dist/ diff --git a/extensions/nanoarrow_device/CMakeLists.txt b/extensions/nanoarrow_device/CMakeLists.txt deleted file mode 100644 index d985ea4c5..000000000 --- a/extensions/nanoarrow_device/CMakeLists.txt +++ /dev/null @@ -1,226 +0,0 @@ -# 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. - -message(STATUS "Building using CMake version: ${CMAKE_VERSION}") -cmake_minimum_required(VERSION 3.14) -include(FetchContent) - -if(NOT DEFINED CMAKE_C_STANDARD) - set(CMAKE_C_STANDARD 11) -endif() - -project(nanoarrow_device) - -option(NANOARROW_DEVICE_BUILD_TESTS "Build tests" OFF) -option(NANOARROW_DEVICE_BUNDLE "Create bundled nanoarrow_device.h and nanoarrow_device.c" - OFF) -option(NANOARROW_DEVICE_WITH_METAL "Build Apple metal extension" OFF) -option(NANOARROW_DEVICE_WITH_CUDA "Build CUDA extension" OFF) - -option(NANOARROW_DEVICE_CODE_COVERAGE "Enable coverage reporting" OFF) -add_library(device_coverage_config INTERFACE) - -if(NANOARROW_DEVICE_BUILD_TESTS OR NOT NANOARROW_DEVICE_BUNDLE) - # Lazily add the nanoarrow dependency - if(NOT TARGET nanoarrow) - fetchcontent_declare(nanoarrow SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) - - # Don't install nanoarrow because of this configuration - fetchcontent_getproperties(nanoarrow) - if(NOT nanoarrow_POPULATED) - fetchcontent_populate(nanoarrow) - add_subdirectory(${nanoarrow_SOURCE_DIR} ${nanoarrow_BINARY_DIR} EXCLUDE_FROM_ALL) - endif() - endif() -endif() - -if(NANOARROW_DEVICE_BUNDLE) - # The CMake build step is creating nanoarrow_device.c and nanoarrow_device.h; - # the CMake install step is copying them to a specific location - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/amalgamation) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow) - - # nanoarrow_device.h is currently standalone - set(NANOARROW_DEVICE_H_TEMP - ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow/nanoarrow_device.h) - file(READ src/nanoarrow/nanoarrow_device.h SRC_FILE_CONTENTS) - file(WRITE ${NANOARROW_DEVICE_H_TEMP} "${SRC_FILE_CONTENTS}") - - # nanoarrow_device.c is currently standalone - set(NANOARROW_DEVICE_C_TEMP - ${CMAKE_BINARY_DIR}/amalgamation/nanoarrow/nanoarrow_device.c) - file(READ src/nanoarrow/nanoarrow_device.c SRC_FILE_CONTENTS) - file(WRITE ${NANOARROW_DEVICE_C_TEMP} "${SRC_FILE_CONTENTS}") - - # Add a library that the tests can link against (but don't install it) - if(NANOARROW_DEVICE_BUILD_TESTS) - add_library(nanoarrow_device ${NANOARROW_DEVICE_C_TEMP}) - - target_include_directories(nanoarrow_device - PUBLIC $ - $ - $ - $ - ) - endif() - - # Install the amalgamated header and sources - install(FILES ${NANOARROW_DEVICE_H_TEMP} ${NANOARROW_DEVICE_C_TEMP} DESTINATION ".") -else() - # This is a normal CMake build that builds + installs some includes and a static lib - if(NANOARROW_DEVICE_WITH_METAL) - if(NOT EXISTS "${CMAKE_BINARY_DIR}/metal-cpp") - message(STATUS "Fetching metal-cpp") - file(DOWNLOAD - "https://developer.apple.com/metal/cpp/files/metal-cpp_macOS12_iOS15.zip" - "${CMAKE_BINARY_DIR}/metal-cpp.zip") - file(ARCHIVE_EXTRACT - INPUT - ${CMAKE_BINARY_DIR}/metal-cpp.zip - DESTINATION - ${CMAKE_BINARY_DIR}) - endif() - - if(NOT DEFINED CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 17) - endif() - set(CMAKE_CXX_STANDARD_REQUIRED ON) - - find_library(METAL_LIBRARY Metal REQUIRED) - message(STATUS "Metal framework found at '${METAL_LIBRARY}'") - - find_library(FOUNDATION_LIBRARY Foundation REQUIRED) - message(STATUS "Foundation framework found at '${FOUNDATION_LIBRARY}'") - - find_library(QUARTZ_CORE_LIBRARY QuartzCore REQUIRED) - message(STATUS "CoreFoundation framework found at '${QUARTZ_CORE_LIBRARY}'") - - set(NANOARROW_DEVICE_SOURCES_METAL src/nanoarrow/nanoarrow_device_metal.cc) - set(NANOARROW_DEVICE_INCLUDE_METAL ${CMAKE_BINARY_DIR}/metal-cpp) - set(NANOARROW_DEVICE_LIBS_METAL ${METAL_LIBRARY} ${FOUNDATION_LIBRARY} - ${QUARTZ_CORE_LIBRARY}) - set(NANOARROW_DEVICE_DEFS_METAL "NANOARROW_DEVICE_WITH_METAL") - endif() - - if(NANOARROW_DEVICE_WITH_CUDA) - find_package(CUDAToolkit REQUIRED) - set(NANOARROW_DEVICE_SOURCES_CUDA src/nanoarrow/nanoarrow_device_cuda.c) - set(NANOARROW_DEVICE_LIBS_CUDA CUDA::cuda_driver) - set(NANOARROW_DEVICE_DEFS_CUDA "NANOARROW_DEVICE_WITH_CUDA") - endif() - - add_library(nanoarrow_device - src/nanoarrow/nanoarrow_device.c ${NANOARROW_DEVICE_SOURCES_METAL} - ${NANOARROW_DEVICE_SOURCES_CUDA}) - - target_include_directories(nanoarrow_device - PUBLIC $ - $ - $ - $ - $) - - target_compile_definitions(nanoarrow_device PRIVATE ${NANOARROW_DEVICE_DEFS_METAL} - ${NANOARROW_DEVICE_DEFS_CUDA}) - target_link_libraries(nanoarrow_device PUBLIC ${NANOARROW_DEVICE_LIBS_METAL} - ${NANOARROW_DEVICE_LIBS_CUDA}) - target_compile_definitions(nanoarrow_device PUBLIC "$<$:NANOARROW_DEBUG>") - - install(TARGETS nanoarrow_device DESTINATION lib) - install(FILES src/nanoarrow/nanoarrow_device.h DESTINATION include/nanoarrow) - -endif() - -if(NANOARROW_DEVICE_BUILD_TESTS) - set(MEMORYCHECK_COMMAND_OPTIONS - "--leak-check=full --suppressions=${CMAKE_CURRENT_LIST_DIR}/../../valgrind.supp --error-exitcode=1" - ) - include(CTest) - include(FetchContent) - - if(NOT DEFINED CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 11) - endif() - set(CMAKE_CXX_STANDARD_REQUIRED ON) - - # Warning about timestamps of downloaded files - if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.23") - cmake_policy(SET CMP0135 NEW) - endif() - - # Use an old version of googletest if we have to to support gcc 4.8 - if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION - VERSION_GREATER_EQUAL "5.0.0") - fetchcontent_declare(googletest - URL https://github.com/google/googletest/archive/release-1.11.0.zip - URL_HASH SHA256=353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a - ) - else() - fetchcontent_declare(googletest - URL https://github.com/google/googletest/archive/release-1.10.0.zip - URL_HASH SHA256=94c634d499558a76fa649edb13721dce6e98fb1e7018dfaeba3cd7a083945e91 - ) - endif() - - fetchcontent_makeavailable(googletest) - - enable_testing() - add_executable(nanoarrow_device_test src/nanoarrow/nanoarrow_device_test.cc) - add_executable(nanoarrow_device_hpp_test src/nanoarrow/nanoarrow_device_hpp_test.cc) - - if(NANOARROW_DEVICE_CODE_COVERAGE) - target_compile_options(device_coverage_config INTERFACE -O0 -g --coverage) - target_link_options(device_coverage_config INTERFACE --coverage) - target_link_libraries(nanoarrow_device PRIVATE device_coverage_config) - endif() - - target_link_libraries(nanoarrow_device_test - nanoarrow_device - nanoarrow - gtest_main - device_coverage_config) - target_link_libraries(nanoarrow_device_hpp_test - nanoarrow_device - nanoarrow - gtest_main - device_coverage_config) - - include(GoogleTest) - gtest_discover_tests(nanoarrow_device_test) - gtest_discover_tests(nanoarrow_device_hpp_test) - - if(NANOARROW_DEVICE_WITH_METAL) - add_executable(nanoarrow_device_metal_test - src/nanoarrow/nanoarrow_device_metal_test.cc) - target_link_libraries(nanoarrow_device_metal_test - nanoarrow_device - nanoarrow - gtest_main - device_coverage_config) - gtest_discover_tests(nanoarrow_device_metal_test) - endif() - - if(NANOARROW_DEVICE_WITH_CUDA) - add_executable(nanoarrow_device_cuda_test src/nanoarrow/nanoarrow_device_cuda_test.cc) - target_link_libraries(nanoarrow_device_cuda_test - nanoarrow_device - nanoarrow - gtest_main - device_coverage_config) - gtest_discover_tests(nanoarrow_device_cuda_test) - endif() -endif() diff --git a/extensions/nanoarrow_device/CMakePresets.json b/extensions/nanoarrow_device/CMakePresets.json deleted file mode 100644 index f1a8ddd5e..000000000 --- a/extensions/nanoarrow_device/CMakePresets.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": 3, - "cmakeMinimumRequired": { - "major": 3, - "minor": 21, - "patch": 0 - }, - "configurePresets": [ - { - "name": "default", - "displayName": "Default Config", - "cacheVariables": {} - }, - { - "name": "default-with-tests", - "inherits": [ - "default" - ], - "displayName": "Default with tests", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "NANOARROW_DEVICE_BUILD_TESTS": "ON" - } - } - ] -} diff --git a/extensions/nanoarrow_device/CMakeUserPresets.json.example b/extensions/nanoarrow_device/CMakeUserPresets.json.example deleted file mode 100644 index 8cf26f027..000000000 --- a/extensions/nanoarrow_device/CMakeUserPresets.json.example +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": 3, - "cmakeMinimumRequired": { - "major": 3, - "minor": 21, - "patch": 0 - }, - "configurePresets": [ - { - "name": "user-local", - "inherits": ["default-with-tests"], - "displayName": "(user) local build", - "cacheVariables": { - - } - } - ], - "testPresets": [ - { - "name": "user-test-preset", - "description": "", - "displayName": "(user) test preset)", - "configurePreset": "user-local", - "environment": { - "CTEST_OUTPUT_ON_FAILURE": "1" - } - } - ] -} diff --git a/extensions/nanoarrow_device/README.md b/extensions/nanoarrow_device/README.md deleted file mode 100644 index 1b6d9a920..000000000 --- a/extensions/nanoarrow_device/README.md +++ /dev/null @@ -1,68 +0,0 @@ - - -# nanoarrow device extension - -This extension provides a similar set of tools as the core nanoarrow C API -extended to the -[Arrow C Device](https://arrow.apache.org/docs/dev/format/CDeviceDataInterface.html) -interfaces in the Arrow specification. - -Currently, this extension provides an implementation of CUDA devices -and an implementation for the default Apple Metal device on MacOS/M1. -These implementation are preliminary/experimental and are under active -development. - -## Example - -```c -struct ArrowDevice* gpu = ArrowDeviceMetalDefaultDevice(); -// Alternatively, ArrowDeviceCuda(ARROW_DEVICE_CUDA, 0) -// or ArrowDeviceCuda(ARROW_DEVICE_CUDA_HOST, 0) -struct ArrowDevice* cpu = ArrowDeviceCpu(); -struct ArrowArray array; -struct ArrowDeviceArray device_array; -struct ArrowDeviceArrayView device_array_view; - -// Build a CPU array -ASSERT_EQ(ArrowArrayInitFromType(&array, NANOARROW_TYPE_STRING), NANOARROW_OK); -ASSERT_EQ(ArrowArrayStartAppending(&array), NANOARROW_OK); -ASSERT_EQ(ArrowArrayAppendString(&array, ArrowCharView("abc")), NANOARROW_OK); -ASSERT_EQ(ArrowArrayAppendString(&array, ArrowCharView("defg")), NANOARROW_OK); -ASSERT_EQ(ArrowArrayAppendNull(&array, 1), NANOARROW_OK); -ASSERT_EQ(ArrowArrayFinishBuildingDefault(&array, nullptr), NANOARROW_OK); - -// Convert to a DeviceArray, still on the CPU -ASSERT_EQ(ArrowDeviceArrayInit(cpu, &device_array, &array), NANOARROW_OK); - -// Parse contents into a view that can be copied to another device -ArrowDeviceArrayViewInit(&device_array_view); -ArrowArrayViewInitFromType(&device_array_view.array_view, string_type); -ASSERT_EQ(ArrowDeviceArrayViewSetArray(&device_array_view, &device_array, nullptr), - NANOARROW_OK); - -// Copy to another device. For some devices, ArrowDeviceArrayMoveToDevice() is -// possible without an explicit copy (although this sometimes triggers an implicit -// copy by the driver). -struct ArrowDeviceArray device_array2; -device_array2.array.release = nullptr; -ASSERT_EQ( - ArrowDeviceArrayViewCopy(&device_array, &device_array_view, gpu, &device_array2), - NANOARROW_OK); -``` diff --git a/extensions/nanoarrow_device/src/apidoc/.gitignore b/extensions/nanoarrow_device/src/apidoc/.gitignore deleted file mode 100644 index 8e6b49095..000000000 --- a/extensions/nanoarrow_device/src/apidoc/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -xml diff --git a/extensions/nanoarrow_device/src/apidoc/Doxyfile b/extensions/nanoarrow_device/src/apidoc/Doxyfile deleted file mode 100644 index 8cafd193c..000000000 --- a/extensions/nanoarrow_device/src/apidoc/Doxyfile +++ /dev/null @@ -1,407 +0,0 @@ -# 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. -# -# Doxyfile 1.9.4 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "nanoarrow_device" -PROJECT_NUMBER = -PROJECT_BRIEF = -PROJECT_LOGO = -OUTPUT_DIRECTORY = -CREATE_SUBDIRS = NO -CREATE_SUBDIRS_LEVEL = 8 -ALLOW_UNICODE_NAMES = NO -OUTPUT_LANGUAGE = English -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -JAVADOC_BANNER = NO -QT_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -PYTHON_DOCSTRING = YES -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = NO -OPTIMIZE_OUTPUT_VHDL = NO -OPTIMIZE_OUTPUT_SLICE = NO -EXTENSION_MAPPING = -MARKDOWN_SUPPORT = YES -TOC_INCLUDE_HEADINGS = 5 -AUTOLINK_SUPPORT = YES -BUILTIN_STL_SUPPORT = NO -CPP_CLI_SUPPORT = NO -SIP_SUPPORT = NO -IDL_PROPERTY_SUPPORT = YES -DISTRIBUTE_GROUP_DOC = NO -GROUP_NESTED_COMPOUNDS = NO -SUBGROUPING = YES -INLINE_GROUPED_CLASSES = NO -INLINE_SIMPLE_STRUCTS = NO -TYPEDEF_HIDES_STRUCT = NO -LOOKUP_CACHE_SIZE = 0 -NUM_PROC_THREADS = 1 -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_PRIV_VIRTUAL = NO -EXTRACT_PACKAGE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -EXTRACT_ANON_NSPACES = NO -RESOLVE_UNNAMED_PARAMS = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = NO -HIDE_SCOPE_NAMES = NO -HIDE_COMPOUND_REFERENCE= NO -SHOW_HEADERFILE = YES -SHOW_INCLUDE_FILES = YES -SHOW_GROUPED_MEMB_INC = NO -FORCE_LOCAL_INCLUDES = NO -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_MEMBERS_CTORS_1ST = NO -SORT_GROUP_NAMES = NO -SORT_BY_SCOPE_NAME = NO -STRICT_PROTO_MATCHING = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_FILES = YES -SHOW_NAMESPACES = YES -FILE_VERSION_FILTER = -LAYOUT_FILE = -CITE_BIB_FILES = -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_IF_INCOMPLETE_DOC = YES -WARN_NO_PARAMDOC = NO -WARN_AS_ERROR = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LINE_FORMAT = "at line $line of file $file" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ../nanoarrow \ - . -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.l \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.pyw \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f18 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.ice -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -FILTER_SOURCE_PATTERNS = -USE_MDFILE_AS_MAINPAGE = -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -REFERENCES_LINK_SOURCE = YES -SOURCE_TOOLTIPS = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = NO -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_EXTRA_STYLESHEET = -HTML_EXTRA_FILES = -HTML_COLORSTYLE_HUE = 220 -HTML_COLORSTYLE_SAT = 100 -HTML_COLORSTYLE_GAMMA = 80 -HTML_TIMESTAMP = NO -HTML_DYNAMIC_MENUS = YES -HTML_DYNAMIC_SECTIONS = NO -HTML_INDEX_NUM_ENTRIES = 100 -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_FEEDURL = -DOCSET_BUNDLE_ID = org.doxygen.Project -DOCSET_PUBLISHER_ID = org.doxygen.Publisher -DOCSET_PUBLISHER_NAME = Publisher -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -CHM_INDEX_ENCODING = -BINARY_TOC = NO -TOC_EXPAND = NO -GENERATE_QHP = NO -QCH_FILE = -QHP_NAMESPACE = org.doxygen.Project -QHP_VIRTUAL_FOLDER = doc -QHP_CUST_FILTER_NAME = -QHP_CUST_FILTER_ATTRS = -QHP_SECT_FILTER_ATTRS = -QHG_LOCATION = -GENERATE_ECLIPSEHELP = NO -ECLIPSE_DOC_ID = org.doxygen.Project -DISABLE_INDEX = NO -GENERATE_TREEVIEW = NO -FULL_SIDEBAR = NO -ENUM_VALUES_PER_LINE = 4 -TREEVIEW_WIDTH = 250 -EXT_LINKS_IN_WINDOW = NO -OBFUSCATE_EMAILS = YES -HTML_FORMULA_FORMAT = png -FORMULA_FONTSIZE = 10 -FORMULA_TRANSPARENT = YES -FORMULA_MACROFILE = -USE_MATHJAX = NO -MATHJAX_VERSION = MathJax_2 -MATHJAX_FORMAT = HTML-CSS -MATHJAX_RELPATH = -MATHJAX_EXTENSIONS = -MATHJAX_CODEFILE = -SEARCHENGINE = YES -SERVER_BASED_SEARCH = NO -EXTERNAL_SEARCH = NO -SEARCHENGINE_URL = -SEARCHDATA_FILE = searchdata.xml -EXTERNAL_SEARCH_ID = -EXTRA_SEARCH_MAPPINGS = -#--------------------------------------------------------------------------- -# Configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = -MAKEINDEX_CMD_NAME = makeindex -LATEX_MAKEINDEX_CMD = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4 -EXTRA_PACKAGES = -LATEX_HEADER = -LATEX_FOOTER = -LATEX_EXTRA_STYLESHEET = -LATEX_EXTRA_FILES = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -LATEX_BIB_STYLE = plain -LATEX_TIMESTAMP = NO -LATEX_EMOJI_DIRECTORY = -#--------------------------------------------------------------------------- -# Configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# Configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_SUBDIR = -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# Configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = YES -XML_OUTPUT = xml -XML_PROGRAMLISTING = YES -XML_NS_MEMB_FILE_SCOPE = NO -#--------------------------------------------------------------------------- -# Configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- -GENERATE_DOCBOOK = NO -DOCBOOK_OUTPUT = docbook -#--------------------------------------------------------------------------- -# Configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# Configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration options related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -EXTERNAL_PAGES = YES -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -DIA_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -DOT_NUM_THREADS = 0 -DOT_FONTNAME = Helvetica -DOT_FONTSIZE = 10 -DOT_FONTPATH = -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -UML_LIMIT_NUM_FIELDS = 10 -DOT_UML_DETAILS = NO -DOT_WRAP_THRESHOLD = 17 -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DIR_GRAPH_MAX_DEPTH = 1 -DOT_IMAGE_FORMAT = png -INTERACTIVE_SVG = NO -DOT_PATH = -DOTFILE_DIRS = -MSCFILE_DIRS = -DIAFILE_DIRS = -PLANTUML_JAR_PATH = -PLANTUML_CFG_FILE = -PLANTUML_INCLUDE_PATH = -DOT_GRAPH_MAX_NODES = 50 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES diff --git a/python/bootstrap.py b/python/bootstrap.py index ce42fb34f..1ae11707f 100644 --- a/python/bootstrap.py +++ b/python/bootstrap.py @@ -18,7 +18,6 @@ import os import pathlib import re -import shutil import subprocess import tempfile import warnings @@ -214,22 +213,8 @@ def copy_or_generate_nanoarrow_c(): if not has_cmake: raise ValueError("Attempt to build source distribution without CMake") - # The C library, IPC extension, and Device extension all currently have slightly - # different methods of bundling (hopefully this can be unified) - vendor_dir.mkdir(exist_ok=True) - # Copy device files - device_ext_src = ( - source_dir / "extensions" / "nanoarrow_device" / "src" / "nanoarrow" - ) - - for device_file in ["nanoarrow_device.h", "nanoarrow_device.c"]: - shutil.copyfile( - device_ext_src / device_file, - dst[device_file], - ) - for cmake_project in [source_dir, source_dir]: with tempfile.TemporaryDirectory() as build_dir: try: @@ -241,6 +226,7 @@ def copy_or_generate_nanoarrow_c(): "-S", cmake_project, "-DNANOARROW_BUNDLE=ON", + "-DNANOARROW_DEVICE=ON", "-DNANOARROW_IPC=ON", "-DNANOARROW_NAMESPACE=PythonPkg", ] diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device.c b/src/nanoarrow/nanoarrow_device.c similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device.c rename to src/nanoarrow/nanoarrow_device.c diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device.h b/src/nanoarrow/nanoarrow_device.h similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device.h rename to src/nanoarrow/nanoarrow_device.h diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device.hpp b/src/nanoarrow/nanoarrow_device.hpp similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device.hpp rename to src/nanoarrow/nanoarrow_device.hpp diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_cuda.c b/src/nanoarrow/nanoarrow_device_cuda.c similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_cuda.c rename to src/nanoarrow/nanoarrow_device_cuda.c diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_cuda.h b/src/nanoarrow/nanoarrow_device_cuda.h similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_cuda.h rename to src/nanoarrow/nanoarrow_device_cuda.h diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_cuda_test.cc b/src/nanoarrow/nanoarrow_device_cuda_test.cc similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_cuda_test.cc rename to src/nanoarrow/nanoarrow_device_cuda_test.cc diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_hpp_test.cc b/src/nanoarrow/nanoarrow_device_hpp_test.cc similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_hpp_test.cc rename to src/nanoarrow/nanoarrow_device_hpp_test.cc diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_metal.cc b/src/nanoarrow/nanoarrow_device_metal.cc similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_metal.cc rename to src/nanoarrow/nanoarrow_device_metal.cc diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_metal.h b/src/nanoarrow/nanoarrow_device_metal.h similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_metal.h rename to src/nanoarrow/nanoarrow_device_metal.h diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_metal_test.cc b/src/nanoarrow/nanoarrow_device_metal_test.cc similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_metal_test.cc rename to src/nanoarrow/nanoarrow_device_metal_test.cc diff --git a/extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_test.cc b/src/nanoarrow/nanoarrow_device_test.cc similarity index 100% rename from extensions/nanoarrow_device/src/nanoarrow/nanoarrow_device_test.cc rename to src/nanoarrow/nanoarrow_device_test.cc