From 38d988bceec620317fb9c267e6dd23c569ffbbf5 Mon Sep 17 00:00:00 2001 From: Paul Taylor <178183+trxcllnt@users.noreply.github.com> Date: Mon, 13 May 2024 13:20:02 -0700 Subject: [PATCH 1/6] add --rm and --name to devcontainer run args (#15572) * Remove the devcontainer when the VSCode window closes * Adds a descriptive name to the running container: ```shell $ docker ps -a CONTAINER ID IMAGE ... NAMES 0dbb364fe544 vsc-cudf-... ... rapids-cudf-24.06-cuda12.2-conda $ docker rm -f rapids-cudf-24.06-cuda12.2-conda ``` Authors: - Paul Taylor (https://github.com/trxcllnt) Approvers: - Ray Douglass (https://github.com/raydouglass) - Bradley Dice (https://github.com/bdice) - Karthikeyan (https://github.com/karthikeyann) URL: https://github.com/rapidsai/cudf/pull/15572 --- .devcontainer/cuda11.8-conda/devcontainer.json | 5 +++++ .devcontainer/cuda11.8-pip/devcontainer.json | 5 +++++ .devcontainer/cuda12.2-conda/devcontainer.json | 5 +++++ .devcontainer/cuda12.2-pip/devcontainer.json | 5 +++++ ci/release/update-version.sh | 1 + cpp/scripts/run-cmake-format.sh | 4 ++-- 6 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.devcontainer/cuda11.8-conda/devcontainer.json b/.devcontainer/cuda11.8-conda/devcontainer.json index 9999eebdc97..944a73ecc98 100644 --- a/.devcontainer/cuda11.8-conda/devcontainer.json +++ b/.devcontainer/cuda11.8-conda/devcontainer.json @@ -8,6 +8,11 @@ "BASE": "rapidsai/devcontainers:24.06-cpp-cuda11.8-mambaforge-ubuntu22.04" } }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER}-rapids-${localWorkspaceFolderBasename}-24.06-cuda11.8-conda" + ], "hostRequirements": {"gpu": "optional"}, "features": { "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.6": {} diff --git a/.devcontainer/cuda11.8-pip/devcontainer.json b/.devcontainer/cuda11.8-pip/devcontainer.json index 90471e0b750..8b802333bda 100644 --- a/.devcontainer/cuda11.8-pip/devcontainer.json +++ b/.devcontainer/cuda11.8-pip/devcontainer.json @@ -8,6 +8,11 @@ "BASE": "rapidsai/devcontainers:24.06-cpp-cuda11.8-ubuntu22.04" } }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER}-rapids-${localWorkspaceFolderBasename}-24.06-cuda11.8-pip" + ], "hostRequirements": {"gpu": "optional"}, "features": { "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.6": {} diff --git a/.devcontainer/cuda12.2-conda/devcontainer.json b/.devcontainer/cuda12.2-conda/devcontainer.json index 5a61d26e1f5..886b07025cc 100644 --- a/.devcontainer/cuda12.2-conda/devcontainer.json +++ b/.devcontainer/cuda12.2-conda/devcontainer.json @@ -8,6 +8,11 @@ "BASE": "rapidsai/devcontainers:24.06-cpp-mambaforge-ubuntu22.04" } }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER}-rapids-${localWorkspaceFolderBasename}-24.06-cuda12.2-conda" + ], "hostRequirements": {"gpu": "optional"}, "features": { "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.6": {} diff --git a/.devcontainer/cuda12.2-pip/devcontainer.json b/.devcontainer/cuda12.2-pip/devcontainer.json index 29817cdadc3..86df56ada19 100644 --- a/.devcontainer/cuda12.2-pip/devcontainer.json +++ b/.devcontainer/cuda12.2-pip/devcontainer.json @@ -8,6 +8,11 @@ "BASE": "rapidsai/devcontainers:24.06-cpp-cuda12.2-ubuntu22.04" } }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER}-rapids-${localWorkspaceFolderBasename}-24.06-cuda12.2-pip" + ], "hostRequirements": {"gpu": "optional"}, "features": { "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.6": {} diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 99f9c698217..beeb130f0f1 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -88,4 +88,5 @@ sed_runner "s/cudf-.*-SNAPSHOT/cudf-${NEXT_FULL_JAVA_TAG}/g" java/ci/README.md find .devcontainer/ -type f -name devcontainer.json -print0 | while IFS= read -r -d '' filename; do sed_runner "s@rapidsai/devcontainers:[0-9.]*@rapidsai/devcontainers:${NEXT_SHORT_TAG}@g" "${filename}" sed_runner "s@rapidsai/devcontainers/features/rapids-build-utils:[0-9.]*@rapidsai/devcontainers/features/rapids-build-utils:${NEXT_SHORT_TAG_PEP440}@" "${filename}" + sed_runner "s@rapids-\${localWorkspaceFolderBasename}-[0-9.]*@rapids-\${localWorkspaceFolderBasename}-${NEXT_SHORT_TAG}@g" "${filename}" done diff --git a/cpp/scripts/run-cmake-format.sh b/cpp/scripts/run-cmake-format.sh index f3e21779aa5..603880954a6 100755 --- a/cpp/scripts/run-cmake-format.sh +++ b/cpp/scripts/run-cmake-format.sh @@ -1,6 +1,5 @@ #!/bin/bash - -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. # This script is a wrapper for cmakelang that may be used with pre-commit. The # wrapping is necessary because RAPIDS libraries split configuration for @@ -45,6 +44,7 @@ fi DEFAULT_FORMAT_FILE_LOCATIONS=( "${CUDF_BUILD_DIR:-${HOME}}/_deps/rapids-cmake-src/cmake-format-rapids-cmake.json" + "${CUDF_BUILD_DIR:-cpp/build}/latest/_deps/rapids-cmake-src/cmake-format-rapids-cmake.json" "cpp/libcudf_kafka/build/_deps/rapids-cmake-src/cmake-format-rapids-cmake.json" ) From 3a33d51bb8bf95542e27d63ff007989802615a68 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 13 May 2024 14:26:22 -1000 Subject: [PATCH 2/6] Disable pandas 2.x clipboard tests in cudf.pandas tests (#15462) Clipboard testing currently `ERROR` since a `pytest-qt` fixture isn't found. Even when this fixture is installed these tests seems to consistent crash pytest workers (I suspect since there is some method patching in `test_clipboard.py`. I don't think `cudf.pandas` should realistically work with clipboard functionality so just skipping these tests instead Authors: - Matthew Roeschke (https://github.com/mroeschke) - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/cudf/pull/15462 --- python/cudf/cudf/pandas/scripts/run-pandas-tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/pandas/scripts/run-pandas-tests.sh b/python/cudf/cudf/pandas/scripts/run-pandas-tests.sh index af7fa72d44e..6eb28104120 100755 --- a/python/cudf/cudf/pandas/scripts/run-pandas-tests.sh +++ b/python/cudf/cudf/pandas/scripts/run-pandas-tests.sh @@ -22,7 +22,9 @@ set -euo pipefail # of Pandas installed. PANDAS_VERSION=$(python -c "import pandas; print(pandas.__version__)") -PYTEST_IGNORES="--ignore=tests/io/parser/common/test_read_errors.py" +# tests/io/test_clipboard.py::TestClipboard crashes pytest workers (possibly due to fixture patching clipboard functionality) +PYTEST_IGNORES="--ignore=tests/io/parser/common/test_read_errors.py \ +--ignore=tests/io/test_clipboard.py" mkdir -p pandas-testing cd pandas-testing From 0f6ce63431cff85a278eafc555e74ee0e101f6da Mon Sep 17 00:00:00 2001 From: Liangcai Li Date: Tue, 14 May 2024 09:28:44 +0800 Subject: [PATCH 3/6] Add JNI bindings for zstd compression of NVCOMP. (#15729) Authors: - Liangcai Li (https://github.com/firestarman) Approvers: - Jason Lowe (https://github.com/jlowe) URL: https://github.com/rapidsai/cudf/pull/15729 --- .../rapids/cudf/nvcomp/BatchedCompressor.java | 335 ++++++++++++++++++ .../cudf/nvcomp/BatchedDecompressor.java | 220 ++++++++++++ .../cudf/nvcomp/BatchedLZ4Compressor.java | 310 +--------------- .../cudf/nvcomp/BatchedLZ4Decompressor.java | 182 +--------- .../cudf/nvcomp/BatchedZstdCompressor.java | 45 +++ .../cudf/nvcomp/BatchedZstdDecompressor.java | 37 ++ .../java/ai/rapids/cudf/nvcomp/NvcompJni.java | 96 ++++- java/src/main/native/src/NvcompJni.cpp | 156 ++++++++ .../ai/rapids/cudf/nvcomp/NvcompTest.java | 27 +- 9 files changed, 943 insertions(+), 465 deletions(-) create mode 100644 java/src/main/java/ai/rapids/cudf/nvcomp/BatchedCompressor.java create mode 100644 java/src/main/java/ai/rapids/cudf/nvcomp/BatchedDecompressor.java create mode 100644 java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdCompressor.java create mode 100644 java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdDecompressor.java diff --git a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedCompressor.java b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedCompressor.java new file mode 100644 index 00000000000..72dfcdb3cb5 --- /dev/null +++ b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedCompressor.java @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2024, NVIDIA CORPORATION. + * + * Licensed 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. + */ + +package ai.rapids.cudf.nvcomp; + +import ai.rapids.cudf.BaseDeviceMemoryBuffer; +import ai.rapids.cudf.CloseableArray; +import ai.rapids.cudf.Cuda; +import ai.rapids.cudf.DeviceMemoryBuffer; +import ai.rapids.cudf.HostMemoryBuffer; +import ai.rapids.cudf.MemoryBuffer; +import ai.rapids.cudf.NvtxColor; +import ai.rapids.cudf.NvtxRange; + +/** Multi-buffer compressor */ +public abstract class BatchedCompressor { + + static final long MAX_CHUNK_SIZE = 16777216; // 16MiB in bytes + // each chunk has a 64-bit integer value as metadata containing the compressed size + static final long METADATA_BYTES_PER_CHUNK = 8; + + private final long chunkSize; + private final long maxIntermediateBufferSize; + private final long maxOutputChunkSize; + + /** + * Construct a batched compressor instance + * @param chunkSize maximum amount of uncompressed data to compress as a single chunk. + * Inputs larger than this will be compressed in multiple chunks. + * @param maxIntermediateBufferSize desired maximum size of intermediate device + * buffers used during compression. + */ + public BatchedCompressor(long chunkSize, long maxOutputChunkSize, + long maxIntermediateBufferSize) { + validateChunkSize(chunkSize); + assert maxOutputChunkSize < Integer.MAX_VALUE; + this.chunkSize = chunkSize; + this.maxOutputChunkSize = maxOutputChunkSize; + this.maxIntermediateBufferSize = Math.max(maxOutputChunkSize, maxIntermediateBufferSize); + } + + /** + * Compress a batch of buffers. The input buffers will be closed. + * @param origInputs buffers to compress + * @param stream CUDA stream to use + * @return compressed buffers corresponding to the input buffers + */ + public DeviceMemoryBuffer[] compress(BaseDeviceMemoryBuffer[] origInputs, Cuda.Stream stream) { + try (CloseableArray inputs = CloseableArray.wrap(origInputs)) { + if (chunkSize <= 0) { + throw new IllegalArgumentException("Illegal chunk size: " + chunkSize); + } + final int numInputs = inputs.size(); + if (numInputs == 0) { + return new DeviceMemoryBuffer[0]; + } + + // Each buffer is broken up into chunkSize chunks for compression. Calculate how many + // chunks are needed for each input buffer. + int[] chunksPerInput = new int[numInputs]; + int numChunks = 0; + for (int i = 0; i < numInputs; i++) { + BaseDeviceMemoryBuffer buffer = inputs.get(i); + int numBufferChunks = getNumChunksInBuffer(buffer); + chunksPerInput[i] = numBufferChunks; + numChunks += numBufferChunks; + } + + // Allocate buffers for each chunk and generate parallel lists of chunk source addresses, + // chunk destination addresses, and sizes. + try (CloseableArray compressedBuffers = + allocCompressedBuffers(numChunks, stream); + DeviceMemoryBuffer compressedChunkSizes = + DeviceMemoryBuffer.allocate(numChunks * 8L, stream)) { + long[] inputChunkAddrs = new long[numChunks]; + long[] inputChunkSizes = new long[numChunks]; + long[] outputChunkAddrs = new long[numChunks]; + buildAddrsAndSizes(inputs, inputChunkAddrs, inputChunkSizes, compressedBuffers, + outputChunkAddrs); + + final long tempBufferSize = batchedCompressGetTempSize(numChunks, chunkSize); + try (DeviceMemoryBuffer addrsAndSizes = putAddrsAndSizesOnDevice(inputChunkAddrs, + inputChunkSizes, outputChunkAddrs, stream); + DeviceMemoryBuffer tempBuffer = + DeviceMemoryBuffer.allocate(tempBufferSize, stream)) { + final long devOutputAddrsPtr = addrsAndSizes.getAddress() + numChunks * 8L; + final long devInputSizesPtr = devOutputAddrsPtr + numChunks * 8L; + batchedCompressAsync(addrsAndSizes.getAddress(), devInputSizesPtr, chunkSize, + numChunks, tempBuffer.getAddress(), tempBufferSize, devOutputAddrsPtr, + compressedChunkSizes.getAddress(), stream.getStream()); + } + + // Synchronously copy the resulting compressed sizes per chunk. + long[] outputChunkSizes = getOutputChunkSizes(compressedChunkSizes, stream); + + // inputs are no longer needed at this point, so free them early + inputs.close(); + + // Combine compressed chunks into output buffers corresponding to each original input + return stitchOutput(chunksPerInput, compressedChunkSizes, outputChunkAddrs, + outputChunkSizes, stream); + } + } + } + + static void validateChunkSize(long chunkSize) { + if (chunkSize <= 0 || chunkSize > MAX_CHUNK_SIZE) { + throw new IllegalArgumentException("Invalid chunk size: " + chunkSize + + " Max chunk size is: " + MAX_CHUNK_SIZE + " bytes"); + } + } + + private static long ceilingDivide(long x, long y) { + return (x + y - 1) / y; + } + + private int getNumChunksInBuffer(MemoryBuffer buffer) { + return (int) ceilingDivide(buffer.getLength(), chunkSize); + } + + private CloseableArray allocCompressedBuffers(long numChunks, + Cuda.Stream stream) { + final long chunksPerBuffer = maxIntermediateBufferSize / maxOutputChunkSize; + final long numBuffers = ceilingDivide(numChunks, chunksPerBuffer); + if (numBuffers > Integer.MAX_VALUE) { + throw new IllegalStateException("Too many chunks"); + } + try (NvtxRange range = new NvtxRange("allocCompressedBuffers", NvtxColor.YELLOW)) { + CloseableArray buffers = CloseableArray.wrap( + new DeviceMemoryBuffer[(int) numBuffers]); + try { + // allocate all of the max-chunks intermediate compressed buffers + for (int i = 0; i < buffers.size() - 1; ++i) { + buffers.set(i, + DeviceMemoryBuffer.allocate(chunksPerBuffer * maxOutputChunkSize, stream)); + } + // allocate the tail intermediate compressed buffer that may be smaller than the others + buffers.set(buffers.size() - 1, DeviceMemoryBuffer.allocate( + (numChunks - chunksPerBuffer * (buffers.size() - 1)) * maxOutputChunkSize, stream)); + return buffers; + } catch (Exception e) { + buffers.close(e); + throw e; + } + } + } + + // Fill in the inputChunkAddrs, inputChunkSizes, and outputChunkAddrs arrays to point + // into the chunks in the input and output buffers. + private void buildAddrsAndSizes(CloseableArray inputs, + long[] inputChunkAddrs, long[] inputChunkSizes, + CloseableArray compressedBuffers, long[] outputChunkAddrs) { + // setup the input addresses and sizes + int chunkIdx = 0; + for (BaseDeviceMemoryBuffer input : inputs.getArray()) { + final int numChunksInBuffer = getNumChunksInBuffer(input); + for (int i = 0; i < numChunksInBuffer; i++) { + inputChunkAddrs[chunkIdx] = input.getAddress() + i * chunkSize; + inputChunkSizes[chunkIdx] = (i != numChunksInBuffer - 1) ? chunkSize + : (input.getLength() - (long) i * chunkSize); + ++chunkIdx; + } + } + assert chunkIdx == inputChunkAddrs.length; + assert chunkIdx == inputChunkSizes.length; + + // setup output addresses + chunkIdx = 0; + for (DeviceMemoryBuffer buffer : compressedBuffers.getArray()) { + assert buffer.getLength() % maxOutputChunkSize == 0; + long numChunksInBuffer = buffer.getLength() / maxOutputChunkSize; + long baseAddr = buffer.getAddress(); + for (int i = 0; i < numChunksInBuffer; i++) { + outputChunkAddrs[chunkIdx++] = baseAddr + i * maxOutputChunkSize; + } + } + assert chunkIdx == outputChunkAddrs.length; + } + + // Write input addresses, output addresses and sizes contiguously into a DeviceMemoryBuffer. + private DeviceMemoryBuffer putAddrsAndSizesOnDevice(long[] inputAddrs, long[] inputSizes, + long[] outputAddrs, Cuda.Stream stream) { + final long totalSize = inputAddrs.length * 8L * 3; // space for input, output, and size arrays + final long outputAddrsOffset = inputAddrs.length * 8L; + final long sizesOffset = outputAddrsOffset + inputAddrs.length * 8L; + try (NvtxRange range = new NvtxRange("putAddrsAndSizesOnDevice", NvtxColor.YELLOW)) { + try (HostMemoryBuffer hostbuf = HostMemoryBuffer.allocate(totalSize); + DeviceMemoryBuffer result = DeviceMemoryBuffer.allocate(totalSize)) { + hostbuf.setLongs(0, inputAddrs, 0, inputAddrs.length); + hostbuf.setLongs(outputAddrsOffset, outputAddrs, 0, outputAddrs.length); + for (int i = 0; i < inputSizes.length; i++) { + hostbuf.setLong(sizesOffset + i * 8L, inputSizes[i]); + } + result.copyFromHostBuffer(hostbuf, stream); + result.incRefCount(); + return result; + } + } + } + + // Synchronously copy the resulting compressed sizes from device memory to host memory. + private long[] getOutputChunkSizes(BaseDeviceMemoryBuffer devChunkSizes, Cuda.Stream stream) { + try (NvtxRange range = new NvtxRange("getOutputChunkSizes", NvtxColor.YELLOW)) { + try (HostMemoryBuffer hostbuf = HostMemoryBuffer.allocate(devChunkSizes.getLength())) { + hostbuf.copyFromDeviceBuffer(devChunkSizes, stream); + int numChunks = (int) (devChunkSizes.getLength() / 8); + long[] result = new long[numChunks]; + for (int i = 0; i < numChunks; i++) { + long size = hostbuf.getLong(i * 8L); + assert size < Integer.MAX_VALUE : "output size is too big"; + result[i] = size; + } + return result; + } + } + } + + // Stitch together the individual chunks into the result buffers. + // Each result buffer has metadata at the beginning, followed by compressed chunks. + // This is done by building up parallel lists of source addr, dest addr and size and + // then calling multiBufferCopyAsync() + private DeviceMemoryBuffer[] stitchOutput(int[] chunksPerInput, + DeviceMemoryBuffer compressedChunkSizes, long[] outputChunkAddrs, + long[] outputChunkSizes, Cuda.Stream stream) { + try (NvtxRange range = new NvtxRange("stitchOutput", NvtxColor.YELLOW)) { + final int numOutputs = chunksPerInput.length; + final long chunkSizesAddr = compressedChunkSizes.getAddress(); + long[] outputBufferSizes = calcOutputBufferSizes(chunksPerInput, outputChunkSizes); + try (CloseableArray outputs = + CloseableArray.wrap(new DeviceMemoryBuffer[numOutputs])) { + // Each chunk needs to be copied, and each output needs a copy of the + // compressed chunk size vector representing the metadata. + final int totalBuffersToCopy = numOutputs + outputChunkAddrs.length; + long[] destAddrs = new long[totalBuffersToCopy]; + long[] srcAddrs = new long[totalBuffersToCopy]; + long[] sizes = new long[totalBuffersToCopy]; + int copyBufferIdx = 0; + int chunkIdx = 0; + for (int outputIdx = 0; outputIdx < numOutputs; outputIdx++) { + DeviceMemoryBuffer outputBuffer = + DeviceMemoryBuffer.allocate(outputBufferSizes[outputIdx]); + outputs.set(outputIdx, outputBuffer); + final long outputBufferAddr = outputBuffer.getAddress(); + final long numChunks = chunksPerInput[outputIdx]; + final long metadataSize = numChunks * METADATA_BYTES_PER_CHUNK; + + // setup a copy of the metadata at the front of the output buffer + srcAddrs[copyBufferIdx] = chunkSizesAddr + chunkIdx * 8; + destAddrs[copyBufferIdx] = outputBufferAddr; + sizes[copyBufferIdx] = metadataSize; + ++copyBufferIdx; + + // setup copies of the compressed chunks for this output buffer + long nextChunkAddr = outputBufferAddr + metadataSize; + for (int i = 0; i < numChunks; ++i) { + srcAddrs[copyBufferIdx] = outputChunkAddrs[chunkIdx]; + destAddrs[copyBufferIdx] = nextChunkAddr; + final long chunkSize = outputChunkSizes[chunkIdx]; + sizes[copyBufferIdx] = chunkSize; + copyBufferIdx++; + chunkIdx++; + nextChunkAddr += chunkSize; + } + } + assert copyBufferIdx == totalBuffersToCopy; + assert chunkIdx == outputChunkAddrs.length; + assert chunkIdx == outputChunkSizes.length; + + Cuda.multiBufferCopyAsync(destAddrs, srcAddrs, sizes, stream); + return outputs.release(); + } + } + } + + // Calculate the sizes for each output buffer (metadata plus size of compressed chunks) + private long[] calcOutputBufferSizes(int[] chunksPerInput, long[] outputChunkSizes) { + long[] sizes = new long[chunksPerInput.length]; + int chunkIdx = 0; + for (int i = 0; i < sizes.length; i++) { + final int chunksInBuffer = chunksPerInput[i]; + final int chunkEndIdx = chunkIdx + chunksInBuffer; + // metadata stored in front of compressed data + long bufferSize = METADATA_BYTES_PER_CHUNK * chunksInBuffer; + // add in the compressed chunk sizes to get the total size + while (chunkIdx < chunkEndIdx) { + bufferSize += outputChunkSizes[chunkIdx++]; + } + sizes[i] = bufferSize; + } + assert chunkIdx == outputChunkSizes.length; + return sizes; + } + + /** + * Get the temporary workspace size required to perform compression of an entire batch. + * @param batchSize number of chunks in the batch + * @param maxChunkSize maximum size of an uncompressed chunk in bytes + * @return The size of required temporary workspace in bytes to compress the batch. + */ + protected abstract long batchedCompressGetTempSize(long batchSize, long maxChunkSize); + + /** + * Asynchronously compress a batch of buffers. Note that compressedSizesOutPtr must + * point to pinned memory for this operation to be asynchronous. + * @param devInPtrs device address of uncompressed buffer addresses vector + * @param devInSizes device address of uncompressed buffer sizes vector + * @param chunkSize maximum size of an uncompressed chunk in bytes + * @param batchSize number of chunks in the batch + * @param tempPtr device address of the temporary workspace buffer + * @param tempSize size of the temporary workspace buffer in bytes + * @param devOutPtrs device address of output buffer addresses vector + * @param compressedSizesOutPtr device address where to write the sizes of the + * compressed data written to the corresponding + * output buffers. Must point to a buffer with + * at least 8 bytes of memory per output buffer + * in the batch. + * @param stream CUDA stream to use + */ + protected abstract void batchedCompressAsync(long devInPtrs, long devInSizes, long chunkSize, + long batchSize, long tempPtr, long tempSize, long devOutPtrs, long compressedSizesOutPtr, + long stream); +} diff --git a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedDecompressor.java b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedDecompressor.java new file mode 100644 index 00000000000..5543d2dcb64 --- /dev/null +++ b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedDecompressor.java @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2024, NVIDIA CORPORATION. + * + * Licensed 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. + */ + +package ai.rapids.cudf.nvcomp; + +import ai.rapids.cudf.CloseableArray; +import ai.rapids.cudf.Cuda; +import ai.rapids.cudf.BaseDeviceMemoryBuffer; +import ai.rapids.cudf.DeviceMemoryBuffer; +import ai.rapids.cudf.HostMemoryBuffer; +import ai.rapids.cudf.NvtxColor; +import ai.rapids.cudf.NvtxRange; + +import java.util.Arrays; + +/** Decompressor that operates on multiple input buffers in a batch */ +public abstract class BatchedDecompressor { + + private final long chunkSize; + + /** + * Construct a batched decompressor instance + * @param chunkSize maximum uncompressed block size, must match value used + * during compression + */ + public BatchedDecompressor(long chunkSize) { + this.chunkSize = chunkSize; + } + + /** + * Asynchronously decompress a batch of buffers + * @param origInputs buffers to decompress, will be closed by this operation + * @param outputs output buffers that will contain the decompressed results, each must + * be sized to the exact decompressed size of the corresponding input + * @param stream CUDA stream to use + */ + public void decompressAsync(BaseDeviceMemoryBuffer[] origInputs, + BaseDeviceMemoryBuffer[] outputs, Cuda.Stream stream) { + try (CloseableArray inputs = + CloseableArray.wrap(Arrays.copyOf(origInputs, origInputs.length))) { + BatchedCompressor.validateChunkSize(chunkSize); + if (origInputs.length != outputs.length) { + throw new IllegalArgumentException("number of inputs must match number of outputs"); + } + final int numInputs = inputs.size(); + if (numInputs == 0) { + return; + } + + int[] chunksPerInput = new int[numInputs]; + long totalChunks = 0; + for (int i = 0; i < numInputs; i++) { + // use output size to determine number of chunks in the input, as the output buffer + // must be exactly sized to the uncompressed data + BaseDeviceMemoryBuffer buffer = outputs[i]; + int numBufferChunks = getNumChunksInBuffer(chunkSize, buffer); + chunksPerInput[i] = numBufferChunks; + totalChunks += numBufferChunks; + } + + final long tempBufferSize = batchedDecompressGetTempSize(totalChunks, chunkSize); + try (DeviceMemoryBuffer devAddrsSizes = buildAddrsSizesBuffer(chunkSize, totalChunks, + inputs.getArray(), chunksPerInput, outputs, stream); + DeviceMemoryBuffer devTemp = DeviceMemoryBuffer.allocate(tempBufferSize)) { + // buffer containing addresses and sizes contains four vectors of longs in this order: + // - compressed chunk input addresses + // - chunk output buffer addresses + // - compressed chunk sizes + // - uncompressed chunk sizes + final long inputAddrsPtr = devAddrsSizes.getAddress(); + final long outputAddrsPtr = inputAddrsPtr + totalChunks * 8; + final long inputSizesPtr = outputAddrsPtr + totalChunks * 8; + final long outputSizesPtr = inputSizesPtr + totalChunks * 8; + batchedDecompressAsync(inputAddrsPtr, inputSizesPtr, outputSizesPtr, totalChunks, + devTemp.getAddress(), devTemp.getLength(), outputAddrsPtr, stream.getStream()); + } + } + } + + private static int getNumChunksInBuffer(long chunkSize, BaseDeviceMemoryBuffer buffer) { + return (int) ((buffer.getLength() + chunkSize - 1) / chunkSize); + } + + /** + * Build a device memory buffer containing four vectors of longs in the following order: + *
    + *
  • compressed chunk input addresses
  • + *
  • uncompressed chunk output addresses
  • + *
  • compressed chunk sizes
  • + *
  • uncompressed chunk sizes
  • + *
+ * Each vector contains as many longs as the number of chunks being decompressed + * @param chunkSize maximum uncompressed size of a chunk + * @param totalChunks total number of chunks to be decompressed + * @param inputs device buffers containing the compressed data + * @param chunksPerInput number of compressed chunks per input buffer + * @param outputs device buffers that will hold the uncompressed output + * @param stream CUDA stream to use + * @return device buffer containing address and size vectors + */ + private static DeviceMemoryBuffer buildAddrsSizesBuffer(long chunkSize, long totalChunks, + BaseDeviceMemoryBuffer[] inputs, int[] chunksPerInput, BaseDeviceMemoryBuffer[] outputs, + Cuda.Stream stream) { + final long totalBufferSize = totalChunks * 8L * 4L; + try (NvtxRange range = new NvtxRange("buildAddrSizesBuffer", NvtxColor.YELLOW)) { + try (HostMemoryBuffer metadata = fetchMetadata(totalChunks, inputs, chunksPerInput, stream); + HostMemoryBuffer hostAddrsSizes = HostMemoryBuffer.allocate(totalBufferSize); + DeviceMemoryBuffer devAddrsSizes = DeviceMemoryBuffer.allocate(totalBufferSize)) { + // Build four long vectors in the AddrsSizes buffer: + // - compressed input address (one per chunk) + // - uncompressed output address (one per chunk) + // - compressed input size (one per chunk) + // - uncompressed input size (one per chunk) + final long srcAddrsOffset = 0; + final long destAddrsOffset = srcAddrsOffset + totalChunks * 8L; + final long srcSizesOffset = destAddrsOffset + totalChunks * 8L; + final long destSizesOffset = srcSizesOffset + totalChunks * 8L; + long chunkIdx = 0; + for (int inputIdx = 0; inputIdx < inputs.length; inputIdx++) { + final BaseDeviceMemoryBuffer input = inputs[inputIdx]; + final BaseDeviceMemoryBuffer output = outputs[inputIdx]; + final int numChunksInInput = chunksPerInput[inputIdx]; + long srcAddr = input.getAddress() + + BatchedCompressor.METADATA_BYTES_PER_CHUNK * numChunksInInput; + long destAddr = output.getAddress(); + final long chunkIdxEnd = chunkIdx + numChunksInInput; + while (chunkIdx < chunkIdxEnd) { + final long srcChunkSize = metadata.getLong(chunkIdx * 8); + final long destChunkSize = (chunkIdx < chunkIdxEnd - 1) ? chunkSize + : output.getAddress() + output.getLength() - destAddr; + hostAddrsSizes.setLong(srcAddrsOffset + chunkIdx * 8, srcAddr); + hostAddrsSizes.setLong(destAddrsOffset + chunkIdx * 8, destAddr); + hostAddrsSizes.setLong(srcSizesOffset + chunkIdx * 8, srcChunkSize); + hostAddrsSizes.setLong(destSizesOffset + chunkIdx * 8, destChunkSize); + srcAddr += srcChunkSize; + destAddr += destChunkSize; + ++chunkIdx; + } + } + devAddrsSizes.copyFromHostBuffer(hostAddrsSizes, stream); + devAddrsSizes.incRefCount(); + return devAddrsSizes; + } + } + } + + /** + * Fetch the metadata at the front of each input in a single, contiguous host buffer. + * @param totalChunks total number of compressed chunks + * @param inputs buffers containing the compressed data + * @param chunksPerInput number of compressed chunks for the corresponding input + * @param stream CUDA stream to use + * @return host buffer containing all of the metadata + */ + private static HostMemoryBuffer fetchMetadata(long totalChunks, BaseDeviceMemoryBuffer[] inputs, + int[] chunksPerInput, Cuda.Stream stream) { + try (NvtxRange range = new NvtxRange("fetchMetadata", NvtxColor.PURPLE)) { + // one long per chunk containing the compressed size + final long totalMetadataSize = totalChunks * BatchedCompressor.METADATA_BYTES_PER_CHUNK; + // Build corresponding vectors of destination addresses, source addresses and sizes. + long[] destAddrs = new long[inputs.length]; + long[] srcAddrs = new long[inputs.length]; + long[] sizes = new long[inputs.length]; + try (HostMemoryBuffer hostMetadata = HostMemoryBuffer.allocate(totalMetadataSize); + DeviceMemoryBuffer devMetadata = DeviceMemoryBuffer.allocate(totalMetadataSize)) { + long destCopyAddr = devMetadata.getAddress(); + for (int inputIdx = 0; inputIdx < inputs.length; inputIdx++) { + final BaseDeviceMemoryBuffer input = inputs[inputIdx]; + final long copySize = + chunksPerInput[inputIdx] * BatchedCompressor.METADATA_BYTES_PER_CHUNK; + destAddrs[inputIdx] = destCopyAddr; + srcAddrs[inputIdx] = input.getAddress(); + sizes[inputIdx] = copySize; + destCopyAddr += copySize; + } + Cuda.multiBufferCopyAsync(destAddrs, srcAddrs, sizes, stream); + hostMetadata.copyFromDeviceBuffer(devMetadata, stream); + hostMetadata.incRefCount(); + return hostMetadata; + } + } + } + + /** + * Computes the temporary storage size in bytes needed to decompress a compressed batch. + * @param numChunks number of chunks in the batch + * @param maxUncompressedChunkBytes maximum uncompressed size of any chunk in bytes + * @return number of temporary storage bytes needed to decompress the batch + */ + protected abstract long batchedDecompressGetTempSize(long numChunks, + long maxUncompressedChunkBytes); + + /** + * Asynchronously decompress a batch of compressed data buffers. + * @param devInPtrs device address of compressed input buffer addresses vector + * @param devInSizes device address of compressed input buffer sizes vector + * @param devOutSizes device address of uncompressed buffer sizes vector + * @param batchSize number of buffers in the batch + * @param tempPtr device address of the temporary decompression space + * @param tempSize size of the temporary decompression space in bytes + * @param devOutPtrs device address of uncompressed output buffer addresses vector + * @param stream CUDA stream to use + */ + protected abstract void batchedDecompressAsync(long devInPtrs, long devInSizes, + long devOutSizes, long batchSize, long tempPtr, long tempSize, long devOutPtrs, + long stream); +} diff --git a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Compressor.java b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Compressor.java index 1aa7e5e11a0..58c0e7ee169 100644 --- a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Compressor.java +++ b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Compressor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,305 +16,31 @@ package ai.rapids.cudf.nvcomp; -import ai.rapids.cudf.BaseDeviceMemoryBuffer; -import ai.rapids.cudf.CloseableArray; -import ai.rapids.cudf.Cuda; -import ai.rapids.cudf.DefaultHostMemoryAllocator; -import ai.rapids.cudf.DeviceMemoryBuffer; -import ai.rapids.cudf.HostMemoryAllocator; -import ai.rapids.cudf.HostMemoryBuffer; -import ai.rapids.cudf.MemoryBuffer; -import ai.rapids.cudf.NvtxColor; -import ai.rapids.cudf.NvtxRange; - /** Multi-buffer LZ4 compressor */ -public class BatchedLZ4Compressor { - private static final HostMemoryAllocator hostMemoryAllocator = DefaultHostMemoryAllocator.get(); - - static final long MAX_CHUNK_SIZE = 16777216; // in bytes - // each chunk has a 64-bit integer value as metadata containing the compressed size - static final long METADATA_BYTES_PER_CHUNK = 8; - - private final long chunkSize; - private final long targetIntermediateBufferSize; - private final long maxOutputChunkSize; +public class BatchedLZ4Compressor extends BatchedCompressor { /** * Construct a batched LZ4 compressor instance - * @param chunkSize maximum amount of uncompressed data to compress as a single chunk. Inputs - * larger than this will be compressed in multiple chunks. - * @param targetIntermediateBufferSize desired maximum size of intermediate device buffers - * used during compression. - */ - public BatchedLZ4Compressor(long chunkSize, long targetIntermediateBufferSize) { - validateChunkSize(chunkSize); - this.chunkSize = chunkSize; - this.maxOutputChunkSize = NvcompJni.batchedLZ4CompressGetMaxOutputChunkSize(chunkSize); - assert maxOutputChunkSize < Integer.MAX_VALUE; - this.targetIntermediateBufferSize = Math.max(targetIntermediateBufferSize, maxOutputChunkSize); - } - - /** - * Compress a batch of buffers with LZ4. The input buffers will be closed. - * @param origInputs buffers to compress - * @param stream CUDA stream to use - * @return compressed buffers corresponding to the input buffers + * @param chunkSize maximum amount of uncompressed data to compress as a single chunk. + * Inputs larger than this will be compressed in multiple chunks. + * @param maxIntermediateBufferSize desired maximum size of intermediate device buffers + * used during compression. */ - public DeviceMemoryBuffer[] compress(BaseDeviceMemoryBuffer[] origInputs, Cuda.Stream stream) { - try (CloseableArray inputs = CloseableArray.wrap(origInputs)) { - if (chunkSize <= 0) { - throw new IllegalArgumentException("Illegal chunk size: " + chunkSize); - } - final int numInputs = inputs.size(); - if (numInputs == 0) { - return new DeviceMemoryBuffer[0]; - } - - // Each buffer is broken up into chunkSize chunks for compression. Calculate how many - // chunks are needed for each input buffer. - int[] chunksPerInput = new int[numInputs]; - int numChunks = 0; - for (int i = 0; i < numInputs; i++) { - BaseDeviceMemoryBuffer buffer = inputs.get(i); - int numBufferChunks = getNumChunksInBuffer(buffer); - chunksPerInput[i] = numBufferChunks; - numChunks += numBufferChunks; - } - - // Allocate buffers for each chunk and generate parallel lists of chunk source addresses, - // chunk destination addresses, and sizes. - try (CloseableArray compressedBuffers = - allocCompressedBuffers(numChunks, stream); - DeviceMemoryBuffer compressedChunkSizes = - DeviceMemoryBuffer.allocate(numChunks * 8L, stream)) { - long[] inputChunkAddrs = new long[numChunks]; - long[] inputChunkSizes = new long[numChunks]; - long[] outputChunkAddrs = new long[numChunks]; - buildAddrsAndSizes(inputs, inputChunkAddrs, inputChunkSizes, - compressedBuffers, outputChunkAddrs); - - long[] outputChunkSizes; - final long tempBufferSize = NvcompJni.batchedLZ4CompressGetTempSize(numChunks, chunkSize); - try (DeviceMemoryBuffer addrsAndSizes = - putAddrsAndSizesOnDevice(inputChunkAddrs, inputChunkSizes, outputChunkAddrs, stream); - DeviceMemoryBuffer tempBuffer = DeviceMemoryBuffer.allocate(tempBufferSize, stream)) { - final long devOutputAddrsPtr = addrsAndSizes.getAddress() + numChunks * 8L; - final long devInputSizesPtr = devOutputAddrsPtr + numChunks * 8L; - NvcompJni.batchedLZ4CompressAsync( - addrsAndSizes.getAddress(), - devInputSizesPtr, - chunkSize, - numChunks, - tempBuffer.getAddress(), - tempBufferSize, - devOutputAddrsPtr, - compressedChunkSizes.getAddress(), - stream.getStream()); - } - - // Synchronously copy the resulting compressed sizes per chunk. - outputChunkSizes = getOutputChunkSizes(compressedChunkSizes, stream); - - // inputs are no longer needed at this point, so free them early - inputs.close(); - - // Combine compressed chunks into output buffers corresponding to each original input - return stitchOutput(chunksPerInput, compressedChunkSizes, outputChunkAddrs, - outputChunkSizes, stream); - } - } - } - - static void validateChunkSize(long chunkSize) { - if (chunkSize <= 0 || chunkSize > MAX_CHUNK_SIZE) { - throw new IllegalArgumentException("Invalid chunk size: " + chunkSize + " Max chunk size is: " - + MAX_CHUNK_SIZE + " bytes"); - } + public BatchedLZ4Compressor(long chunkSize, long maxIntermediateBufferSize) { + super(chunkSize, NvcompJni.batchedLZ4CompressGetMaxOutputChunkSize(chunkSize), + maxIntermediateBufferSize); } - private static long ceilingDivide(long x, long y) { - return (x + y - 1) / y; - } - - private int getNumChunksInBuffer(MemoryBuffer buffer) { - return (int) ceilingDivide(buffer.getLength(), chunkSize); - } - - private CloseableArray allocCompressedBuffers(long numChunks, - Cuda.Stream stream) { - final long chunksPerBuffer = targetIntermediateBufferSize / maxOutputChunkSize; - final long numBuffers = ceilingDivide(numChunks, chunksPerBuffer); - if (numBuffers > Integer.MAX_VALUE) { - throw new IllegalStateException("Too many chunks"); - } - try (NvtxRange range = new NvtxRange("allocCompressedBuffers", NvtxColor.YELLOW)) { - CloseableArray buffers = CloseableArray.wrap( - new DeviceMemoryBuffer[(int) numBuffers]); - try { - // allocate all of the max-chunks intermediate compressed buffers - for (int i = 0; i < buffers.size() - 1; ++i) { - buffers.set(i, DeviceMemoryBuffer.allocate(chunksPerBuffer * maxOutputChunkSize, stream)); - } - // allocate the tail intermediate compressed buffer that may be smaller than the others - buffers.set(buffers.size() - 1, DeviceMemoryBuffer.allocate( - (numChunks - chunksPerBuffer * (buffers.size() - 1)) * maxOutputChunkSize, stream)); - return buffers; - } catch (Exception e) { - buffers.close(e); - throw e; - } - } - } - - // Fill in the inputChunkAddrs, inputChunkSizes, and outputChunkAddrs arrays to point - // into the chunks in the input and output buffers. - private void buildAddrsAndSizes(CloseableArray inputs, - long[] inputChunkAddrs, - long[] inputChunkSizes, - CloseableArray compressedBuffers, - long[] outputChunkAddrs) { - // setup the input addresses and sizes - int chunkIdx = 0; - for (BaseDeviceMemoryBuffer input : inputs.getArray()) { - final int numChunksInBuffer = getNumChunksInBuffer(input); - for (int i = 0; i < numChunksInBuffer; i++) { - inputChunkAddrs[chunkIdx] = input.getAddress() + i * chunkSize; - inputChunkSizes[chunkIdx] = (i != numChunksInBuffer - 1) ? chunkSize - : (input.getLength() - (long) i * chunkSize); - ++chunkIdx; - } - } - assert chunkIdx == inputChunkAddrs.length; - assert chunkIdx == inputChunkSizes.length; - - // setup output addresses - chunkIdx = 0; - for (DeviceMemoryBuffer buffer : compressedBuffers.getArray()) { - assert buffer.getLength() % maxOutputChunkSize == 0; - long numChunksInBuffer = buffer.getLength() / maxOutputChunkSize; - long baseAddr = buffer.getAddress(); - for (int i = 0; i < numChunksInBuffer; i++) { - outputChunkAddrs[chunkIdx++] = baseAddr + i * maxOutputChunkSize; - } - } - assert chunkIdx == outputChunkAddrs.length; - } - - // Write input addresses, output addresses and sizes contiguously into a DeviceMemoryBuffer. - private DeviceMemoryBuffer putAddrsAndSizesOnDevice(long[] inputAddrs, - long[] inputSizes, - long[] outputAddrs, - Cuda.Stream stream) { - final long totalSize = inputAddrs.length * 8L * 3; // space for input, output, and size arrays - final long outputAddrsOffset = inputAddrs.length * 8L; - final long sizesOffset = outputAddrsOffset + inputAddrs.length * 8L; - try (NvtxRange range = new NvtxRange("putAddrsAndSizesOnDevice", NvtxColor.YELLOW)) { - try (HostMemoryBuffer hostbuf = hostMemoryAllocator.allocate(totalSize); - DeviceMemoryBuffer result = DeviceMemoryBuffer.allocate(totalSize)) { - hostbuf.setLongs(0, inputAddrs, 0, inputAddrs.length); - hostbuf.setLongs(outputAddrsOffset, outputAddrs, 0, outputAddrs.length); - for (int i = 0; i < inputSizes.length; i++) { - hostbuf.setLong(sizesOffset + i * 8L, inputSizes[i]); - } - result.copyFromHostBuffer(hostbuf, stream); - result.incRefCount(); - return result; - } - } - } - - // Synchronously copy the resulting compressed sizes from device memory to host memory. - private long[] getOutputChunkSizes(BaseDeviceMemoryBuffer devChunkSizes, Cuda.Stream stream) { - try (NvtxRange range = new NvtxRange("getOutputChunkSizes", NvtxColor.YELLOW)) { - try (HostMemoryBuffer hostbuf = hostMemoryAllocator.allocate(devChunkSizes.getLength())) { - hostbuf.copyFromDeviceBuffer(devChunkSizes, stream); - int numChunks = (int) (devChunkSizes.getLength() / 8); - long[] result = new long[numChunks]; - for (int i = 0; i < numChunks; i++) { - long size = hostbuf.getLong(i * 8L); - assert size < Integer.MAX_VALUE : "output size is too big"; - result[i] = size; - } - return result; - } - } - } - - // Stitch together the individual chunks into the result buffers. - // Each result buffer has metadata at the beginning, followed by compressed chunks. - // This is done by building up parallel lists of source addr, dest addr and size and - // then calling multiBufferCopyAsync() - private DeviceMemoryBuffer[] stitchOutput(int[] chunksPerInput, - DeviceMemoryBuffer compressedChunkSizes, - long[] outputChunkAddrs, - long[] outputChunkSizes, - Cuda.Stream stream) { - try (NvtxRange range = new NvtxRange("stitchOutput", NvtxColor.YELLOW)) { - final int numOutputs = chunksPerInput.length; - final long chunkSizesAddr = compressedChunkSizes.getAddress(); - long[] outputBufferSizes = calcOutputBufferSizes(chunksPerInput, outputChunkSizes); - try (CloseableArray outputs = - CloseableArray.wrap(new DeviceMemoryBuffer[numOutputs])) { - // Each chunk needs to be copied, and each output needs a copy of the - // compressed chunk size vector representing the metadata. - final int totalBuffersToCopy = numOutputs + outputChunkAddrs.length; - long[] destAddrs = new long[totalBuffersToCopy]; - long[] srcAddrs = new long[totalBuffersToCopy]; - long[] sizes = new long[totalBuffersToCopy]; - int copyBufferIdx = 0; - int chunkIdx = 0; - for (int outputIdx = 0; outputIdx < numOutputs; outputIdx++) { - DeviceMemoryBuffer outputBuffer = DeviceMemoryBuffer.allocate(outputBufferSizes[outputIdx]); - final long outputBufferAddr = outputBuffer.getAddress(); - outputs.set(outputIdx, outputBuffer); - final long numChunks = chunksPerInput[outputIdx]; - final long metadataSize = numChunks * METADATA_BYTES_PER_CHUNK; - - // setup a copy of the metadata at the front of the output buffer - srcAddrs[copyBufferIdx] = chunkSizesAddr + chunkIdx * 8; - destAddrs[copyBufferIdx] = outputBufferAddr; - sizes[copyBufferIdx] = metadataSize; - ++copyBufferIdx; - - // setup copies of the compressed chunks for this output buffer - long nextChunkAddr = outputBufferAddr + metadataSize; - for (int i = 0; i < numChunks; ++i) { - srcAddrs[copyBufferIdx] = outputChunkAddrs[chunkIdx]; - destAddrs[copyBufferIdx] = nextChunkAddr; - final long chunkSize = outputChunkSizes[chunkIdx]; - sizes[copyBufferIdx] = chunkSize; - copyBufferIdx++; - chunkIdx++; - nextChunkAddr += chunkSize; - } - } - assert copyBufferIdx == totalBuffersToCopy; - assert chunkIdx == outputChunkAddrs.length; - assert chunkIdx == outputChunkSizes.length; - - Cuda.multiBufferCopyAsync(destAddrs, srcAddrs, sizes, stream); - return outputs.release(); - } - } + @Override + protected long batchedCompressGetTempSize(long batchSize, long maxChunkSize) { + return NvcompJni.batchedLZ4CompressGetTempSize(batchSize, maxChunkSize); } - // Calculate the list of sizes for each output buffer (metadata plus size of compressed chunks) - private long[] calcOutputBufferSizes(int[] chunksPerInput, - long[] outputChunkSizes) { - long[] sizes = new long[chunksPerInput.length]; - int chunkIdx = 0; - for (int i = 0; i < sizes.length; i++) { - final int chunksInBuffer = chunksPerInput[i]; - final int chunkEndIdx = chunkIdx + chunksInBuffer; - // metadata stored in front of compressed data - long bufferSize = METADATA_BYTES_PER_CHUNK * chunksInBuffer; - // add in the compressed chunk sizes to get the total size - while (chunkIdx < chunkEndIdx) { - bufferSize += outputChunkSizes[chunkIdx++]; - } - sizes[i] = bufferSize; - } - assert chunkIdx == outputChunkSizes.length; - return sizes; + @Override + protected void batchedCompressAsync(long devInPtrs, long devInSizes, long chunkSize, + long batchSize, long tempPtr, long tempSize, long devOutPtrs, + long compressedSizesOutPtr, long stream) { + NvcompJni.batchedLZ4CompressAsync(devInPtrs, devInSizes, chunkSize, batchSize, + tempPtr, tempSize, devOutPtrs, compressedSizesOutPtr, stream); } } diff --git a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Decompressor.java b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Decompressor.java index 40ad4d5e9ed..d78d537ea13 100644 --- a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Decompressor.java +++ b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedLZ4Decompressor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,18 +16,15 @@ package ai.rapids.cudf.nvcomp; -import ai.rapids.cudf.CloseableArray; import ai.rapids.cudf.Cuda; import ai.rapids.cudf.BaseDeviceMemoryBuffer; -import ai.rapids.cudf.DeviceMemoryBuffer; -import ai.rapids.cudf.HostMemoryBuffer; -import ai.rapids.cudf.NvtxColor; -import ai.rapids.cudf.NvtxRange; - -import java.util.Arrays; /** LZ4 decompressor that operates on multiple input buffers in a batch */ -public class BatchedLZ4Decompressor { +public class BatchedLZ4Decompressor extends BatchedDecompressor { + public BatchedLZ4Decompressor(long chunkSize) { + super(chunkSize); + } + /** * Asynchronously decompress a batch of buffers * @param chunkSize maximum uncompressed block size, must match value used during compression @@ -35,165 +32,24 @@ public class BatchedLZ4Decompressor { * @param outputs output buffers that will contain the compressed results, each must be sized * to the exact decompressed size of the corresponding input * @param stream CUDA stream to use + * + * Deprecated: Use the non-static version in the parent class instead. */ - public static void decompressAsync(long chunkSize, - BaseDeviceMemoryBuffer[] origInputs, - BaseDeviceMemoryBuffer[] outputs, - Cuda.Stream stream) { - try (CloseableArray inputs = - CloseableArray.wrap(Arrays.copyOf(origInputs, origInputs.length))) { - BatchedLZ4Compressor.validateChunkSize(chunkSize); - if (origInputs.length != outputs.length) { - throw new IllegalArgumentException("number of inputs must match number of outputs"); - } - final int numInputs = inputs.size(); - if (numInputs == 0) { - return; - } - - int[] chunksPerInput = new int[numInputs]; - long totalChunks = 0; - for (int i = 0; i < numInputs; i++) { - // use output size to determine number of chunks in the input, as the output buffer - // must be exactly sized to the uncompressed data - BaseDeviceMemoryBuffer buffer = outputs[i]; - int numBufferChunks = getNumChunksInBuffer(chunkSize, buffer); - chunksPerInput[i] = numBufferChunks; - totalChunks += numBufferChunks; - } - - final long tempBufferSize = NvcompJni.batchedLZ4DecompressGetTempSize(totalChunks, chunkSize); - try (DeviceMemoryBuffer devAddrsSizes = - buildAddrsSizesBuffer(chunkSize, totalChunks, inputs.getArray(), chunksPerInput, - outputs, stream); - DeviceMemoryBuffer devTemp = DeviceMemoryBuffer.allocate(tempBufferSize)) { - // buffer containing addresses and sizes contains four vectors of longs in this order: - // - compressed chunk input addresses - // - chunk output buffer addresses - // - compressed chunk sizes - // - uncompressed chunk sizes - final long inputAddrsPtr = devAddrsSizes.getAddress(); - final long outputAddrsPtr = inputAddrsPtr + totalChunks * 8; - final long inputSizesPtr = outputAddrsPtr + totalChunks * 8; - final long outputSizesPtr = inputSizesPtr + totalChunks * 8; - NvcompJni.batchedLZ4DecompressAsync( - inputAddrsPtr, - inputSizesPtr, - outputSizesPtr, - totalChunks, - devTemp.getAddress(), - devTemp.getLength(), - outputAddrsPtr, - stream.getStream()); - } - } + public static void decompressAsync(long chunkSize, BaseDeviceMemoryBuffer[] origInputs, + BaseDeviceMemoryBuffer[] outputs, Cuda.Stream stream) { + new BatchedLZ4Decompressor(chunkSize).decompressAsync(origInputs, outputs, stream); } - private static int getNumChunksInBuffer(long chunkSize, BaseDeviceMemoryBuffer buffer) { - return (int) ((buffer.getLength() + chunkSize - 1) / chunkSize); + @Override + protected long batchedDecompressGetTempSize(long numChunks, long maxUncompressedChunkBytes) { + return NvcompJni.batchedLZ4DecompressGetTempSize(numChunks, maxUncompressedChunkBytes); } - /** - * Build a device memory buffer containing four vectors of longs in the following order: - *
    - *
  • compressed chunk input addresses
  • - *
  • uncompressed chunk output addresses
  • - *
  • compressed chunk sizes
  • - *
  • uncompressed chunk sizes
  • - *
- * Each vector contains as many longs as the number of chunks being decompressed - * @param chunkSize maximum uncompressed size of a chunk - * @param totalChunks total number of chunks to be decompressed - * @param inputs device buffers containing the compressed data - * @param chunksPerInput number of compressed chunks per input buffer - * @param outputs device buffers that will hold the uncompressed output - * @param stream CUDA stream to use - * @return device buffer containing address and size vectors - */ - private static DeviceMemoryBuffer buildAddrsSizesBuffer(long chunkSize, - long totalChunks, - BaseDeviceMemoryBuffer[] inputs, - int[] chunksPerInput, - BaseDeviceMemoryBuffer[] outputs, - Cuda.Stream stream) { - final long totalBufferSize = totalChunks * 8L * 4L; - try (NvtxRange range = new NvtxRange("buildAddrSizesBuffer", NvtxColor.YELLOW)) { - try (HostMemoryBuffer metadata = fetchMetadata(totalChunks, inputs, chunksPerInput, stream); - HostMemoryBuffer hostAddrsSizes = HostMemoryBuffer.allocate(totalBufferSize); - DeviceMemoryBuffer devAddrsSizes = DeviceMemoryBuffer.allocate(totalBufferSize)) { - // Build four long vectors in the AddrsSizes buffer: - // - compressed input address (one per chunk) - // - uncompressed output address (one per chunk) - // - compressed input size (one per chunk) - // - uncompressed input size (one per chunk) - final long srcAddrsOffset = 0; - final long destAddrsOffset = srcAddrsOffset + totalChunks * 8L; - final long srcSizesOffset = destAddrsOffset + totalChunks * 8L; - final long destSizesOffset = srcSizesOffset + totalChunks * 8L; - long chunkIdx = 0; - for (int inputIdx = 0; inputIdx < inputs.length; inputIdx++) { - final BaseDeviceMemoryBuffer input = inputs[inputIdx]; - final BaseDeviceMemoryBuffer output = outputs[inputIdx]; - final int numChunksInInput = chunksPerInput[inputIdx]; - long srcAddr = input.getAddress() + - BatchedLZ4Compressor.METADATA_BYTES_PER_CHUNK * numChunksInInput; - long destAddr = output.getAddress(); - final long chunkIdxEnd = chunkIdx + numChunksInInput; - while (chunkIdx < chunkIdxEnd) { - final long srcChunkSize = metadata.getLong(chunkIdx * 8); - final long destChunkSize = (chunkIdx < chunkIdxEnd - 1) ? chunkSize - : output.getAddress() + output.getLength() - destAddr; - hostAddrsSizes.setLong(srcAddrsOffset + chunkIdx * 8, srcAddr); - hostAddrsSizes.setLong(destAddrsOffset + chunkIdx * 8, destAddr); - hostAddrsSizes.setLong(srcSizesOffset + chunkIdx * 8, srcChunkSize); - hostAddrsSizes.setLong(destSizesOffset + chunkIdx * 8, destChunkSize); - srcAddr += srcChunkSize; - destAddr += destChunkSize; - ++chunkIdx; - } - } - devAddrsSizes.copyFromHostBuffer(hostAddrsSizes, stream); - devAddrsSizes.incRefCount(); - return devAddrsSizes; - } - } + @Override + protected void batchedDecompressAsync(long devInPtrs, long devInSizes, long devOutSizes, + long batchSize, long tempPtr, long tempSize, long devOutPtrs, long stream) { + NvcompJni.batchedLZ4DecompressAsync(devInPtrs, devInSizes, devOutSizes, batchSize, tempPtr, + tempSize, devOutPtrs, stream); } - /** - * Fetch the metadata at the front of each input in a single, contiguous host buffer. - * @param totalChunks total number of compressed chunks - * @param inputs buffers containing the compressed data - * @param chunksPerInput number of compressed chunks for the corresponding input - * @param stream CUDA stream to use - * @return host buffer containing all of the metadata - */ - private static HostMemoryBuffer fetchMetadata(long totalChunks, - BaseDeviceMemoryBuffer[] inputs, - int[] chunksPerInput, - Cuda.Stream stream) { - try (NvtxRange range = new NvtxRange("fetchMetadata", NvtxColor.PURPLE)) { - // one long per chunk containing the compressed size - final long totalMetadataSize = totalChunks * BatchedLZ4Compressor.METADATA_BYTES_PER_CHUNK; - // Build corresponding vectors of destination addresses, source addresses and sizes. - long[] destAddrs = new long[inputs.length]; - long[] srcAddrs = new long[inputs.length]; - long[] sizes = new long[inputs.length]; - try (HostMemoryBuffer hostMetadata = HostMemoryBuffer.allocate(totalMetadataSize); - DeviceMemoryBuffer devMetadata = DeviceMemoryBuffer.allocate(totalMetadataSize)) { - long destCopyAddr = devMetadata.getAddress(); - for (int inputIdx = 0; inputIdx < inputs.length; inputIdx++) { - final BaseDeviceMemoryBuffer input = inputs[inputIdx]; - final long copySize = chunksPerInput[inputIdx] * BatchedLZ4Compressor.METADATA_BYTES_PER_CHUNK; - destAddrs[inputIdx] = destCopyAddr; - srcAddrs[inputIdx] = input.getAddress(); - sizes[inputIdx] = copySize; - destCopyAddr += copySize; - } - Cuda.multiBufferCopyAsync(destAddrs, srcAddrs, sizes, stream); - hostMetadata.copyFromDeviceBuffer(devMetadata, stream); - hostMetadata.incRefCount(); - return hostMetadata; - } - } - } } diff --git a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdCompressor.java b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdCompressor.java new file mode 100644 index 00000000000..0532b4aa86d --- /dev/null +++ b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdCompressor.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024, NVIDIA CORPORATION. + * + * Licensed 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. + */ + +package ai.rapids.cudf.nvcomp; + +/** Multi-buffer ZSTD compressor */ +public class BatchedZstdCompressor extends BatchedCompressor { + /** + * Construct a batched ZSTD compressor instance + * @param chunkSize maximum amount of uncompressed data to compress as a single chunk. + * Inputs larger than this will be compressed in multiple chunks. + * @param maxIntermediateBufferSize desired maximum size of intermediate device buffers + * used during compression. + */ + public BatchedZstdCompressor(long chunkSize, long maxIntermediateBufferSize) { + super(chunkSize, NvcompJni.batchedZstdCompressGetMaxOutputChunkSize(chunkSize), + maxIntermediateBufferSize); + } + + @Override + protected long batchedCompressGetTempSize(long batchSize, long maxChunkSize) { + return NvcompJni.batchedZstdCompressGetTempSize(batchSize, maxChunkSize); + } + + @Override + protected void batchedCompressAsync(long devInPtrs, long devInSizes, long chunkSize, + long batchSize, long tempPtr, long tempSize, long devOutPtrs, + long compressedSizesOutPtr, long stream) { + NvcompJni.batchedZstdCompressAsync(devInPtrs, devInSizes, chunkSize, batchSize, + tempPtr, tempSize, devOutPtrs, compressedSizesOutPtr, stream); + } +} diff --git a/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdDecompressor.java b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdDecompressor.java new file mode 100644 index 00000000000..ba11a236834 --- /dev/null +++ b/java/src/main/java/ai/rapids/cudf/nvcomp/BatchedZstdDecompressor.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024, NVIDIA CORPORATION. + * + * Licensed 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. + */ + +package ai.rapids.cudf.nvcomp; + +/** ZSTD decompressor that operates on multiple input buffers in a batch */ +public class BatchedZstdDecompressor extends BatchedDecompressor { + public BatchedZstdDecompressor(long chunkSize) { + super(chunkSize); + } + + @Override + protected long batchedDecompressGetTempSize(long numChunks, long maxUncompressedChunkBytes) { + return NvcompJni.batchedZstdDecompressGetTempSize(numChunks, maxUncompressedChunkBytes); + } + + @Override + protected void batchedDecompressAsync(long devInPtrs, long devInSizes, long devOutSizes, + long batchSize, long tempPtr, long tempSize, long devOutPtrs, long stream) { + NvcompJni.batchedZstdDecompressAsync(devInPtrs, devInSizes, devOutSizes, batchSize, tempPtr, + tempSize, devOutPtrs, stream); + } + +} diff --git a/java/src/main/java/ai/rapids/cudf/nvcomp/NvcompJni.java b/java/src/main/java/ai/rapids/cudf/nvcomp/NvcompJni.java index 57094008c08..1a21629a208 100644 --- a/java/src/main/java/ai/rapids/cudf/nvcomp/NvcompJni.java +++ b/java/src/main/java/ai/rapids/cudf/nvcomp/NvcompJni.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ class NvcompJni { NativeDepsLoader.loadNativeDeps(); } + // For lz4 /** * Get the temporary workspace size required to perform compression of entire LZ4 batch. * @param batchSize number of chunks in the batch @@ -114,4 +115,97 @@ static native void batchedLZ4GetDecompressSizeAsync( long devOutSizes, long batchSize, long stream); + + // For zstd + /** + * Get the temporary workspace size required to perform compression of entire zstd batch. + * @param batchSize number of chunks in the batch + * @param maxChunkSize maximum size of an uncompressed chunk in bytes + * @return The size of required temporary workspace in bytes to compress the batch. + */ + static native long batchedZstdCompressGetTempSize(long batchSize, long maxChunkSize); + + /** + * Get the maximum size any chunk could compress to in a ZSTD batch. This is the minimum + * amount of output memory to allocate per chunk when batch compressing. + * @param maxChunkSize maximum size of an uncompressed chunk size in bytes + * @return maximum compressed output size of a chunk + */ + static native long batchedZstdCompressGetMaxOutputChunkSize(long maxChunkSize); + + /** + * Asynchronously compress a batch of buffers with ZSTD. Note that + * compressedSizesOutPtr must point to pinned memory for this operation + * to be asynchronous. + * @param devInPtrs device address of uncompressed buffer addresses vector + * @param devInSizes device address of uncompressed buffer sizes vector + * @param chunkSize maximum size of an uncompressed chunk in bytes + * @param batchSize number of chunks in the batch + * @param tempPtr device address of the temporary workspace buffer + * @param tempSize size of the temporary workspace buffer in bytes + * @param devOutPtrs device address of output buffer addresses vector + * @param compressedSizesOutPtr device address where to write the sizes of the + * compressed data written to the corresponding + * output buffers. Must point to a buffer with + * at least 8 bytes of memory per output buffer + * in the batch. + * @param stream CUDA stream to use + */ + static native void batchedZstdCompressAsync( + long devInPtrs, + long devInSizes, + long chunkSize, + long batchSize, + long tempPtr, + long tempSize, + long devOutPtrs, + long compressedSizesOutPtr, + long stream); + + /** + * Computes the temporary storage size in bytes needed to decompress a + * ZSTD-compressed batch. + * @param numChunks number of chunks in the batch + * @param maxUncompressedChunkBytes maximum uncompressed size of any chunk in bytes + * @return number of temporary storage bytes needed to decompress the batch + */ + static native long batchedZstdDecompressGetTempSize( + long numChunks, + long maxUncompressedChunkBytes); + + /** + * Asynchronously decompress a batch of ZSTD-compressed data buffers. + * @param devInPtrs device address of compressed input buffer addresses vector + * @param devInSizes device address of compressed input buffer sizes vector + * @param devOutSizes device address of uncompressed buffer sizes vector + * @param batchSize number of buffers in the batch + * @param tempPtr device address of the temporary decompression space + * @param tempSize size of the temporary decompression space in bytes + * @param devOutPtrs device address of uncompressed output buffer addresses vector + * @param stream CUDA stream to use + */ + static native void batchedZstdDecompressAsync( + long devInPtrs, + long devInSizes, + long devOutSizes, + long batchSize, + long tempPtr, + long tempSize, + long devOutPtrs, + long stream); + + /** + * Asynchronously calculates the decompressed size needed for each chunk. + * @param devInPtrs device address of compressed input buffer addresses vector + * @param devInSizes device address of compressed input buffer sizes vector + * @param devOutSizes device address of calculated decompress sizes vector + * @param batchSize number of buffers in the batch + * @param stream CUDA stream to use + */ + static native void batchedZstdGetDecompressSizeAsync( + long devInPtrs, + long devInSizes, + long devOutSizes, + long batchSize, + long stream); } diff --git a/java/src/main/native/src/NvcompJni.cpp b/java/src/main/native/src/NvcompJni.cpp index 47a24653549..8937438e922 100644 --- a/java/src/main/native/src/NvcompJni.cpp +++ b/java/src/main/native/src/NvcompJni.cpp @@ -20,6 +20,7 @@ #include #include +#include namespace { @@ -57,6 +58,7 @@ void check_nvcomp_status(JNIEnv* env, nvcompStatus_t status) extern "C" { +// methods for lz4 JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4CompressGetTempSize( JNIEnv* env, jclass, jlong j_batch_size, jlong j_max_chunk_size) { @@ -211,4 +213,158 @@ Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedLZ4GetDecompressSizeAsync(JNIEnv* en CATCH_STD(env, ); } +// methods for zstd +JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdCompressGetTempSize( + JNIEnv* env, jclass, jlong j_batch_size, jlong j_max_chunk_size) +{ + try { + cudf::jni::auto_set_device(env); + auto batch_size = static_cast(j_batch_size); + auto max_chunk_size = static_cast(j_max_chunk_size); + std::size_t temp_size = 0; + auto status = nvcompBatchedZstdCompressGetTempSize( + batch_size, max_chunk_size, nvcompBatchedZstdDefaultOpts, &temp_size); + check_nvcomp_status(env, status); + return static_cast(temp_size); + } + CATCH_STD(env, 0); +} + +JNIEXPORT jlong JNICALL +Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdCompressGetMaxOutputChunkSize( + JNIEnv* env, jclass, jlong j_max_chunk_size) +{ + try { + cudf::jni::auto_set_device(env); + auto max_chunk_size = static_cast(j_max_chunk_size); + std::size_t max_output_size = 0; + auto status = nvcompBatchedZstdCompressGetMaxOutputChunkSize( + max_chunk_size, nvcompBatchedZstdDefaultOpts, &max_output_size); + check_nvcomp_status(env, status); + return static_cast(max_output_size); + } + CATCH_STD(env, 0); +} + +JNIEXPORT void JNICALL +Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdCompressAsync(JNIEnv* env, + jclass, + jlong j_in_ptrs, + jlong j_in_sizes, + jlong j_chunk_size, + jlong j_batch_size, + jlong j_temp_ptr, + jlong j_temp_size, + jlong j_out_ptrs, + jlong j_compressed_sizes_out_ptr, + jlong j_stream) +{ + try { + cudf::jni::auto_set_device(env); + auto in_ptrs = reinterpret_cast(j_in_ptrs); + auto in_sizes = reinterpret_cast(j_in_sizes); + auto chunk_size = static_cast(j_chunk_size); + auto batch_size = static_cast(j_batch_size); + auto temp_ptr = reinterpret_cast(j_temp_ptr); + auto temp_size = static_cast(j_temp_size); + auto out_ptrs = reinterpret_cast(j_out_ptrs); + auto compressed_out_sizes = reinterpret_cast(j_compressed_sizes_out_ptr); + auto stream = reinterpret_cast(j_stream); + auto status = nvcompBatchedZstdCompressAsync(in_ptrs, + in_sizes, + chunk_size, + batch_size, + temp_ptr, + temp_size, + out_ptrs, + compressed_out_sizes, + nvcompBatchedZstdDefaultOpts, + stream); + check_nvcomp_status(env, status); + } + CATCH_STD(env, ); +} + +JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdDecompressGetTempSize( + JNIEnv* env, jclass, jlong j_batch_size, jlong j_chunk_size) +{ + try { + cudf::jni::auto_set_device(env); + auto batch_size = static_cast(j_batch_size); + auto chunk_size = static_cast(j_chunk_size); + std::size_t temp_size = 0; + auto status = nvcompBatchedZstdDecompressGetTempSize(batch_size, chunk_size, &temp_size); + check_nvcomp_status(env, status); + return static_cast(temp_size); + } + CATCH_STD(env, 0); +} + +JNIEXPORT void JNICALL +Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdDecompressAsync(JNIEnv* env, + jclass, + jlong j_in_ptrs, + jlong j_in_sizes, + jlong j_out_sizes, + jlong j_batch_size, + jlong j_temp_ptr, + jlong j_temp_size, + jlong j_out_ptrs, + jlong j_stream) +{ + try { + cudf::jni::auto_set_device(env); + auto compressed_ptrs = reinterpret_cast(j_in_ptrs); + auto compressed_sizes = reinterpret_cast(j_in_sizes); + auto uncompressed_sizes = reinterpret_cast(j_out_sizes); + auto batch_size = static_cast(j_batch_size); + auto temp_ptr = reinterpret_cast(j_temp_ptr); + auto temp_size = static_cast(j_temp_size); + auto uncompressed_ptrs = reinterpret_cast(j_out_ptrs); + auto stream = reinterpret_cast(j_stream); + auto uncompressed_statuses = rmm::device_uvector(batch_size, stream); + auto actual_uncompressed_sizes = rmm::device_uvector(batch_size, stream); + auto status = nvcompBatchedZstdDecompressAsync(compressed_ptrs, + compressed_sizes, + uncompressed_sizes, + actual_uncompressed_sizes.data(), + batch_size, + temp_ptr, + temp_size, + uncompressed_ptrs, + uncompressed_statuses.data(), + stream); + check_nvcomp_status(env, status); + if (!cudf::java::check_nvcomp_output_sizes( + uncompressed_sizes, actual_uncompressed_sizes.data(), batch_size, stream)) { + cudf::jni::throw_java_exception( + env, NVCOMP_ERROR_CLASS, "nvcomp decompress output size mismatch"); + } + } + CATCH_STD(env, ); +} + +JNIEXPORT void JNICALL +Java_ai_rapids_cudf_nvcomp_NvcompJni_batchedZstdGetDecompressSizeAsync(JNIEnv* env, + jclass, + jlong j_in_ptrs, + jlong j_in_sizes, + jlong j_out_sizes, + jlong j_batch_size, + jlong j_stream) +{ + try { + cudf::jni::auto_set_device(env); + auto compressed_ptrs = reinterpret_cast(j_in_ptrs); + auto compressed_sizes = reinterpret_cast(j_in_sizes); + auto uncompressed_sizes = reinterpret_cast(j_out_sizes); + auto batch_size = static_cast(j_batch_size); + auto stream = reinterpret_cast(j_stream); + auto status = nvcompBatchedZstdGetDecompressSizeAsync( + compressed_ptrs, compressed_sizes, uncompressed_sizes, batch_size, stream); + check_nvcomp_status(env, status); + } + CATCH_STD(env, ); +} + } // extern "C" diff --git a/java/src/test/java/ai/rapids/cudf/nvcomp/NvcompTest.java b/java/src/test/java/ai/rapids/cudf/nvcomp/NvcompTest.java index 66f4fe39109..4e8fc225257 100644 --- a/java/src/test/java/ai/rapids/cudf/nvcomp/NvcompTest.java +++ b/java/src/test/java/ai/rapids/cudf/nvcomp/NvcompTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,18 +23,29 @@ import org.slf4j.LoggerFactory; import java.util.Arrays; -import java.util.Optional; public class NvcompTest { private static final HostMemoryAllocator hostMemoryAllocator = DefaultHostMemoryAllocator.get(); private static final Logger log = LoggerFactory.getLogger(ColumnVector.class); + private final long chunkSize = 64 * 1024; + private final long targetIntermediteSize = Long.MAX_VALUE; + @Test void testBatchedLZ4RoundTripAsync() { + testBatchedRoundTripAsync(new BatchedLZ4Compressor(chunkSize, targetIntermediteSize), + new BatchedLZ4Decompressor(chunkSize)); + } + + @Test + void testBatchedZstdRoundTripAsync() { + testBatchedRoundTripAsync(new BatchedZstdCompressor(chunkSize, targetIntermediteSize), + new BatchedZstdDecompressor(chunkSize)); + } + + void testBatchedRoundTripAsync(BatchedCompressor comp, BatchedDecompressor decomp) { final Cuda.Stream stream = Cuda.DEFAULT_STREAM; - final long chunkSize = 64 * 1024; - final long targetIntermediteSize = Long.MAX_VALUE; final int maxElements = 1024 * 1024 + 1; final int numBuffers = 200; long[] data = new long[maxElements]; @@ -52,10 +63,8 @@ void testBatchedLZ4RoundTripAsync() { } // compress and decompress the buffers - BatchedLZ4Compressor compressor = new BatchedLZ4Compressor(chunkSize, targetIntermediteSize); - try (CloseableArray compressedBuffers = - CloseableArray.wrap(compressor.compress(originalBuffers.getArray(), stream)); + CloseableArray.wrap(comp.compress(originalBuffers.getArray(), stream)); CloseableArray uncompressedBuffers = CloseableArray.wrap(new DeviceMemoryBuffer[numBuffers])) { for (int i = 0; i < numBuffers; i++) { @@ -64,8 +73,8 @@ void testBatchedLZ4RoundTripAsync() { } // decompress takes ownership of the compressed buffers and will close them - BatchedLZ4Decompressor.decompressAsync(chunkSize, compressedBuffers.release(), - uncompressedBuffers.getArray(), stream); + decomp.decompressAsync(compressedBuffers.release(), uncompressedBuffers.getArray(), + stream); // check the decompressed results against the original for (int i = 0; i < numBuffers; ++i) { From 4069c8223e2131130295f488ce363af82ead4be5 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 14 May 2024 06:39:55 -1000 Subject: [PATCH 4/6] Validate and materialize iterators earlier in as_column (#15739) closes #8796 I left a `TODO` in `as_column` to validate earlier that `arbitrary` is an iterable or sequence like if it wasn't a recognized array like (e.g. numpy array, pandas object, etc). Additionally, ensure we materialize iterators since there are some checks that would exhaust the object Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: https://github.com/rapidsai/cudf/pull/15739 --- python/cudf/cudf/core/column/column.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/python/cudf/cudf/core/column/column.py b/python/cudf/cudf/core/column/column.py index 3754ed1392e..371c91dd96f 100644 --- a/python/cudf/cudf/core/column/column.py +++ b/python/cudf/cudf/core/column/column.py @@ -2070,8 +2070,15 @@ def as_column( except (ValueError, TypeError): arbitrary = np.asarray(arbitrary) return as_column(arbitrary, dtype=dtype, nan_as_null=nan_as_null) + elif not isinstance(arbitrary, (abc.Iterable, abc.Sequence)): + raise TypeError( + f"{type(arbitrary).__name__} must be an iterable or sequence." + ) + elif isinstance(arbitrary, abc.Iterator): + arbitrary = list(arbitrary) + # Start of arbitrary that's not handed above but dtype provided - elif isinstance(dtype, pd.DatetimeTZDtype): + if isinstance(dtype, pd.DatetimeTZDtype): raise NotImplementedError( "Use `tz_localize()` to construct timezone aware data." ) @@ -2127,11 +2134,7 @@ def as_column( return cudf.core.column.ListColumn.from_sequences(arbitrary) raise return as_column(data, nan_as_null=nan_as_null) - elif not isinstance(arbitrary, (abc.Iterable, abc.Sequence)): - # TODO: This validation should probably be done earlier? - raise TypeError( - f"{type(arbitrary).__name__} must be an iterable or sequence." - ) + from_pandas = nan_as_null is None or nan_as_null if dtype is not None: dtype = cudf.dtype(dtype) @@ -2147,7 +2150,6 @@ def as_column( arbitrary = pd.Series(arbitrary, dtype=dtype) return as_column(arbitrary, nan_as_null=nan_as_null, dtype=dtype) else: - arbitrary = list(arbitrary) for element in arbitrary: # Carve-outs that cannot be parsed by pyarrow/pandas if is_column_like(element): From cbe277568c42c122a69fdad012e98580a0bb3d71 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Tue, 14 May 2024 12:20:26 -0500 Subject: [PATCH 5/6] Fix `Index.repeat` for `datetime64` types (#15722) Fixes: #15720 This PR fixes `Index.repeat` where the `freq` of `DatetimeIndex` needs to be reset. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Matthew Roeschke (https://github.com/mroeschke) URL: https://github.com/rapidsai/cudf/pull/15722 --- python/cudf/cudf/core/index.py | 5 +++++ python/cudf/cudf/core/indexed_frame.py | 5 ++++- python/cudf/cudf/tests/test_index.py | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/core/index.py b/python/cudf/cudf/core/index.py index 0710f0f5c42..209e582e5d6 100644 --- a/python/cudf/cudf/core/index.py +++ b/python/cudf/cudf/core/index.py @@ -2373,6 +2373,11 @@ def tz_convert(self, tz: str | None): result_col = self._column.tz_convert(tz) return DatetimeIndex._from_data({self.name: result_col}) + def repeat(self, repeats, axis=None): + res = super().repeat(repeats, axis=axis) + res._freq = None + return res + class TimedeltaIndex(Index): """ diff --git a/python/cudf/cudf/core/indexed_frame.py b/python/cudf/cudf/core/indexed_frame.py index dc261707867..904cd0c69c2 100644 --- a/python/cudf/cudf/core/indexed_frame.py +++ b/python/cudf/cudf/core/indexed_frame.py @@ -4871,13 +4871,16 @@ def repeat(self, repeats, axis=None): 1 2 dtype: int64 """ - return self._from_columns_like_self( + res = self._from_columns_like_self( Frame._repeat( [*self._index._data.columns, *self._columns], repeats, axis ), self._column_names, self._index_names, ) + if isinstance(res.index, cudf.DatetimeIndex): + res.index._freq = None + return res def astype( self, diff --git a/python/cudf/cudf/tests/test_index.py b/python/cudf/cudf/tests/test_index.py index 8b7ee1dccf8..8e7532d044d 100644 --- a/python/cudf/cudf/tests/test_index.py +++ b/python/cudf/cudf/tests/test_index.py @@ -3252,3 +3252,17 @@ def test_Index_init_with_nans(): assert gi.dtype == np.dtype("float64") pi = pd.Index([1, 2, 3, np.nan]) assert_eq(pi, gi) + + +def test_index_datetime_repeat(): + gidx = cudf.date_range("2021-01-01", periods=3, freq="D") + pidx = gidx.to_pandas() + + actual = gidx.repeat(5) + expected = pidx.repeat(5) + + assert_eq(actual, expected) + + actual = gidx.to_frame().repeat(5) + + assert_eq(actual.index, expected) From 2fb8efb38a71490d0ebaaa4f4fea37591cf02917 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 14 May 2024 10:52:31 -0700 Subject: [PATCH 6/6] Migrate all cpp pxd files into pylibcudf (#15740) This PR is a mass migration of all the Cython headers exposing libcudf to Cython into the pylibcudf subpackage. This will facilitate splitting out pylibcudf from cudf, and it should also allow us to do some cleanups sooner than that with respect to our imports since this preempts any concerns with circular imports (cudf->pylibcudf->cudf._lib.cpp). Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: https://github.com/rapidsai/cudf/pull/15740 --- python/cudf/cudf/_lib/CMakeLists.txt | 1 - python/cudf/cudf/_lib/avro.pyx | 10 +++--- python/cudf/cudf/_lib/column.pxd | 11 ++++--- python/cudf/cudf/_lib/column.pyx | 20 +++++------ python/cudf/cudf/_lib/copying.pxd | 4 +-- python/cudf/cudf/_lib/copying.pyx | 16 +++++---- .../cudf/_lib/cpp/lists/count_elements.pxd | 10 ------ python/cudf/cudf/_lib/cpp/lists/explode.pxd | 14 -------- python/cudf/cudf/_lib/cpp/strings/extract.pxd | 15 --------- python/cudf/cudf/_lib/cpp/strings/findall.pxd | 14 -------- python/cudf/cudf/_lib/cpp/strings/strip.pxd | 16 --------- python/cudf/cudf/_lib/cpp/strings/wrap.pxd | 14 -------- python/cudf/cudf/_lib/csv.pyx | 16 ++++----- python/cudf/cudf/_lib/datetime.pyx | 12 +++---- python/cudf/cudf/_lib/expressions.pxd | 4 +-- python/cudf/cudf/_lib/expressions.pyx | 9 +++-- python/cudf/cudf/_lib/groupby.pyx | 4 +-- python/cudf/cudf/_lib/hash.pyx | 14 ++++---- python/cudf/cudf/_lib/interop.pyx | 6 ++-- python/cudf/cudf/_lib/io/datasource.pxd | 6 ++-- python/cudf/cudf/_lib/io/datasource.pyx | 6 ++-- python/cudf/cudf/_lib/io/utils.pxd | 10 ++++-- python/cudf/cudf/_lib/io/utils.pyx | 8 ++--- python/cudf/cudf/_lib/json.pyx | 22 ++++++------- python/cudf/cudf/_lib/labeling.pyx | 11 ++++--- python/cudf/cudf/_lib/lists.pyx | 33 ++++++++++++------- python/cudf/cudf/_lib/null_mask.pyx | 10 +++--- .../cudf/_lib/nvtext/byte_pair_encode.pyx | 10 +++--- .../cudf/cudf/_lib/nvtext/edit_distance.pyx | 8 ++--- .../cudf/cudf/_lib/nvtext/generate_ngrams.pyx | 12 +++---- python/cudf/cudf/_lib/nvtext/jaccard.pyx | 12 ++++--- python/cudf/cudf/_lib/nvtext/minhash.pyx | 10 +++--- .../cudf/cudf/_lib/nvtext/ngrams_tokenize.pyx | 12 +++---- python/cudf/cudf/_lib/nvtext/normalize.pyx | 8 ++--- python/cudf/cudf/_lib/nvtext/replace.pyx | 12 +++---- python/cudf/cudf/_lib/nvtext/stemmer.pyx | 10 +++--- .../cudf/_lib/nvtext/subword_tokenize.pyx | 6 ++-- python/cudf/cudf/_lib/nvtext/tokenize.pyx | 12 +++---- python/cudf/cudf/_lib/orc.pyx | 28 ++++++++-------- python/cudf/cudf/_lib/parquet.pyx | 33 ++++++++++--------- python/cudf/cudf/_lib/partitioning.pyx | 14 ++++---- .../cudf/cudf/_lib/pylibcudf/CMakeLists.txt | 1 + .../cudf/cudf/_lib/pylibcudf/aggregation.pxd | 4 +-- .../cudf/cudf/_lib/pylibcudf/aggregation.pyx | 16 +++++---- python/cudf/cudf/_lib/pylibcudf/binaryop.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/binaryop.pyx | 8 ++--- python/cudf/cudf/_lib/pylibcudf/column.pxd | 9 +++-- python/cudf/cudf/_lib/pylibcudf/column.pyx | 10 +++--- .../cudf/cudf/_lib/pylibcudf/concatenate.pyx | 10 +++--- python/cudf/cudf/_lib/pylibcudf/copying.pxd | 7 ++-- python/cudf/cudf/_lib/pylibcudf/copying.pyx | 28 +++++++++------- python/cudf/cudf/_lib/pylibcudf/filling.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/filling.pyx | 8 ++--- python/cudf/cudf/_lib/pylibcudf/groupby.pxd | 6 ++-- python/cudf/cudf/_lib/pylibcudf/groupby.pyx | 10 +++--- python/cudf/cudf/_lib/pylibcudf/interop.pyx | 11 ++++--- python/cudf/cudf/_lib/pylibcudf/join.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/join.pyx | 11 +++++-- .../{cpp => pylibcudf/libcudf}/CMakeLists.txt | 0 .../{cpp => pylibcudf/libcudf}/__init__.pxd | 0 .../{cpp => pylibcudf/libcudf}/__init__.py | 0 .../libcudf}/aggregation.pxd | 2 +- .../libcudf}/aggregation.pyx | 0 .../{cpp => pylibcudf/libcudf}/binaryop.pxd | 8 ++--- .../{cpp => pylibcudf/libcudf}/binaryop.pyx | 0 .../libcudf}/column/__init__.pxd | 0 .../libcudf}/column/__init__.py | 0 .../libcudf}/column/column.pxd | 9 +++-- .../libcudf}/column/column_factories.pxd | 8 ++--- .../libcudf}/column/column_view.pxd | 8 +++-- .../libcudf}/concatenate.pxd | 6 ++-- .../libcudf}/contiguous_split.pxd | 6 ++-- .../{cpp => pylibcudf/libcudf}/copying.pxd | 15 +++++---- .../{cpp => pylibcudf/libcudf}/copying.pyx | 0 .../{cpp => pylibcudf/libcudf}/datetime.pxd | 8 ++--- .../libcudf}/expressions.pxd | 10 +++--- .../{cpp => pylibcudf/libcudf}/filling.pxd | 17 ++++++---- .../{cpp => pylibcudf/libcudf}/groupby.pxd | 18 +++++----- .../_lib/{cpp => pylibcudf/libcudf}/hash.pxd | 6 ++-- .../{cpp => pylibcudf/libcudf}/interop.pxd | 8 ++--- .../libcudf}/io/__init__.pxd | 0 .../{cpp => pylibcudf/libcudf}/io/__init__.py | 0 .../libcudf}/io/arrow_io_source.pxd | 4 +-- .../{cpp => pylibcudf/libcudf}/io/avro.pxd | 6 ++-- .../{cpp => pylibcudf/libcudf}/io/csv.pxd | 8 ++--- .../libcudf}/io/data_sink.pxd | 0 .../libcudf}/io/datasource.pxd | 0 .../{cpp => pylibcudf/libcudf}/io/json.pxd | 6 ++-- .../{cpp => pylibcudf/libcudf}/io/orc.pxd | 6 ++-- .../libcudf}/io/orc_metadata.pxd | 2 +- .../{cpp => pylibcudf/libcudf}/io/parquet.pxd | 8 ++--- .../libcudf}/io/parquet_metadata.pxd | 4 +-- .../{cpp => pylibcudf/libcudf}/io/text.pxd | 4 +-- .../libcudf}/io/timezone.pxd | 4 +-- .../{cpp => pylibcudf/libcudf}/io/types.pxd | 12 +++---- .../_lib/{cpp => pylibcudf/libcudf}/join.pxd | 8 ++--- .../{cpp => pylibcudf/libcudf}/labeling.pxd | 6 ++-- .../libcudf}/lists/__init__.pxd | 0 .../libcudf}/lists/__init__.py | 0 .../libcudf}/lists/combine.pxd | 8 ++--- .../libcudf}/lists/contains.pxd | 12 ++++--- .../libcudf/lists/count_elements.pxd | 12 +++++++ .../_lib/pylibcudf/libcudf/lists/explode.pxd | 14 ++++++++ .../libcudf}/lists/extract.pxd | 10 +++--- .../libcudf}/lists/gather.pxd | 8 +++-- .../libcudf}/lists/lists_column_view.pxd | 9 +++-- .../libcudf}/lists/sorting.pxd | 10 +++--- .../libcudf}/lists/stream_compaction.pxd | 10 +++--- .../_lib/{cpp => pylibcudf/libcudf}/merge.pxd | 8 ++--- .../{cpp => pylibcudf/libcudf}/null_mask.pxd | 12 ++++--- .../libcudf}/nvtext/__init__.pxd | 0 .../libcudf}/nvtext/__init__.py | 0 .../libcudf}/nvtext/byte_pair_encode.pxd | 8 ++--- .../libcudf}/nvtext/edit_distance.pxd | 6 ++-- .../libcudf}/nvtext/generate_ngrams.pxd | 10 +++--- .../libcudf}/nvtext/jaccard.pxd | 8 ++--- .../libcudf}/nvtext/minhash.pxd | 8 ++--- .../libcudf}/nvtext/ngrams_tokenize.pxd | 10 +++--- .../libcudf}/nvtext/normalize.pxd | 6 ++-- .../libcudf}/nvtext/replace.pxd | 10 +++--- .../libcudf}/nvtext/stemmer.pxd | 8 ++--- .../libcudf}/nvtext/subword_tokenize.pxd | 6 ++-- .../libcudf}/nvtext/tokenize.pxd | 10 +++--- .../libcudf}/partitioning.pxd | 12 +++---- .../{cpp => pylibcudf/libcudf}/quantiles.pxd | 12 +++---- .../{cpp => pylibcudf/libcudf}/reduce.pxd | 13 +++++--- .../{cpp => pylibcudf/libcudf}/reduce.pyx | 0 .../{cpp => pylibcudf/libcudf}/replace.pxd | 9 +++-- .../{cpp => pylibcudf/libcudf}/replace.pyx | 0 .../{cpp => pylibcudf/libcudf}/reshape.pxd | 10 +++--- .../{cpp => pylibcudf/libcudf}/rolling.pxd | 8 ++--- .../_lib/{cpp => pylibcudf/libcudf}/round.pxd | 6 ++-- .../libcudf}/scalar/__init__.pxd | 0 .../libcudf}/scalar/__init__.py | 0 .../libcudf}/scalar/scalar.pxd | 10 +++--- .../{cpp => pylibcudf/libcudf}/search.pxd | 10 +++--- .../{cpp => pylibcudf/libcudf}/sorting.pxd | 12 +++---- .../libcudf}/stream_compaction.pxd | 10 +++--- .../libcudf}/stream_compaction.pyx | 0 .../libcudf}/strings/__init__.pxd | 0 .../libcudf}/strings/__init__.py | 0 .../libcudf}/strings/attributes.pxd | 6 ++-- .../libcudf}/strings/capitalize.pxd | 6 ++-- .../libcudf}/strings/case.pxd | 6 ++-- .../libcudf}/strings/char_types.pxd | 8 ++--- .../libcudf}/strings/combine.pxd | 10 +++--- .../libcudf}/strings/contains.pxd | 10 +++--- .../libcudf}/strings/convert/__init__.pxd | 0 .../libcudf}/strings/convert/__init__.py | 0 .../strings/convert/convert_booleans.pxd | 8 ++--- .../strings/convert/convert_datetime.pxd | 8 ++--- .../strings/convert/convert_durations.pxd | 8 ++--- .../strings/convert/convert_fixed_point.pxd | 8 ++--- .../strings/convert/convert_floats.pxd | 8 ++--- .../strings/convert/convert_integers.pxd | 8 ++--- .../libcudf}/strings/convert/convert_ipv4.pxd | 6 ++-- .../strings/convert/convert_lists.pxd | 8 ++--- .../libcudf}/strings/convert/convert_urls.pxd | 6 ++-- .../pylibcudf/libcudf/strings/extract.pxd | 15 +++++++++ .../libcudf}/strings/find.pxd | 8 ++--- .../libcudf}/strings/find_multiple.pxd | 6 ++-- .../pylibcudf/libcudf/strings/findall.pxd | 14 ++++++++ .../libcudf}/strings/json.pxd | 8 ++--- .../libcudf}/strings/padding.pxd | 12 +++---- .../libcudf}/strings/regex_flags.pxd | 0 .../libcudf}/strings/regex_program.pxd | 4 +-- .../libcudf}/strings/repeat.pxd | 8 ++--- .../libcudf}/strings/replace.pxd | 10 +++--- .../libcudf}/strings/replace_re.pxd | 14 ++++---- .../libcudf}/strings/side_type.pxd | 0 .../libcudf}/strings/split/__init__.pxd | 0 .../libcudf}/strings/split/__init__.py | 0 .../libcudf}/strings/split/partition.pxd | 10 +++--- .../libcudf}/strings/split/split.pxd | 14 ++++---- .../_lib/pylibcudf/libcudf/strings/strip.pxd | 16 +++++++++ .../libcudf}/strings/substring.pxd | 10 +++--- .../libcudf}/strings/translate.pxd | 10 +++--- .../_lib/pylibcudf/libcudf/strings/wrap.pxd | 14 ++++++++ .../libcudf}/strings_udf.pxd | 8 ++--- .../libcudf}/table/__init__.pxd | 0 .../libcudf}/table/__init__.py | 0 .../libcudf}/table/table.pxd | 11 ++++--- .../libcudf}/table/table_view.pxd | 9 +++-- .../{cpp => pylibcudf/libcudf}/transform.pxd | 18 ++++++---- .../{cpp => pylibcudf/libcudf}/transpose.pxd | 6 ++-- .../_lib/{cpp => pylibcudf/libcudf}/types.pxd | 0 .../_lib/{cpp => pylibcudf/libcudf}/types.pyx | 0 .../_lib/{cpp => pylibcudf/libcudf}/unary.pxd | 6 ++-- .../_lib/{cpp => pylibcudf/libcudf}/unary.pyx | 0 .../libcudf}/utilities/__init__.pxd | 0 .../libcudf}/utilities/__init__.py | 0 .../libcudf}/utilities/host_span.pxd | 0 .../libcudf}/wrappers/__init__.pxd | 0 .../libcudf}/wrappers/__init__.py | 0 .../libcudf}/wrappers/decimals.pxd | 4 +-- .../libcudf}/wrappers/durations.pxd | 0 .../libcudf}/wrappers/timestamps.pxd | 0 python/cudf/cudf/_lib/pylibcudf/lists.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/lists.pyx | 6 ++-- python/cudf/cudf/_lib/pylibcudf/merge.pyx | 8 ++--- python/cudf/cudf/_lib/pylibcudf/reduce.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/reduce.pyx | 16 +++++---- python/cudf/cudf/_lib/pylibcudf/replace.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/replace.pyx | 6 ++-- python/cudf/cudf/_lib/pylibcudf/rolling.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/rolling.pyx | 8 ++--- python/cudf/cudf/_lib/pylibcudf/scalar.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/scalar.pyx | 2 +- python/cudf/cudf/_lib/pylibcudf/search.pyx | 6 ++-- python/cudf/cudf/_lib/pylibcudf/sorting.pxd | 9 +++-- python/cudf/cudf/_lib/pylibcudf/sorting.pyx | 10 +++--- .../cudf/_lib/pylibcudf/stream_compaction.pxd | 6 ++-- .../cudf/_lib/pylibcudf/stream_compaction.pyx | 16 +++++---- .../cudf/cudf/_lib/pylibcudf/strings/case.pyx | 4 +-- .../cudf/cudf/_lib/pylibcudf/strings/find.pxd | 2 +- .../cudf/cudf/_lib/pylibcudf/strings/find.pyx | 6 ++-- python/cudf/cudf/_lib/pylibcudf/table.pxd | 4 +-- python/cudf/cudf/_lib/pylibcudf/table.pyx | 6 ++-- python/cudf/cudf/_lib/pylibcudf/types.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/types.pyx | 20 +++++------ python/cudf/cudf/_lib/pylibcudf/unary.pxd | 2 +- python/cudf/cudf/_lib/pylibcudf/unary.pyx | 8 ++--- python/cudf/cudf/_lib/pylibcudf/utils.pxd | 4 +-- python/cudf/cudf/_lib/pylibcudf/utils.pyx | 4 +-- python/cudf/cudf/_lib/quantiles.pyx | 19 +++++++---- python/cudf/cudf/_lib/reshape.pyx | 12 +++---- python/cudf/cudf/_lib/round.pyx | 8 ++--- python/cudf/cudf/_lib/scalar.pxd | 2 +- python/cudf/cudf/_lib/scalar.pyx | 18 +++++----- python/cudf/cudf/_lib/sort.pyx | 10 +++--- python/cudf/cudf/_lib/string_casting.pyx | 20 +++++------ python/cudf/cudf/_lib/strings/attributes.pyx | 8 ++--- python/cudf/cudf/_lib/strings/capitalize.pyx | 8 ++--- python/cudf/cudf/_lib/strings/char_types.pyx | 10 +++--- python/cudf/cudf/_lib/strings/combine.pyx | 12 +++---- python/cudf/cudf/_lib/strings/contains.pyx | 14 ++++---- .../strings/convert/convert_fixed_point.pyx | 10 +++--- .../_lib/strings/convert/convert_floats.pyx | 8 ++--- .../_lib/strings/convert/convert_integers.pyx | 8 ++--- .../_lib/strings/convert/convert_lists.pyx | 10 +++--- .../_lib/strings/convert/convert_urls.pyx | 8 ++--- python/cudf/cudf/_lib/strings/extract.pyx | 12 +++---- python/cudf/cudf/_lib/strings/find.pyx | 2 +- .../cudf/cudf/_lib/strings/find_multiple.pyx | 8 ++--- python/cudf/cudf/_lib/strings/findall.pyx | 12 +++---- python/cudf/cudf/_lib/strings/json.pyx | 10 +++--- python/cudf/cudf/_lib/strings/padding.pyx | 15 +++++---- python/cudf/cudf/_lib/strings/repeat.pyx | 10 +++--- python/cudf/cudf/_lib/strings/replace.pyx | 12 +++---- python/cudf/cudf/_lib/strings/replace_re.pyx | 16 ++++----- .../cudf/_lib/strings/split/partition.pyx | 10 +++--- python/cudf/cudf/_lib/strings/split/split.pyx | 18 +++++----- python/cudf/cudf/_lib/strings/strip.pyx | 12 +++---- python/cudf/cudf/_lib/strings/substring.pyx | 14 ++++---- python/cudf/cudf/_lib/strings/translate.pyx | 12 +++---- python/cudf/cudf/_lib/strings/wrap.pyx | 10 +++--- python/cudf/cudf/_lib/strings_udf.pyx | 8 ++--- python/cudf/cudf/_lib/text.pyx | 6 ++-- python/cudf/cudf/_lib/timezone.pyx | 6 ++-- python/cudf/cudf/_lib/transform.pyx | 21 +++++++----- python/cudf/cudf/_lib/transpose.pyx | 8 ++--- python/cudf/cudf/_lib/types.pxd | 10 +++--- python/cudf/cudf/_lib/types.pyx | 8 +++-- python/cudf/cudf/_lib/utils.pxd | 4 +-- python/cudf/cudf/_lib/utils.pyx | 8 ++--- python/cudf_kafka/cudf_kafka/_lib/kafka.pxd | 4 +-- python/cudf_kafka/cudf_kafka/_lib/kafka.pyx | 4 +-- 267 files changed, 1134 insertions(+), 995 deletions(-) delete mode 100644 python/cudf/cudf/_lib/cpp/lists/count_elements.pxd delete mode 100644 python/cudf/cudf/_lib/cpp/lists/explode.pxd delete mode 100644 python/cudf/cudf/_lib/cpp/strings/extract.pxd delete mode 100644 python/cudf/cudf/_lib/cpp/strings/findall.pxd delete mode 100644 python/cudf/cudf/_lib/cpp/strings/strip.pxd delete mode 100644 python/cudf/cudf/_lib/cpp/strings/wrap.pxd rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/CMakeLists.txt (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/aggregation.pxd (98%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/aggregation.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/binaryop.pxd (84%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/binaryop.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/column/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/column/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/column/column.pxd (78%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/column/column_factories.pxd (65%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/column/column_view.pxd (95%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/concatenate.pxd (77%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/contiguous_split.pxd (80%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/copying.pxd (91%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/copying.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/datetime.pxd (90%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/expressions.pxd (92%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/filling.pxd (67%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/groupby.pxd (83%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/hash.pxd (86%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/interop.pxd (83%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/arrow_io_source.pxd (77%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/avro.pxd (88%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/csv.pxd (97%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/data_sink.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/datasource.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/json.pxd (96%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/orc.pxd (97%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/orc_metadata.pxd (96%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/parquet.pxd (97%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/parquet_metadata.pxd (89%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/text.pxd (93%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/timezone.pxd (75%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/io/types.pxd (91%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/join.pxd (87%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/labeling.pxd (71%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/combine.pxd (73%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/contains.pxd (63%) create mode 100644 python/cudf/cudf/_lib/pylibcudf/libcudf/lists/count_elements.pxd create mode 100644 python/cudf/cudf/_lib/pylibcudf/libcudf/lists/explode.pxd rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/extract.pxd (56%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/gather.pxd (57%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/lists_column_view.pxd (69%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/sorting.pxd (51%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/lists/stream_compaction.pxd (52%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/merge.pxd (62%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/null_mask.pxd (76%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/byte_pair_encode.pxd (67%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/edit_distance.pxd (67%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/generate_ngrams.pxd (63%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/jaccard.pxd (52%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/minhash.pxd (63%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/ngrams_tokenize.pxd (50%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/normalize.pxd (66%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/replace.pxd (63%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/stemmer.pxd (74%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/subword_tokenize.pxd (89%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/nvtext/tokenize.pxd (81%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/partitioning.pxd (64%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/quantiles.pxd (65%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/reduce.pxd (69%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/reduce.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/replace.pxd (85%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/replace.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/reshape.pxd (50%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/rolling.pxd (71%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/round.pxd (71%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/scalar/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/scalar/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/scalar/scalar.pxd (89%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/search.pxd (69%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/sorting.pxd (86%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/stream_compaction.pxd (88%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/stream_compaction.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/attributes.pxd (68%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/capitalize.pxd (67%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/case.pxd (67%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/char_types.pxd (84%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/combine.pxd (80%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/contains.pxd (64%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_booleans.pxd (62%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_datetime.pxd (70%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_durations.pxd (65%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_fixed_point.pxd (66%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_floats.pxd (64%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_integers.pxd (75%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_ipv4.pxd (69%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_lists.pxd (53%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/convert/convert_urls.pxd (62%) create mode 100644 python/cudf/cudf/_lib/pylibcudf/libcudf/strings/extract.pxd rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/find.pxd (83%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/find_multiple.pxd (58%) create mode 100644 python/cudf/cudf/_lib/pylibcudf/libcudf/strings/findall.pxd rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/json.pxd (75%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/padding.pxd (54%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/regex_flags.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/regex_program.pxd (74%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/repeat.pxd (60%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/replace.pxd (68%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/replace_re.pxd (59%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/side_type.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/split/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/split/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/split/partition.pxd (56%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/split/split.pxd (76%) create mode 100644 python/cudf/cudf/_lib/pylibcudf/libcudf/strings/strip.pxd rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/substring.pxd (60%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings/translate.pxd (69%) create mode 100644 python/cudf/cudf/_lib/pylibcudf/libcudf/strings/wrap.pxd rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/strings_udf.pxd (81%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/table/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/table/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/table/table.pxd (62%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/table/table_view.pxd (77%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/transform.pxd (70%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/transpose.pxd (59%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/types.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/types.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/unary.pxd (84%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/unary.pyx (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/utilities/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/utilities/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/utilities/host_span.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/wrappers/__init__.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/wrappers/__init__.py (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/wrappers/decimals.pxd (82%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/wrappers/durations.pxd (100%) rename python/cudf/cudf/_lib/{cpp => pylibcudf/libcudf}/wrappers/timestamps.pxd (100%) diff --git a/python/cudf/cudf/_lib/CMakeLists.txt b/python/cudf/cudf/_lib/CMakeLists.txt index 07f334fdc12..5a067e84f56 100644 --- a/python/cudf/cudf/_lib/CMakeLists.txt +++ b/python/cudf/cudf/_lib/CMakeLists.txt @@ -68,7 +68,6 @@ target_link_libraries(strings_udf PUBLIC cudf_strings_udf) set(targets_using_arrow_headers interop avro csv orc json parquet) link_to_pyarrow_headers("${targets_using_arrow_headers}") -add_subdirectory(cpp) add_subdirectory(io) add_subdirectory(nvtext) add_subdirectory(pylibcudf) diff --git a/python/cudf/cudf/_lib/avro.pyx b/python/cudf/cudf/_lib/avro.pyx index 0e24b5b7459..ae17a5f1ab6 100644 --- a/python/cudf/cudf/_lib/avro.pyx +++ b/python/cudf/cudf/_lib/avro.pyx @@ -1,16 +1,16 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.string cimport string from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp.io.avro cimport ( +from cudf._lib.io.utils cimport make_source_info +from cudf._lib.pylibcudf.libcudf.io.avro cimport ( avro_reader_options, read_avro as libcudf_read_avro, ) -from cudf._lib.cpp.io.types cimport table_with_metadata -from cudf._lib.cpp.types cimport size_type -from cudf._lib.io.utils cimport make_source_info +from cudf._lib.pylibcudf.libcudf.io.types cimport table_with_metadata +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.utils cimport data_from_unique_ptr diff --git a/python/cudf/cudf/_lib/column.pxd b/python/cudf/cudf/_lib/column.pxd index 7ffb55a6cc6..437f44af9f0 100644 --- a/python/cudf/cudf/_lib/column.pxd +++ b/python/cudf/cudf/_lib/column.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from typing import Literal @@ -7,9 +7,12 @@ from libcpp.memory cimport unique_ptr from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef class Column: diff --git a/python/cudf/cudf/_lib/column.pyx b/python/cudf/cudf/_lib/column.pyx index 9c48a731cea..f33e121241d 100644 --- a/python/cudf/cudf/_lib/column.pyx +++ b/python/cudf/cudf/_lib/column.pyx @@ -43,18 +43,18 @@ from cudf._lib.types import dtype_from_pylibcudf_column # from_pylibcudf by instead creating an empty numeric column. We will be able # to remove this once column factories are exposed to pylibcudf. -cimport cudf._lib.cpp.copying as cpp_copying -cimport cudf._lib.cpp.types as libcudf_types -cimport cudf._lib.cpp.unary as libcudf_unary -from cudf._lib cimport pylibcudf -from cudf._lib.cpp.column.column cimport column, column_contents -from cudf._lib.cpp.column.column_factories cimport ( +cimport cudf._lib.pylibcudf.libcudf.copying as cpp_copying +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types +cimport cudf._lib.pylibcudf.libcudf.unary as libcudf_unary +from cudf._lib.pylibcudf cimport Column as plc_Column +from cudf._lib.pylibcudf.libcudf.column.column cimport column, column_contents +from cudf._lib.pylibcudf.libcudf.column.column_factories cimport ( make_column_from_scalar as cpp_make_column_from_scalar, make_numeric_column, ) -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.null_mask cimport null_count as cpp_null_count -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.null_mask cimport null_count as cpp_null_count +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar from cudf._lib.scalar cimport DeviceScalar @@ -633,7 +633,7 @@ cdef class Column: # TODO: This function call is what requires cimporting pylibcudf. # We can remove the cimport once we can directly do # pylibcudf.column_factories.make_numeric_column or equivalent. - col = pylibcudf.Column.from_libcudf( + col = plc_Column.from_libcudf( move( make_numeric_column( new_dtype, col.size(), libcudf_types.mask_state.ALL_NULL diff --git a/python/cudf/cudf/_lib/copying.pxd b/python/cudf/cudf/_lib/copying.pxd index 599b9c5a067..8fc7f4e1da0 100644 --- a/python/cudf/cudf/_lib/copying.pxd +++ b/python/cudf/cudf/_lib/copying.pxd @@ -1,6 +1,6 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. -from cudf._lib.cpp.contiguous_split cimport packed_columns +from cudf._lib.pylibcudf.libcudf.contiguous_split cimport packed_columns cdef class _CPackedColumns: diff --git a/python/cudf/cudf/_lib/copying.pyx b/python/cudf/cudf/_lib/copying.pyx index 6a52af520f0..796c70e615c 100644 --- a/python/cudf/cudf/_lib/copying.pyx +++ b/python/cudf/cudf/_lib/copying.pyx @@ -26,15 +26,17 @@ from cudf.core.abc import Serializable from libcpp.memory cimport make_unique -cimport cudf._lib.cpp.contiguous_split as cpp_contiguous_split -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.lists.gather cimport ( +cimport cudf._lib.pylibcudf.libcudf.contiguous_split as cpp_contiguous_split +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.lists.gather cimport ( segmented_gather as cpp_segmented_gather, ) -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.utils cimport columns_from_pylibcudf_table, data_from_table_view # workaround for https://github.com/cython/cython/issues/3885 diff --git a/python/cudf/cudf/_lib/cpp/lists/count_elements.pxd b/python/cudf/cudf/_lib/cpp/lists/count_elements.pxd deleted file mode 100644 index 9be38f26237..00000000000 --- a/python/cudf/cudf/_lib/cpp/lists/count_elements.pxd +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. - -from libcpp.memory cimport unique_ptr - -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view - - -cdef extern from "cudf/lists/count_elements.hpp" namespace "cudf::lists" nogil: - cdef unique_ptr[column] count_elements(const lists_column_view) except + diff --git a/python/cudf/cudf/_lib/cpp/lists/explode.pxd b/python/cudf/cudf/_lib/cpp/lists/explode.pxd deleted file mode 100644 index c3e15dd203c..00000000000 --- a/python/cudf/cudf/_lib/cpp/lists/explode.pxd +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. - -from libcpp.memory cimport unique_ptr - -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type - - -cdef extern from "cudf/lists/explode.hpp" namespace "cudf" nogil: - cdef unique_ptr[table] explode_outer( - const table_view, - size_type explode_column_idx, - ) except + diff --git a/python/cudf/cudf/_lib/cpp/strings/extract.pxd b/python/cudf/cudf/_lib/cpp/strings/extract.pxd deleted file mode 100644 index 384f0f0ef42..00000000000 --- a/python/cudf/cudf/_lib/cpp/strings/extract.pxd +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. - -from libcpp.memory cimport unique_ptr - -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.regex_program cimport regex_program -from cudf._lib.cpp.table.table cimport table - - -cdef extern from "cudf/strings/extract.hpp" namespace "cudf::strings" nogil: - - cdef unique_ptr[table] extract( - column_view source_strings, - regex_program) except + diff --git a/python/cudf/cudf/_lib/cpp/strings/findall.pxd b/python/cudf/cudf/_lib/cpp/strings/findall.pxd deleted file mode 100644 index 8c878ada097..00000000000 --- a/python/cudf/cudf/_lib/cpp/strings/findall.pxd +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. - -from libcpp.memory cimport unique_ptr - -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.regex_program cimport regex_program - - -cdef extern from "cudf/strings/findall.hpp" namespace "cudf::strings" nogil: - - cdef unique_ptr[column] findall( - column_view source_strings, - regex_program) except + diff --git a/python/cudf/cudf/_lib/cpp/strings/strip.pxd b/python/cudf/cudf/_lib/cpp/strings/strip.pxd deleted file mode 100644 index 3a86f80328f..00000000000 --- a/python/cudf/cudf/_lib/cpp/strings/strip.pxd +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. - -from libcpp.memory cimport unique_ptr - -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.side_type cimport side_type - - -cdef extern from "cudf/strings/strip.hpp" namespace "cudf::strings" nogil: - - cdef unique_ptr[column] strip( - column_view source_strings, - side_type stype, - string_scalar to_strip) except + diff --git a/python/cudf/cudf/_lib/cpp/strings/wrap.pxd b/python/cudf/cudf/_lib/cpp/strings/wrap.pxd deleted file mode 100644 index 62c791799ad..00000000000 --- a/python/cudf/cudf/_lib/cpp/strings/wrap.pxd +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. - -from libcpp.memory cimport unique_ptr - -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type - - -cdef extern from "cudf/strings/wrap.hpp" namespace "cudf::strings" nogil: - - cdef unique_ptr[column] wrap( - column_view source_strings, - size_type width) except + diff --git a/python/cudf/cudf/_lib/csv.pyx b/python/cudf/cudf/_lib/csv.pyx index b2e4d442bd2..aa771295607 100644 --- a/python/cudf/cudf/_lib/csv.pyx +++ b/python/cudf/cudf/_lib/csv.pyx @@ -7,9 +7,9 @@ from libcpp.string cimport string from libcpp.utility cimport move from libcpp.vector cimport vector -cimport cudf._lib.cpp.types as libcudf_types -from cudf._lib.cpp.types cimport data_type +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types from cudf._lib.io.datasource cimport Datasource, NativeFileDatasource +from cudf._lib.pylibcudf.libcudf.types cimport data_type from cudf._lib.types cimport dtype_to_data_type import numpy as np @@ -18,7 +18,7 @@ import pandas as pd import cudf from cudf.core.buffer import acquire_spill_lock -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type import errno import os @@ -29,22 +29,22 @@ from io import BytesIO, StringIO from libc.stdint cimport int32_t from libcpp cimport bool -from cudf._lib.cpp.io.csv cimport ( +from cudf._lib.io.utils cimport make_sink_info, make_source_info +from cudf._lib.pylibcudf.libcudf.io.csv cimport ( csv_reader_options, csv_writer_options, read_csv as cpp_read_csv, write_csv as cpp_write_csv, ) -from cudf._lib.cpp.io.data_sink cimport data_sink -from cudf._lib.cpp.io.types cimport ( +from cudf._lib.pylibcudf.libcudf.io.data_sink cimport data_sink +from cudf._lib.pylibcudf.libcudf.io.types cimport ( compression_type, quote_style, sink_info, source_info, table_with_metadata, ) -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.io.utils cimport make_sink_info, make_source_info +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view from cudf._lib.utils cimport data_from_unique_ptr, table_view_from_table from pyarrow.lib import NativeFile diff --git a/python/cudf/cudf/_lib/datetime.pyx b/python/cudf/cudf/_lib/datetime.pyx index 009a69ea501..b30ef875a7b 100644 --- a/python/cudf/cudf/_lib/datetime.pyx +++ b/python/cudf/cudf/_lib/datetime.pyx @@ -7,13 +7,13 @@ from cudf.core.buffer import acquire_spill_lock from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -cimport cudf._lib.cpp.datetime as libcudf_datetime +cimport cudf._lib.pylibcudf.libcudf.datetime as libcudf_datetime from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.filling cimport calendrical_month_sequence -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.filling cimport calendrical_month_sequence +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/expressions.pxd b/python/cudf/cudf/_lib/expressions.pxd index c2ee504c626..4a20c5fc545 100644 --- a/python/cudf/cudf/_lib/expressions.pxd +++ b/python/cudf/cudf/_lib/expressions.pxd @@ -3,13 +3,13 @@ from libc.stdint cimport int32_t, int64_t from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.expressions cimport ( +from cudf._lib.pylibcudf.libcudf.expressions cimport ( column_reference, expression, literal, operation, ) -from cudf._lib.cpp.scalar.scalar cimport ( +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport ( numeric_scalar, scalar, string_scalar, diff --git a/python/cudf/cudf/_lib/expressions.pyx b/python/cudf/cudf/_lib/expressions.pyx index a3b07075507..3fb29279ed7 100644 --- a/python/cudf/cudf/_lib/expressions.pyx +++ b/python/cudf/cudf/_lib/expressions.pyx @@ -10,9 +10,12 @@ from libcpp.memory cimport make_unique, unique_ptr from libcpp.string cimport string from libcpp.utility cimport move -from cudf._lib.cpp cimport expressions as libcudf_exp -from cudf._lib.cpp.types cimport size_type -from cudf._lib.cpp.wrappers.timestamps cimport timestamp_ms, timestamp_us +from cudf._lib.pylibcudf.libcudf cimport expressions as libcudf_exp +from cudf._lib.pylibcudf.libcudf.types cimport size_type +from cudf._lib.pylibcudf.libcudf.wrappers.timestamps cimport ( + timestamp_ms, + timestamp_us, +) # Necessary for proper casting, see below. ctypedef int32_t underlying_type_ast_operator diff --git a/python/cudf/cudf/_lib/groupby.pyx b/python/cudf/cudf/_lib/groupby.pyx index d5e97439180..7533ed56647 100644 --- a/python/cudf/cudf/_lib/groupby.pyx +++ b/python/cudf/cudf/_lib/groupby.pyx @@ -18,8 +18,8 @@ from cudf._lib.utils cimport columns_from_pylibcudf_table from cudf._lib.scalar import as_device_scalar -from cudf._lib.cpp.replace cimport replace_policy -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.replace cimport replace_policy +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar from cudf._lib import pylibcudf from cudf._lib.aggregation import make_aggregation diff --git a/python/cudf/cudf/_lib/hash.pyx b/python/cudf/cudf/_lib/hash.pyx index 6854cff7763..b8331d5a226 100644 --- a/python/cudf/cudf/_lib/hash.pyx +++ b/python/cudf/cudf/_lib/hash.pyx @@ -7,10 +7,10 @@ from libcpp.pair cimport pair from libcpp.utility cimport move from libcpp.vector cimport vector -cimport cudf._lib.cpp.types as libcudf_types +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.hash cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.hash cimport ( md5, murmurhash3_x86_32, sha1, @@ -20,9 +20,11 @@ from cudf._lib.cpp.hash cimport ( sha512, xxhash_64, ) -from cudf._lib.cpp.partitioning cimport hash_partition as cpp_hash_partition -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.partitioning cimport ( + hash_partition as cpp_hash_partition, +) +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view from cudf._lib.utils cimport columns_from_unique_ptr, table_view_from_columns diff --git a/python/cudf/cudf/_lib/interop.pyx b/python/cudf/cudf/_lib/interop.pyx index 0afed1bbd2e..37595b65e65 100644 --- a/python/cudf/cudf/_lib/interop.pyx +++ b/python/cudf/cudf/_lib/interop.pyx @@ -6,13 +6,13 @@ from libcpp.utility cimport move from cudf._lib import pylibcudf -from cudf._lib.cpp.interop cimport ( +from cudf._lib.pylibcudf.libcudf.interop cimport ( DLManagedTensor, from_dlpack as cpp_from_dlpack, to_dlpack as cpp_to_dlpack, ) -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view from cudf._lib.utils cimport ( columns_from_pylibcudf_table, columns_from_unique_ptr, diff --git a/python/cudf/cudf/_lib/io/datasource.pxd b/python/cudf/cudf/_lib/io/datasource.pxd index bd5bf0227a5..a0a9c3fa0d4 100644 --- a/python/cudf/cudf/_lib/io/datasource.pxd +++ b/python/cudf/cudf/_lib/io/datasource.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport shared_ptr -from cudf._lib.cpp.io.arrow_io_source cimport arrow_io_source -from cudf._lib.cpp.io.datasource cimport datasource +from cudf._lib.pylibcudf.libcudf.io.arrow_io_source cimport arrow_io_source +from cudf._lib.pylibcudf.libcudf.io.datasource cimport datasource cdef class Datasource: diff --git a/python/cudf/cudf/_lib/io/datasource.pyx b/python/cudf/cudf/_lib/io/datasource.pyx index 5cadd58d8d3..aa7fa0efdaf 100644 --- a/python/cudf/cudf/_lib/io/datasource.pyx +++ b/python/cudf/cudf/_lib/io/datasource.pyx @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport shared_ptr from pyarrow.includes.libarrow cimport CRandomAccessFile from pyarrow.lib cimport NativeFile -from cudf._lib.cpp.io.arrow_io_source cimport arrow_io_source -from cudf._lib.cpp.io.datasource cimport datasource +from cudf._lib.pylibcudf.libcudf.io.arrow_io_source cimport arrow_io_source +from cudf._lib.pylibcudf.libcudf.io.datasource cimport datasource cdef class Datasource: diff --git a/python/cudf/cudf/_lib/io/utils.pxd b/python/cudf/cudf/_lib/io/utils.pxd index 2c2d52b512b..252d986843a 100644 --- a/python/cudf/cudf/_lib/io/utils.pxd +++ b/python/cudf/cudf/_lib/io/utils.pxd @@ -1,11 +1,15 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.vector cimport vector from cudf._lib.column cimport Column -from cudf._lib.cpp.io.data_sink cimport data_sink -from cudf._lib.cpp.io.types cimport column_name_info, sink_info, source_info +from cudf._lib.pylibcudf.libcudf.io.data_sink cimport data_sink +from cudf._lib.pylibcudf.libcudf.io.types cimport ( + column_name_info, + sink_info, + source_info, +) cdef source_info make_source_info(list src) except* diff --git a/python/cudf/cudf/_lib/io/utils.pyx b/python/cudf/cudf/_lib/io/utils.pyx index ae978d18813..3c14ec46122 100644 --- a/python/cudf/cudf/_lib/io/utils.pyx +++ b/python/cudf/cudf/_lib/io/utils.pyx @@ -8,15 +8,15 @@ from libcpp.utility cimport move from libcpp.vector cimport vector from cudf._lib.column cimport Column -from cudf._lib.cpp.io.data_sink cimport data_sink -from cudf._lib.cpp.io.datasource cimport datasource -from cudf._lib.cpp.io.types cimport ( +from cudf._lib.io.datasource cimport Datasource +from cudf._lib.pylibcudf.libcudf.io.data_sink cimport data_sink +from cudf._lib.pylibcudf.libcudf.io.datasource cimport datasource +from cudf._lib.pylibcudf.libcudf.io.types cimport ( column_name_info, host_buffer, sink_info, source_info, ) -from cudf._lib.io.datasource cimport Datasource import codecs import errno diff --git a/python/cudf/cudf/_lib/json.pyx b/python/cudf/cudf/_lib/json.pyx index cef71ed24a5..283a451dd4a 100644 --- a/python/cudf/cudf/_lib/json.pyx +++ b/python/cudf/cudf/_lib/json.pyx @@ -14,30 +14,30 @@ from libcpp.string cimport string from libcpp.utility cimport move from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types from cudf._lib.column cimport Column -from cudf._lib.cpp.io.data_sink cimport data_sink -from cudf._lib.cpp.io.json cimport ( +from cudf._lib.io.utils cimport ( + make_sink_info, + make_source_info, + update_struct_field_names, +) +from cudf._lib.pylibcudf.libcudf.io.data_sink cimport data_sink +from cudf._lib.pylibcudf.libcudf.io.json cimport ( json_reader_options, json_writer_options, read_json as libcudf_read_json, schema_element, write_json as libcudf_write_json, ) -from cudf._lib.cpp.io.types cimport ( +from cudf._lib.pylibcudf.libcudf.io.types cimport ( column_name_info, compression_type, sink_info, table_metadata, table_with_metadata, ) -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport data_type, size_type -from cudf._lib.io.utils cimport ( - make_sink_info, - make_source_info, - update_struct_field_names, -) +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type from cudf._lib.types cimport dtype_to_data_type from cudf._lib.utils cimport data_from_unique_ptr, table_view_from_table diff --git a/python/cudf/cudf/_lib/labeling.pyx b/python/cudf/cudf/_lib/labeling.pyx index 2c2538ab0af..439a727a9ca 100644 --- a/python/cudf/cudf/_lib/labeling.pyx +++ b/python/cudf/cudf/_lib/labeling.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -7,9 +7,12 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.labeling cimport inclusive, label_bins as cpp_label_bins +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.labeling cimport ( + inclusive, + label_bins as cpp_label_bins, +) # Note that the parameter input shadows a Python built-in in the local scope, diff --git a/python/cudf/cudf/_lib/lists.pyx b/python/cudf/cudf/_lib/lists.pyx index f4d16967300..656d92c1a4b 100644 --- a/python/cudf/cudf/_lib/lists.pyx +++ b/python/cudf/cudf/_lib/lists.pyx @@ -7,24 +7,33 @@ from libcpp.memory cimport make_shared, shared_ptr, unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.lists.combine cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.lists.combine cimport ( concatenate_list_elements as cpp_concatenate_list_elements, concatenate_null_policy, concatenate_rows as cpp_concatenate_rows, ) -from cudf._lib.cpp.lists.contains cimport contains, index_of as cpp_index_of -from cudf._lib.cpp.lists.count_elements cimport ( +from cudf._lib.pylibcudf.libcudf.lists.contains cimport ( + contains, + index_of as cpp_index_of, +) +from cudf._lib.pylibcudf.libcudf.lists.count_elements cimport ( count_elements as cpp_count_elements, ) -from cudf._lib.cpp.lists.extract cimport extract_list_element -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view -from cudf._lib.cpp.lists.sorting cimport sort_lists as cpp_sort_lists -from cudf._lib.cpp.lists.stream_compaction cimport distinct as cpp_distinct -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.lists.extract cimport extract_list_element +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) +from cudf._lib.pylibcudf.libcudf.lists.sorting cimport ( + sort_lists as cpp_sort_lists, +) +from cudf._lib.pylibcudf.libcudf.lists.stream_compaction cimport ( + distinct as cpp_distinct, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( nan_equality, null_equality, null_order, diff --git a/python/cudf/cudf/_lib/null_mask.pyx b/python/cudf/cudf/_lib/null_mask.pyx index 1f98140d9e4..b00deae2270 100644 --- a/python/cudf/cudf/_lib/null_mask.pyx +++ b/python/cudf/cudf/_lib/null_mask.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from enum import Enum @@ -11,8 +11,8 @@ from libcpp.pair cimport pair from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.null_mask cimport ( +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.null_mask cimport ( bitmask_allocation_size_bytes as cpp_bitmask_allocation_size_bytes, bitmask_and as cpp_bitmask_and, bitmask_or as cpp_bitmask_or, @@ -20,8 +20,8 @@ from cudf._lib.cpp.null_mask cimport ( create_null_mask as cpp_create_null_mask, underlying_type_t_mask_state, ) -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport mask_state, size_type +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport mask_state, size_type from cudf._lib.utils cimport table_view_from_columns diff --git a/python/cudf/cudf/_lib/nvtext/byte_pair_encode.pyx b/python/cudf/cudf/_lib/nvtext/byte_pair_encode.pyx index cfc76afa8a5..d60162d0656 100644 --- a/python/cudf/cudf/_lib/nvtext/byte_pair_encode.pyx +++ b/python/cudf/cudf/_lib/nvtext/byte_pair_encode.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -7,14 +7,14 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.byte_pair_encode cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.byte_pair_encode cimport ( bpe_merge_pairs as cpp_bpe_merge_pairs, byte_pair_encoding as cpp_byte_pair_encoding, load_merge_pairs as cpp_load_merge_pairs, ) -from cudf._lib.cpp.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/nvtext/edit_distance.pyx b/python/cudf/cudf/_lib/nvtext/edit_distance.pyx index 984c8e84d7c..514b6610575 100644 --- a/python/cudf/cudf/_lib/nvtext/edit_distance.pyx +++ b/python/cudf/cudf/_lib/nvtext/edit_distance.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,9 +6,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.edit_distance cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.edit_distance cimport ( edit_distance as cpp_edit_distance, edit_distance_matrix as cpp_edit_distance_matrix, ) diff --git a/python/cudf/cudf/_lib/nvtext/generate_ngrams.pyx b/python/cudf/cudf/_lib/nvtext/generate_ngrams.pyx index 96b95c8792d..a6b9a1e4f7a 100644 --- a/python/cudf/cudf/_lib/nvtext/generate_ngrams.pyx +++ b/python/cudf/cudf/_lib/nvtext/generate_ngrams.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,15 +6,15 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.generate_ngrams cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.generate_ngrams cimport ( generate_character_ngrams as cpp_generate_character_ngrams, generate_ngrams as cpp_generate_ngrams, hash_character_ngrams as cpp_hash_character_ngrams, ) -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/nvtext/jaccard.pyx b/python/cudf/cudf/_lib/nvtext/jaccard.pyx index 9035e743fa5..42fe15d6869 100644 --- a/python/cudf/cudf/_lib/nvtext/jaccard.pyx +++ b/python/cudf/cudf/_lib/nvtext/jaccard.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,10 +6,12 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.jaccard cimport jaccard_index as cpp_jaccard_index -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.jaccard cimport ( + jaccard_index as cpp_jaccard_index, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/nvtext/minhash.pyx b/python/cudf/cudf/_lib/nvtext/minhash.pyx index 6ed5ca834ee..4c92999e190 100644 --- a/python/cudf/cudf/_lib/nvtext/minhash.pyx +++ b/python/cudf/cudf/_lib/nvtext/minhash.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,13 +6,13 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.minhash cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.minhash cimport ( minhash as cpp_minhash, minhash64 as cpp_minhash64, ) -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/nvtext/ngrams_tokenize.pyx b/python/cudf/cudf/_lib/nvtext/ngrams_tokenize.pyx index 3e7911c8ae8..ccd8de8c96f 100644 --- a/python/cudf/cudf/_lib/nvtext/ngrams_tokenize.pyx +++ b/python/cudf/cudf/_lib/nvtext/ngrams_tokenize.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2022, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,13 +6,13 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.ngrams_tokenize cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.ngrams_tokenize cimport ( ngrams_tokenize as cpp_ngrams_tokenize, ) -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/nvtext/normalize.pyx b/python/cudf/cudf/_lib/nvtext/normalize.pyx index 80c6ef792ab..9f81f865bb7 100644 --- a/python/cudf/cudf/_lib/nvtext/normalize.pyx +++ b/python/cudf/cudf/_lib/nvtext/normalize.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2022, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -7,9 +7,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.normalize cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.normalize cimport ( normalize_characters as cpp_normalize_characters, normalize_spaces as cpp_normalize_spaces, ) diff --git a/python/cudf/cudf/_lib/nvtext/replace.pyx b/python/cudf/cudf/_lib/nvtext/replace.pyx index 289e5611010..ce2edc58d19 100644 --- a/python/cudf/cudf/_lib/nvtext/replace.pyx +++ b/python/cudf/cudf/_lib/nvtext/replace.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,14 +6,14 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.replace cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.replace cimport ( filter_tokens as cpp_filter_tokens, replace_tokens as cpp_replace_tokens, ) -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/nvtext/stemmer.pyx b/python/cudf/cudf/_lib/nvtext/stemmer.pyx index c690aba70de..8f75953ae99 100644 --- a/python/cudf/cudf/_lib/nvtext/stemmer.pyx +++ b/python/cudf/cudf/_lib/nvtext/stemmer.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -8,15 +8,15 @@ from libcpp.utility cimport move from enum import IntEnum from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.stemmer cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.stemmer cimport ( is_letter as cpp_is_letter, letter_type, porter_stemmer_measure as cpp_porter_stemmer_measure, underlying_type_t_letter_type, ) -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type class LetterType(IntEnum): diff --git a/python/cudf/cudf/_lib/nvtext/subword_tokenize.pyx b/python/cudf/cudf/_lib/nvtext/subword_tokenize.pyx index bf675a16adc..1112667a087 100644 --- a/python/cudf/cudf/_lib/nvtext/subword_tokenize.pyx +++ b/python/cudf/cudf/_lib/nvtext/subword_tokenize.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport uint32_t @@ -10,8 +10,8 @@ from libcpp.string cimport string from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.subword_tokenize cimport ( +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.subword_tokenize cimport ( hashed_vocabulary as cpp_hashed_vocabulary, load_vocabulary_file as cpp_load_vocabulary_file, move as tr_move, diff --git a/python/cudf/cudf/_lib/nvtext/tokenize.pyx b/python/cudf/cudf/_lib/nvtext/tokenize.pyx index bee9d6f6c4d..98afd94ab1c 100644 --- a/python/cudf/cudf/_lib/nvtext/tokenize.pyx +++ b/python/cudf/cudf/_lib/nvtext/tokenize.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,9 +6,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.nvtext.tokenize cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.nvtext.tokenize cimport ( character_tokenize as cpp_character_tokenize, count_tokens as cpp_count_tokens, detokenize as cpp_detokenize, @@ -17,8 +17,8 @@ from cudf._lib.cpp.nvtext.tokenize cimport ( tokenize_vocabulary as cpp_tokenize_vocabulary, tokenize_with_vocabulary as cpp_tokenize_with_vocabulary, ) -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/orc.pyx b/python/cudf/cudf/_lib/orc.pyx index 918880648bf..d3e6053ef4b 100644 --- a/python/cudf/cudf/_lib/orc.pyx +++ b/python/cudf/cudf/_lib/orc.pyx @@ -14,17 +14,23 @@ from libcpp.vector cimport vector import datetime from collections import OrderedDict -cimport cudf._lib.cpp.lists.lists_column_view as cpp_lists_column_view +cimport cudf._lib.pylibcudf.libcudf.lists.lists_column_view as cpp_lists_column_view try: import ujson as json except ImportError: import json -cimport cudf._lib.cpp.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types from cudf._lib.column cimport Column -from cudf._lib.cpp.io.data_sink cimport data_sink -from cudf._lib.cpp.io.orc cimport ( +from cudf._lib.io.datasource cimport NativeFileDatasource +from cudf._lib.io.utils cimport ( + make_sink_info, + make_source_info, + update_column_struct_field_names, +) +from cudf._lib.pylibcudf.libcudf.io.data_sink cimport data_sink +from cudf._lib.pylibcudf.libcudf.io.orc cimport ( chunked_orc_writer_options, orc_chunked_writer, orc_reader_options, @@ -32,7 +38,7 @@ from cudf._lib.cpp.io.orc cimport ( read_orc as libcudf_read_orc, write_orc as libcudf_write_orc, ) -from cudf._lib.cpp.io.orc_metadata cimport ( +from cudf._lib.pylibcudf.libcudf.io.orc_metadata cimport ( binary_statistics, bucket_statistics, column_statistics, @@ -47,7 +53,7 @@ from cudf._lib.cpp.io.orc_metadata cimport ( string_statistics, timestamp_statistics, ) -from cudf._lib.cpp.io.types cimport ( +from cudf._lib.pylibcudf.libcudf.io.types cimport ( column_in_metadata, compression_type, sink_info, @@ -55,14 +61,8 @@ from cudf._lib.cpp.io.types cimport ( table_input_metadata, table_with_metadata, ) -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport data_type, size_type, type_id -from cudf._lib.io.datasource cimport NativeFileDatasource -from cudf._lib.io.utils cimport ( - make_sink_info, - make_source_info, - update_column_struct_field_names, -) +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type, type_id from cudf._lib.variant cimport get_if as std_get_if, holds_alternative from cudf._lib.types import SUPPORTED_NUMPY_TO_LIBCUDF_TYPES diff --git a/python/cudf/cudf/_lib/parquet.pyx b/python/cudf/cudf/_lib/parquet.pyx index dcfa087a1fa..4a23a58b523 100644 --- a/python/cudf/cudf/_lib/parquet.pyx +++ b/python/cudf/cudf/_lib/parquet.pyx @@ -31,12 +31,19 @@ from libcpp.unordered_map cimport unordered_map from libcpp.utility cimport move from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.data_sink as cudf_io_data_sink -cimport cudf._lib.cpp.io.types as cudf_io_types -cimport cudf._lib.cpp.types as cudf_types +cimport cudf._lib.pylibcudf.libcudf.io.data_sink as cudf_io_data_sink +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.types as cudf_types from cudf._lib.column cimport Column -from cudf._lib.cpp.expressions cimport expression -from cudf._lib.cpp.io.parquet cimport ( +from cudf._lib.expressions cimport Expression +from cudf._lib.io.datasource cimport NativeFileDatasource +from cudf._lib.io.utils cimport ( + make_sinks_info, + make_source_info, + update_struct_field_names, +) +from cudf._lib.pylibcudf.libcudf.expressions cimport expression +from cudf._lib.pylibcudf.libcudf.io.parquet cimport ( chunked_parquet_writer_options, merge_row_group_metadata as parquet_merge_metadata, parquet_chunked_writer as cpp_parquet_chunked_writer, @@ -46,20 +53,16 @@ from cudf._lib.cpp.io.parquet cimport ( read_parquet as parquet_reader, write_parquet as parquet_writer, ) -from cudf._lib.cpp.io.parquet_metadata cimport ( +from cudf._lib.pylibcudf.libcudf.io.parquet_metadata cimport ( parquet_metadata, read_parquet_metadata as parquet_metadata_reader, ) -from cudf._lib.cpp.io.types cimport column_in_metadata, table_input_metadata -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport data_type, size_type -from cudf._lib.expressions cimport Expression -from cudf._lib.io.datasource cimport NativeFileDatasource -from cudf._lib.io.utils cimport ( - make_sinks_info, - make_source_info, - update_struct_field_names, +from cudf._lib.pylibcudf.libcudf.io.types cimport ( + column_in_metadata, + table_input_metadata, ) +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type from cudf._lib.utils cimport table_view_from_table from pyarrow.lib import NativeFile diff --git a/python/cudf/cudf/_lib/partitioning.pyx b/python/cudf/cudf/_lib/partitioning.pyx index 4bf8b32ea7e..708ec4174aa 100644 --- a/python/cudf/cudf/_lib/partitioning.pyx +++ b/python/cudf/cudf/_lib/partitioning.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -8,16 +8,18 @@ from libcpp.utility cimport move from libcpp.vector cimport vector from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.partitioning cimport partition as cpp_partition -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.partitioning cimport ( + partition as cpp_partition, +) +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view from cudf._lib.utils cimport columns_from_unique_ptr, table_view_from_columns from cudf._lib.reduce import minmax from cudf._lib.stream_compaction import distinct_count as cpp_distinct_count -cimport cudf._lib.cpp.types as libcudf_types +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt b/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt index c2b7cb7ca3d..efc978fc6d0 100644 --- a/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt +++ b/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt @@ -45,4 +45,5 @@ rapids_cython_create_modules( ) link_to_pyarrow_headers(pylibcudf_interop) +add_subdirectory(libcudf) add_subdirectory(strings) diff --git a/python/cudf/cudf/_lib/pylibcudf/aggregation.pxd b/python/cudf/cudf/_lib/pylibcudf/aggregation.pxd index a9491793b88..8526728656b 100644 --- a/python/cudf/cudf/_lib/pylibcudf/aggregation.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/aggregation.pxd @@ -2,7 +2,7 @@ from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.aggregation cimport ( +from cudf._lib.pylibcudf.libcudf.aggregation cimport ( Kind as kind_t, aggregation, correlation_type, @@ -14,7 +14,7 @@ from cudf._lib.cpp.aggregation cimport ( rolling_aggregation, scan_aggregation, ) -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.types cimport ( interpolation, nan_equality, null_equality, diff --git a/python/cudf/cudf/_lib/pylibcudf/aggregation.pyx b/python/cudf/cudf/_lib/pylibcudf/aggregation.pyx index fe7daea38bf..672b1ba2221 100644 --- a/python/cudf/cudf/_lib/pylibcudf/aggregation.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/aggregation.pyx @@ -5,7 +5,7 @@ from libcpp.cast cimport dynamic_cast from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp.aggregation cimport ( +from cudf._lib.pylibcudf.libcudf.aggregation cimport ( aggregation, correlation_type, groupby_aggregation, @@ -39,7 +39,7 @@ from cudf._lib.cpp.aggregation cimport ( rolling_aggregation, scan_aggregation, ) -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.types cimport ( interpolation, nan_equality, null_equality, @@ -49,14 +49,16 @@ from cudf._lib.cpp.types cimport ( size_type, ) -from cudf._lib.cpp.aggregation import Kind # no-cython-lint -from cudf._lib.cpp.aggregation import \ +from cudf._lib.pylibcudf.libcudf.aggregation import Kind # no-cython-lint +from cudf._lib.pylibcudf.libcudf.aggregation import \ correlation_type as CorrelationType # no-cython-lint -from cudf._lib.cpp.aggregation import \ +from cudf._lib.pylibcudf.libcudf.aggregation import \ rank_method as RankMethod # no-cython-lint -from cudf._lib.cpp.aggregation import \ +from cudf._lib.pylibcudf.libcudf.aggregation import \ rank_percentage as RankPercentage # no-cython-lint -from cudf._lib.cpp.aggregation import udf_type as UdfType # no-cython-lint +from cudf._lib.pylibcudf.libcudf.aggregation import ( # no-cython-lint + udf_type as UdfType, +) from .types cimport DataType diff --git a/python/cudf/cudf/_lib/pylibcudf/binaryop.pxd b/python/cudf/cudf/_lib/pylibcudf/binaryop.pxd index 0aa6aac7b39..9a8c8e49dcf 100644 --- a/python/cudf/cudf/_lib/pylibcudf/binaryop.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/binaryop.pxd @@ -1,6 +1,6 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.binaryop cimport binary_operator +from cudf._lib.pylibcudf.libcudf.binaryop cimport binary_operator from .column cimport Column from .scalar cimport Scalar diff --git a/python/cudf/cudf/_lib/pylibcudf/binaryop.pyx b/python/cudf/cudf/_lib/pylibcudf/binaryop.pyx index 16de7757469..c1d669c3c1c 100644 --- a/python/cudf/cudf/_lib/pylibcudf/binaryop.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/binaryop.pyx @@ -5,11 +5,11 @@ from cython.operator import dereference from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp cimport binaryop as cpp_binaryop -from cudf._lib.cpp.binaryop cimport binary_operator -from cudf._lib.cpp.column.column cimport column +from cudf._lib.pylibcudf.libcudf cimport binaryop as cpp_binaryop +from cudf._lib.pylibcudf.libcudf.binaryop cimport binary_operator +from cudf._lib.pylibcudf.libcudf.column.column cimport column -from cudf._lib.cpp.binaryop import \ +from cudf._lib.pylibcudf.libcudf.binaryop import \ binary_operator as BinaryOperator # no-cython-lint from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/column.pxd b/python/cudf/cudf/_lib/pylibcudf/column.pxd index 66ccdb53d1a..e121e856865 100644 --- a/python/cudf/cudf/_lib/pylibcudf/column.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/column.pxd @@ -3,9 +3,12 @@ from libcpp.memory cimport unique_ptr from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.types cimport bitmask_type, size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport bitmask_type, size_type from .gpumemoryview cimport gpumemoryview from .types cimport DataType diff --git a/python/cudf/cudf/_lib/pylibcudf/column.pyx b/python/cudf/cudf/_lib/pylibcudf/column.pyx index b9e5e48226d..e726eca154f 100644 --- a/python/cudf/cudf/_lib/pylibcudf/column.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/column.pyx @@ -6,10 +6,12 @@ from libcpp.utility cimport move from rmm._lib.device_buffer cimport DeviceBuffer -from cudf._lib.cpp.column.column cimport column, column_contents -from cudf._lib.cpp.column.column_factories cimport make_column_from_scalar -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column, column_contents +from cudf._lib.pylibcudf.libcudf.column.column_factories cimport ( + make_column_from_scalar, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .gpumemoryview cimport gpumemoryview from .scalar cimport Scalar diff --git a/python/cudf/cudf/_lib/pylibcudf/concatenate.pyx b/python/cudf/cudf/_lib/pylibcudf/concatenate.pyx index ce7ef84e20e..5e40f921b2c 100644 --- a/python/cudf/cudf/_lib/pylibcudf/concatenate.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/concatenate.pyx @@ -4,11 +4,11 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp cimport concatenate as cpp_concatenate -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf cimport concatenate as cpp_concatenate +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view from .column cimport Column from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/copying.pxd b/python/cudf/cudf/_lib/pylibcudf/copying.pxd index 0211d122c8e..06543d3ca92 100644 --- a/python/cudf/cudf/_lib/pylibcudf/copying.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/copying.pxd @@ -2,8 +2,11 @@ from libcpp cimport bool as cbool -from cudf._lib.cpp.copying cimport mask_allocation_policy, out_of_bounds_policy -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.copying cimport ( + mask_allocation_policy, + out_of_bounds_policy, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .column cimport Column from .scalar cimport Scalar diff --git a/python/cudf/cudf/_lib/pylibcudf/copying.pyx b/python/cudf/cudf/_lib/pylibcudf/copying.pyx index 125a4ffe65f..2d59deb3864 100644 --- a/python/cudf/cudf/_lib/pylibcudf/copying.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/copying.pyx @@ -11,18 +11,24 @@ from libcpp.vector cimport vector # directly from that. It will make namespacing much cleaner in pylibcudf. What # we really want here would be # cimport libcudf... libcudf.copying.algo(...) -from cudf._lib.cpp cimport copying as cpp_copying -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.copying cimport mask_allocation_policy, out_of_bounds_policy -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type - -from cudf._lib.cpp.copying import \ +from cudf._lib.pylibcudf.libcudf cimport copying as cpp_copying +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.copying cimport ( + mask_allocation_policy, + out_of_bounds_policy, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type + +from cudf._lib.pylibcudf.libcudf.copying import \ mask_allocation_policy as MaskAllocationPolicy # no-cython-lint -from cudf._lib.cpp.copying import \ +from cudf._lib.pylibcudf.libcudf.copying import \ out_of_bounds_policy as OutOfBoundsPolicy # no-cython-lint from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/filling.pxd b/python/cudf/cudf/_lib/pylibcudf/filling.pxd index 55dbd7b075f..3560ebf2ea2 100644 --- a/python/cudf/cudf/_lib/pylibcudf/filling.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/filling.pxd @@ -1,5 +1,5 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .column cimport Column from .scalar cimport Scalar diff --git a/python/cudf/cudf/_lib/pylibcudf/filling.pyx b/python/cudf/cudf/_lib/pylibcudf/filling.pyx index 588ab58a146..05f67681428 100644 --- a/python/cudf/cudf/_lib/pylibcudf/filling.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/filling.pyx @@ -4,15 +4,15 @@ from cython.operator cimport dereference from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.filling cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.filling cimport ( fill as cpp_fill, fill_in_place as cpp_fill_in_place, repeat as cpp_repeat, sequence as cpp_sequence, ) -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .column cimport Column from .scalar cimport Scalar diff --git a/python/cudf/cudf/_lib/pylibcudf/groupby.pxd b/python/cudf/cudf/_lib/pylibcudf/groupby.pxd index f1b7a25d5f9..c6c146b0445 100644 --- a/python/cudf/cudf/_lib/pylibcudf/groupby.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/groupby.pxd @@ -4,18 +4,18 @@ from libcpp.memory cimport unique_ptr from libcpp.pair cimport pair from libcpp.vector cimport vector -from cudf._lib.cpp.aggregation cimport ( +from cudf._lib.pylibcudf.libcudf.aggregation cimport ( aggregation, groupby_aggregation, groupby_scan_aggregation, ) -from cudf._lib.cpp.groupby cimport ( +from cudf._lib.pylibcudf.libcudf.groupby cimport ( aggregation_request, aggregation_result, groupby, scan_request, ) -from cudf._lib.cpp.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table cimport table from .column cimport Column from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/groupby.pyx b/python/cudf/cudf/_lib/pylibcudf/groupby.pyx index 3b800abf266..46fe61025ce 100644 --- a/python/cudf/cudf/_lib/pylibcudf/groupby.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/groupby.pyx @@ -7,17 +7,17 @@ from libcpp.pair cimport pair from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp.groupby cimport ( +from cudf._lib.pylibcudf.libcudf.groupby cimport ( aggregation_request, aggregation_result, groupby, groups, scan_request, ) -from cudf._lib.cpp.replace cimport replace_policy -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.replace cimport replace_policy +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .aggregation cimport Aggregation from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/interop.pyx b/python/cudf/cudf/_lib/pylibcudf/interop.pyx index 8dc41fccc0c..f172080cece 100644 --- a/python/cudf/cudf/_lib/pylibcudf/interop.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/interop.pyx @@ -11,14 +11,17 @@ from functools import singledispatch from pyarrow import lib as pa -from cudf._lib.cpp.interop cimport ( +from cudf._lib.pylibcudf.libcudf.interop cimport ( column_metadata, from_arrow as cpp_from_arrow, to_arrow as cpp_to_arrow, ) -from cudf._lib.cpp.scalar.scalar cimport fixed_point_scalar, scalar -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.wrappers.decimals cimport ( +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport ( + fixed_point_scalar, + scalar, +) +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.wrappers.decimals cimport ( decimal32, decimal64, decimal128, diff --git a/python/cudf/cudf/_lib/pylibcudf/join.pxd b/python/cudf/cudf/_lib/pylibcudf/join.pxd index ff7dec97596..f560eeef06d 100644 --- a/python/cudf/cudf/_lib/pylibcudf/join.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/join.pxd @@ -1,6 +1,6 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.types cimport null_equality +from cudf._lib.pylibcudf.libcudf.types cimport null_equality from .column cimport Column from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/join.pyx b/python/cudf/cudf/_lib/pylibcudf/join.pyx index 3710a84e594..cf2a6a8187f 100644 --- a/python/cudf/cudf/_lib/pylibcudf/join.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/join.pyx @@ -7,9 +7,14 @@ from libcpp.utility cimport move from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp cimport join as cpp_join -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.types cimport data_type, null_equality, size_type, type_id +from cudf._lib.pylibcudf.libcudf cimport join as cpp_join +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.types cimport ( + data_type, + null_equality, + size_type, + type_id, +) from .column cimport Column from .table cimport Table diff --git a/python/cudf/cudf/_lib/cpp/CMakeLists.txt b/python/cudf/cudf/_lib/pylibcudf/libcudf/CMakeLists.txt similarity index 100% rename from python/cudf/cudf/_lib/cpp/CMakeLists.txt rename to python/cudf/cudf/_lib/pylibcudf/libcudf/CMakeLists.txt diff --git a/python/cudf/cudf/_lib/cpp/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/aggregation.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/aggregation.pxd similarity index 98% rename from python/cudf/cudf/_lib/cpp/aggregation.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/aggregation.pxd index 91b9d7d024f..e0e01207589 100644 --- a/python/cudf/cudf/_lib/cpp/aggregation.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/aggregation.pxd @@ -5,7 +5,7 @@ from libcpp.memory cimport unique_ptr from libcpp.string cimport string from libcpp.vector cimport vector -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.types cimport ( data_type, interpolation, nan_equality, diff --git a/python/cudf/cudf/_lib/cpp/aggregation.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/aggregation.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/aggregation.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/aggregation.pyx diff --git a/python/cudf/cudf/_lib/cpp/binaryop.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/binaryop.pxd similarity index 84% rename from python/cudf/cudf/_lib/cpp/binaryop.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/binaryop.pxd index 735216e656a..788a94a0bbc 100644 --- a/python/cudf/cudf/_lib/cpp/binaryop.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/binaryop.pxd @@ -4,10 +4,10 @@ from libc.stdint cimport int32_t from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/binaryop.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/binaryop.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/binaryop.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/binaryop.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/binaryop.pyx diff --git a/python/cudf/cudf/_lib/cpp/column/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/column/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/column/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/column/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/column/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/column/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/column/column.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/column.pxd similarity index 78% rename from python/cudf/cudf/_lib/cpp/column/column.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/column/column.pxd index 136f1d795a9..dd184d31cc6 100644 --- a/python/cudf/cudf/_lib/cpp/column/column.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/column.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr @@ -6,8 +6,11 @@ from libcpp.vector cimport vector from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.types cimport data_type, size_type +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type cdef extern from "cudf/column/column.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/column/column_factories.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/column_factories.pxd similarity index 65% rename from python/cudf/cudf/_lib/cpp/column/column_factories.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/column/column_factories.pxd index 0f22e788bd7..fd22d92cb30 100644 --- a/python/cudf/cudf/_lib/cpp/column/column_factories.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/column_factories.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport data_type, mask_state, size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport data_type, mask_state, size_type cdef extern from "cudf/column/column_factories.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/column/column_view.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/column_view.pxd similarity index 95% rename from python/cudf/cudf/_lib/cpp/column/column_view.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/column/column_view.pxd index edd013d9340..c6403babe89 100644 --- a/python/cudf/cudf/_lib/cpp/column/column_view.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/column/column_view.pxd @@ -1,9 +1,13 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.vector cimport vector -from cudf._lib.cpp.types cimport bitmask_type, data_type, size_type +from cudf._lib.pylibcudf.libcudf.types cimport ( + bitmask_type, + data_type, + size_type, +) cdef extern from "cudf/column/column_view.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/concatenate.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/concatenate.pxd similarity index 77% rename from python/cudf/cudf/_lib/cpp/concatenate.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/concatenate.pxd index a64c7426f5e..0c362390ff2 100644 --- a/python/cudf/cudf/_lib/cpp/concatenate.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/concatenate.pxd @@ -5,9 +5,9 @@ from libcpp.vector cimport vector from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp.column.column cimport column, column_view -from cudf._lib.cpp.table.table cimport table, table_view -from cudf._lib.cpp.utilities.host_span cimport host_span +from cudf._lib.pylibcudf.libcudf.column.column cimport column, column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table, table_view +from cudf._lib.pylibcudf.libcudf.utilities.host_span cimport host_span cdef extern from "cudf/concatenate.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/contiguous_split.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/contiguous_split.pxd similarity index 80% rename from python/cudf/cudf/_lib/cpp/contiguous_split.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/contiguous_split.pxd index 134e4ed0723..b06feacb016 100644 --- a/python/cudf/cudf/_lib/cpp/contiguous_split.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/contiguous_split.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from libc.stdint cimport uint8_t from libcpp.memory cimport unique_ptr @@ -6,8 +6,8 @@ from libcpp.vector cimport vector from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/contiguous_split.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/copying.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/copying.pxd similarity index 91% rename from python/cudf/cudf/_lib/cpp/copying.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/copying.pxd index 053e2299f22..001489d69bf 100644 --- a/python/cudf/cudf/_lib/cpp/copying.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/copying.pxd @@ -8,13 +8,16 @@ from libcpp.vector cimport vector from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type from cudf._lib.exception_handler cimport cudf_exception_handler +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type ctypedef const scalar constscalar diff --git a/python/cudf/cudf/_lib/cpp/copying.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/copying.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/copying.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/copying.pyx diff --git a/python/cudf/cudf/_lib/cpp/datetime.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/datetime.pxd similarity index 90% rename from python/cudf/cudf/_lib/cpp/datetime.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/datetime.pxd index d03587745e1..7db77b9c7c5 100644 --- a/python/cudf/cudf/_lib/cpp/datetime.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/datetime.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar cdef extern from "cudf/datetime.hpp" namespace "cudf::datetime" nogil: diff --git a/python/cudf/cudf/_lib/cpp/expressions.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/expressions.pxd similarity index 92% rename from python/cudf/cudf/_lib/cpp/expressions.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/expressions.pxd index 291afbcc62a..279d969db50 100644 --- a/python/cudf/cudf/_lib/cpp/expressions.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/expressions.pxd @@ -1,16 +1,16 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.scalar.scalar cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport ( duration_scalar, numeric_scalar, timestamp_scalar, ) -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/ast/expressions.hpp" namespace "cudf::ast" nogil: diff --git a/python/cudf/cudf/_lib/cpp/filling.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/filling.pxd similarity index 67% rename from python/cudf/cudf/_lib/cpp/filling.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/filling.pxd index e412f294537..16ed682f930 100644 --- a/python/cudf/cudf/_lib/cpp/filling.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/filling.pxd @@ -1,14 +1,17 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/filling.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/groupby.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/groupby.pxd similarity index 83% rename from python/cudf/cudf/_lib/cpp/groupby.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/groupby.pxd index 8bbefcde0dd..16607cc3711 100644 --- a/python/cudf/cudf/_lib/cpp/groupby.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/groupby.pxd @@ -6,24 +6,24 @@ from libcpp.memory cimport unique_ptr from libcpp.pair cimport pair from libcpp.vector cimport vector -from cudf._lib.cpp.aggregation cimport ( +from cudf._lib.pylibcudf.libcudf.aggregation cimport ( groupby_aggregation, groupby_scan_aggregation, ) -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.replace cimport replace_policy -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.replace cimport replace_policy +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( null_order, null_policy, order, size_type, sorted, ) -from cudf._lib.cpp.utilities.host_span cimport host_span +from cudf._lib.pylibcudf.libcudf.utilities.host_span cimport host_span # workaround for https://github.com/cython/cython/issues/3885 ctypedef const scalar constscalar diff --git a/python/cudf/cudf/_lib/cpp/hash.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/hash.pxd similarity index 86% rename from python/cudf/cudf/_lib/cpp/hash.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/hash.pxd index d55e244dc2c..5346252df69 100644 --- a/python/cudf/cudf/_lib/cpp/hash.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/hash.pxd @@ -4,9 +4,9 @@ from libc.stdint cimport uint32_t, uint64_t from libcpp.memory cimport unique_ptr from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/hashing.hpp" namespace "cudf::hashing" nogil: diff --git a/python/cudf/cudf/_lib/cpp/interop.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/interop.pxd similarity index 83% rename from python/cudf/cudf/_lib/cpp/interop.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/interop.pxd index 88e9d83ee98..471b78505fb 100644 --- a/python/cudf/cudf/_lib/cpp/interop.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/interop.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport shared_ptr, unique_ptr from libcpp.string cimport string @@ -7,9 +7,9 @@ from pyarrow.lib cimport CScalar, CTable from cudf._lib.types import cudf_to_np_types, np_to_cudf_types -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "dlpack/dlpack.h" nogil: diff --git a/python/cudf/cudf/_lib/cpp/io/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/io/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/io/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/io/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/io/arrow_io_source.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/arrow_io_source.pxd similarity index 77% rename from python/cudf/cudf/_lib/cpp/io/arrow_io_source.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/arrow_io_source.pxd index 4aef4841844..1d2138f8d10 100644 --- a/python/cudf/cudf/_lib/cpp/io/arrow_io_source.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/arrow_io_source.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from libcpp.memory cimport shared_ptr from libcpp.string cimport string from pyarrow.includes.libarrow cimport CRandomAccessFile -cimport cudf._lib.cpp.io.datasource as cudf_io_datasource +cimport cudf._lib.pylibcudf.libcudf.io.datasource as cudf_io_datasource cdef extern from "cudf/io/arrow_io_source.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/io/avro.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/avro.pxd similarity index 88% rename from python/cudf/cudf/_lib/cpp/io/avro.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/avro.pxd index 9b683e5bce3..530df5aa8f1 100644 --- a/python/cudf/cudf/_lib/cpp/io/avro.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/avro.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.string cimport string from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types -from cudf._lib.cpp.types cimport size_type +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/io/avro.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/io/csv.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/csv.pxd similarity index 97% rename from python/cudf/cudf/_lib/cpp/io/csv.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/csv.pxd index e7c0fec2e3d..754dd37d53f 100644 --- a/python/cudf/cudf/_lib/cpp/io/csv.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/csv.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport uint8_t from libcpp cimport bool @@ -7,9 +7,9 @@ from libcpp.memory cimport shared_ptr, unique_ptr from libcpp.string cimport string from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types -cimport cudf._lib.cpp.table.table_view as cudf_table_view -from cudf._lib.cpp.types cimport data_type, size_type +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.table.table_view as cudf_table_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type cdef extern from "cudf/io/csv.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/io/data_sink.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/data_sink.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/io/data_sink.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/data_sink.pxd diff --git a/python/cudf/cudf/_lib/cpp/io/datasource.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/datasource.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/io/datasource.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/datasource.pxd diff --git a/python/cudf/cudf/_lib/cpp/io/json.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/json.pxd similarity index 96% rename from python/cudf/cudf/_lib/cpp/io/json.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/json.pxd index 1e1057beede..7e64a4cae29 100644 --- a/python/cudf/cudf/_lib/cpp/io/json.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/json.pxd @@ -7,9 +7,9 @@ from libcpp.memory cimport shared_ptr, unique_ptr from libcpp.string cimport string from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types -cimport cudf._lib.cpp.table.table_view as cudf_table_view -from cudf._lib.cpp.types cimport data_type, size_type +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.table.table_view as cudf_table_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type cdef extern from "cudf/io/json.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/io/orc.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/orc.pxd similarity index 97% rename from python/cudf/cudf/_lib/cpp/io/orc.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/orc.pxd index d5bb1726a43..e553515dfdf 100644 --- a/python/cudf/cudf/_lib/cpp/io/orc.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/orc.pxd @@ -8,9 +8,9 @@ from libcpp.optional cimport optional from libcpp.string cimport string from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types -cimport cudf._lib.cpp.table.table_view as cudf_table_view -from cudf._lib.cpp.types cimport data_type, size_type +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.table.table_view as cudf_table_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type cdef extern from "cudf/io/orc.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/io/orc_metadata.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/orc_metadata.pxd similarity index 96% rename from python/cudf/cudf/_lib/cpp/io/orc_metadata.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/orc_metadata.pxd index aad4f1c6870..a23655b06f8 100644 --- a/python/cudf/cudf/_lib/cpp/io/orc_metadata.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/orc_metadata.pxd @@ -6,7 +6,7 @@ from libcpp.optional cimport optional from libcpp.string cimport string from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types from cudf._lib.variant cimport monostate, variant diff --git a/python/cudf/cudf/_lib/cpp/io/parquet.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/parquet.pxd similarity index 97% rename from python/cudf/cudf/_lib/cpp/io/parquet.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/parquet.pxd index 1680eb43700..b7f3f89f71c 100644 --- a/python/cudf/cudf/_lib/cpp/io/parquet.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/parquet.pxd @@ -9,10 +9,10 @@ from libcpp.optional cimport optional from libcpp.string cimport string from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types -cimport cudf._lib.cpp.table.table_view as cudf_table_view -from cudf._lib.cpp.expressions cimport expression -from cudf._lib.cpp.types cimport data_type, size_type +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types +cimport cudf._lib.pylibcudf.libcudf.table.table_view as cudf_table_view +from cudf._lib.pylibcudf.libcudf.expressions cimport expression +from cudf._lib.pylibcudf.libcudf.types cimport data_type, size_type cdef extern from "cudf/io/parquet.hpp" namespace "cudf::io" nogil: diff --git a/python/cudf/cudf/_lib/cpp/io/parquet_metadata.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/parquet_metadata.pxd similarity index 89% rename from python/cudf/cudf/_lib/cpp/io/parquet_metadata.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/parquet_metadata.pxd index e9def2aea5d..34a299b73ab 100644 --- a/python/cudf/cudf/_lib/cpp/io/parquet_metadata.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/parquet_metadata.pxd @@ -5,8 +5,8 @@ from libcpp.string cimport string from libcpp.unordered_map cimport unordered_map from libcpp.vector cimport vector -cimport cudf._lib.cpp.io.types as cudf_io_types -from cudf._lib.cpp.types cimport size_type +cimport cudf._lib.pylibcudf.libcudf.io.types as cudf_io_types +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/io/parquet_metadata.hpp" namespace "cudf::io" nogil: diff --git a/python/cudf/cudf/_lib/cpp/io/text.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/text.pxd similarity index 93% rename from python/cudf/cudf/_lib/cpp/io/text.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/text.pxd index 368b014ea4b..bec223d4079 100644 --- a/python/cudf/cudf/_lib/cpp/io/text.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/text.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport uint64_t from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column cimport column cdef extern from "cudf/io/text/byte_range_info.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/io/timezone.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/timezone.pxd similarity index 75% rename from python/cudf/cudf/_lib/cpp/io/timezone.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/timezone.pxd index 927c2118473..88cb5544dc1 100644 --- a/python/cudf/cudf/_lib/cpp/io/timezone.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/timezone.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.optional cimport optional from libcpp.string cimport string -from cudf._lib.cpp.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table cimport table cdef extern from "cudf/timezone.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/io/types.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/types.pxd similarity index 91% rename from python/cudf/cudf/_lib/cpp/io/types.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/io/types.pxd index d8cc329b0a0..4725c4e5937 100644 --- a/python/cudf/cudf/_lib/cpp/io/types.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/io/types.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport uint8_t from libcpp cimport bool @@ -10,11 +10,11 @@ from libcpp.unordered_map cimport unordered_map from libcpp.vector cimport vector from pyarrow.includes.libarrow cimport CRandomAccessFile -cimport cudf._lib.cpp.io.data_sink as cudf_io_data_sink -cimport cudf._lib.cpp.io.datasource as cudf_io_datasource -cimport cudf._lib.cpp.table.table_view as cudf_table_view -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport size_type +cimport cudf._lib.pylibcudf.libcudf.io.data_sink as cudf_io_data_sink +cimport cudf._lib.pylibcudf.libcudf.io.datasource as cudf_io_datasource +cimport cudf._lib.pylibcudf.libcudf.table.table_view as cudf_table_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/io/types.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/join.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/join.pxd similarity index 87% rename from python/cudf/cudf/_lib/cpp/join.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/join.pxd index 7508052646a..89a30f0f255 100644 --- a/python/cudf/cudf/_lib/cpp/join.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/join.pxd @@ -7,10 +7,10 @@ from libcpp.vector cimport vector from rmm._lib.device_uvector cimport device_uvector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport null_equality, size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport null_equality, size_type ctypedef unique_ptr[device_uvector[size_type]] gather_map_type ctypedef pair[gather_map_type, gather_map_type] gather_map_pair_type diff --git a/python/cudf/cudf/_lib/cpp/labeling.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/labeling.pxd similarity index 71% rename from python/cudf/cudf/_lib/cpp/labeling.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/labeling.pxd index af9c4bb9a04..54731bf29af 100644 --- a/python/cudf/cudf/_lib/cpp/labeling.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/labeling.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/labeling/label_bins.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/lists/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/lists/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/lists/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/lists/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/lists/combine.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/combine.pxd similarity index 73% rename from python/cudf/cudf/_lib/cpp/lists/combine.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/combine.pxd index a7ad8e7ba41..728bd840f71 100644 --- a/python/cudf/cudf/_lib/cpp/lists/combine.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/combine.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/lists/combine.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/lists/contains.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/contains.pxd similarity index 63% rename from python/cudf/cudf/_lib/cpp/lists/contains.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/contains.pxd index e86c73deed2..721679f35c7 100644 --- a/python/cudf/cudf/_lib/cpp/lists/contains.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/contains.pxd @@ -1,12 +1,14 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view -from cudf._lib.cpp.scalar.scalar cimport scalar from cudf._lib.exception_handler cimport cudf_exception_handler +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar cdef extern from "cudf/lists/contains.hpp" namespace "cudf::lists" nogil: diff --git a/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/count_elements.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/count_elements.pxd new file mode 100644 index 00000000000..38bdd4db0bb --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/count_elements.pxd @@ -0,0 +1,12 @@ +# Copyright (c) 2021-2024, NVIDIA CORPORATION. + +from libcpp.memory cimport unique_ptr + +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) + + +cdef extern from "cudf/lists/count_elements.hpp" namespace "cudf::lists" nogil: + cdef unique_ptr[column] count_elements(const lists_column_view) except + diff --git a/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/explode.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/explode.pxd new file mode 100644 index 00000000000..622a866f593 --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/explode.pxd @@ -0,0 +1,14 @@ +# Copyright (c) 2021-2024, NVIDIA CORPORATION. + +from libcpp.memory cimport unique_ptr + +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type + + +cdef extern from "cudf/lists/explode.hpp" namespace "cudf" nogil: + cdef unique_ptr[table] explode_outer( + const table_view, + size_type explode_column_idx, + ) except + diff --git a/python/cudf/cudf/_lib/cpp/lists/extract.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/extract.pxd similarity index 56% rename from python/cudf/cudf/_lib/cpp/lists/extract.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/extract.pxd index 93a886d7268..caa12f41914 100644 --- a/python/cudf/cudf/_lib/cpp/lists/extract.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/extract.pxd @@ -1,10 +1,12 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column, column_view -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column, column_view +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/lists/extract.hpp" namespace "cudf::lists" nogil: diff --git a/python/cudf/cudf/_lib/cpp/lists/gather.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/gather.pxd similarity index 57% rename from python/cudf/cudf/_lib/cpp/lists/gather.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/gather.pxd index ea664eee82e..17b4c1877a6 100644 --- a/python/cudf/cudf/_lib/cpp/lists/gather.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/gather.pxd @@ -1,9 +1,11 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) cdef extern from "cudf/lists/gather.hpp" namespace "cudf::lists" nogil: diff --git a/python/cudf/cudf/_lib/cpp/lists/lists_column_view.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/lists_column_view.pxd similarity index 69% rename from python/cudf/cudf/_lib/cpp/lists/lists_column_view.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/lists_column_view.pxd index 793f4b8750d..dbafc415e45 100644 --- a/python/cudf/cudf/_lib/cpp/lists/lists_column_view.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/lists_column_view.pxd @@ -1,7 +1,10 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/lists/lists_column_view.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/lists/sorting.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/sorting.pxd similarity index 51% rename from python/cudf/cudf/_lib/cpp/lists/sorting.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/sorting.pxd index 2115885ed95..145ab41302f 100644 --- a/python/cudf/cudf/_lib/cpp/lists/sorting.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/sorting.pxd @@ -1,10 +1,12 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view -from cudf._lib.cpp.types cimport null_order, order +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport null_order, order cdef extern from "cudf/lists/sorting.hpp" namespace "cudf::lists" nogil: diff --git a/python/cudf/cudf/_lib/cpp/lists/stream_compaction.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/stream_compaction.pxd similarity index 52% rename from python/cudf/cudf/_lib/cpp/lists/stream_compaction.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/lists/stream_compaction.pxd index 58c1ab1dcec..22b91df7192 100644 --- a/python/cudf/cudf/_lib/cpp/lists/stream_compaction.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/lists/stream_compaction.pxd @@ -1,10 +1,12 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view -from cudf._lib.cpp.types cimport nan_equality, null_equality +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport nan_equality, null_equality cdef extern from "cudf/lists/stream_compaction.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/merge.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/merge.pxd similarity index 62% rename from python/cudf/cudf/_lib/cpp/merge.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/merge.pxd index 32fe14ac479..dacb3dc2d74 100644 --- a/python/cudf/cudf/_lib/cpp/merge.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/merge.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.vector cimport vector -cimport cudf._lib.cpp.types as libcudf_types -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/merge.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/null_mask.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/null_mask.pxd similarity index 76% rename from python/cudf/cudf/_lib/cpp/null_mask.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/null_mask.pxd index bd0eb684690..0cab404c05f 100644 --- a/python/cudf/cudf/_lib/cpp/null_mask.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/null_mask.pxd @@ -1,13 +1,17 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t from libcpp.pair cimport pair from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport bitmask_type, mask_state, size_type +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( + bitmask_type, + mask_state, + size_type, +) ctypedef int32_t underlying_type_t_mask_state diff --git a/python/cudf/cudf/_lib/cpp/nvtext/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/nvtext/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/nvtext/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/nvtext/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/nvtext/byte_pair_encode.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/byte_pair_encode.pxd similarity index 67% rename from python/cudf/cudf/_lib/cpp/nvtext/byte_pair_encode.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/byte_pair_encode.pxd index e678e4e84db..033a820d2ef 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/byte_pair_encode.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/byte_pair_encode.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar cdef extern from "nvtext/byte_pair_encoding.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/edit_distance.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/edit_distance.pxd similarity index 67% rename from python/cudf/cudf/_lib/cpp/nvtext/edit_distance.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/edit_distance.pxd index 11de596ec8f..ca1f6650a5a 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/edit_distance.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/edit_distance.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "nvtext/edit_distance.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/generate_ngrams.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/generate_ngrams.pxd similarity index 63% rename from python/cudf/cudf/_lib/cpp/nvtext/generate_ngrams.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/generate_ngrams.pxd index 75822054e4a..2034b1c1ee5 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/generate_ngrams.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/generate_ngrams.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "nvtext/generate_ngrams.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/jaccard.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/jaccard.pxd similarity index 52% rename from python/cudf/cudf/_lib/cpp/nvtext/jaccard.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/jaccard.pxd index a77f95f07ac..789a1a2c35a 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/jaccard.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/jaccard.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "nvtext/jaccard.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/minhash.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/minhash.pxd similarity index 63% rename from python/cudf/cudf/_lib/cpp/nvtext/minhash.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/minhash.pxd index 08b3330953e..fc5577bf3f9 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/minhash.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/minhash.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "nvtext/minhash.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/ngrams_tokenize.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/ngrams_tokenize.pxd similarity index 50% rename from python/cudf/cudf/_lib/cpp/nvtext/ngrams_tokenize.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/ngrams_tokenize.pxd index d716df22546..229f4d8f5a3 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/ngrams_tokenize.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/ngrams_tokenize.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "nvtext/ngrams_tokenize.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/normalize.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/normalize.pxd similarity index 66% rename from python/cudf/cudf/_lib/cpp/nvtext/normalize.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/normalize.pxd index f012670317a..65c63b089df 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/normalize.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/normalize.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "nvtext/normalize.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/replace.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/replace.pxd similarity index 63% rename from python/cudf/cudf/_lib/cpp/nvtext/replace.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/replace.pxd index c4e5258a710..aaad28d2684 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/replace.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/replace.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "nvtext/replace.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/stemmer.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/stemmer.pxd similarity index 74% rename from python/cudf/cudf/_lib/cpp/nvtext/stemmer.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/stemmer.pxd index 5a92b45b6dd..040d4c9de63 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/stemmer.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/stemmer.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "nvtext/stemmer.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/subword_tokenize.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/subword_tokenize.pxd similarity index 89% rename from python/cudf/cudf/_lib/cpp/nvtext/subword_tokenize.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/subword_tokenize.pxd index 226fa613f2c..cce40bcd3f6 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/subword_tokenize.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/subword_tokenize.pxd @@ -1,12 +1,12 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport uint16_t, uint32_t from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "nvtext/subword_tokenize.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/nvtext/tokenize.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/tokenize.pxd similarity index 81% rename from python/cudf/cudf/_lib/cpp/nvtext/tokenize.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/tokenize.pxd index 3cc3fd6251a..721a6cabd01 100644 --- a/python/cudf/cudf/_lib/cpp/nvtext/tokenize.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/nvtext/tokenize.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "nvtext/tokenize.hpp" namespace "nvtext" nogil: diff --git a/python/cudf/cudf/_lib/cpp/partitioning.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/partitioning.pxd similarity index 64% rename from python/cudf/cudf/_lib/cpp/partitioning.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/partitioning.pxd index 5c58dbcc4ac..babb167d2a0 100644 --- a/python/cudf/cudf/_lib/cpp/partitioning.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/partitioning.pxd @@ -1,15 +1,15 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport uint32_t from libcpp.memory cimport unique_ptr from libcpp.pair cimport pair from libcpp.vector cimport vector -cimport cudf._lib.cpp.types as libcudf_types -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/partitioning.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/quantiles.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/quantiles.pxd similarity index 65% rename from python/cudf/cudf/_lib/cpp/quantiles.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/quantiles.pxd index 03fda16856c..32cfec2d4fc 100644 --- a/python/cudf/cudf/_lib/cpp/quantiles.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/quantiles.pxd @@ -1,14 +1,14 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( interpolation, null_order, order, diff --git a/python/cudf/cudf/_lib/cpp/reduce.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/reduce.pxd similarity index 69% rename from python/cudf/cudf/_lib/cpp/reduce.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/reduce.pxd index 9c893fe9bcb..3ae1f1a2906 100644 --- a/python/cudf/cudf/_lib/cpp/reduce.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/reduce.pxd @@ -4,11 +4,14 @@ from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.utility cimport pair -from cudf._lib.cpp.aggregation cimport reduce_aggregation, scan_aggregation -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.aggregation cimport ( + reduce_aggregation, + scan_aggregation, +) +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/reduction.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/reduce.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/reduce.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/reduce.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/reduce.pyx diff --git a/python/cudf/cudf/_lib/cpp/replace.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/replace.pxd similarity index 85% rename from python/cudf/cudf/_lib/cpp/replace.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/replace.pxd index 5d57f01b816..e67efbdaba0 100644 --- a/python/cudf/cudf/_lib/cpp/replace.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/replace.pxd @@ -5,9 +5,12 @@ from libcpp.memory cimport unique_ptr from cudf._lib.types import cudf_to_np_types, np_to_cudf_types -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar cdef extern from "cudf/replace.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/replace.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/replace.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/replace.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/replace.pyx diff --git a/python/cudf/cudf/_lib/cpp/reshape.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/reshape.pxd similarity index 50% rename from python/cudf/cudf/_lib/cpp/reshape.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/reshape.pxd index 5b9d40aa2ad..dfd9a71c3d3 100644 --- a/python/cudf/cudf/_lib/cpp/reshape.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/reshape.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/reshape.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/rolling.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/rolling.pxd similarity index 71% rename from python/cudf/cudf/_lib/cpp/rolling.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/rolling.pxd index 6b620e3a4c0..d7844f99a73 100644 --- a/python/cudf/cudf/_lib/cpp/rolling.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/rolling.pxd @@ -4,10 +4,10 @@ from libcpp.memory cimport unique_ptr from cudf._lib.types import cudf_to_np_types, np_to_cudf_types -from cudf._lib.cpp.aggregation cimport rolling_aggregation -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.aggregation cimport rolling_aggregation +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/rolling.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/round.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/round.pxd similarity index 71% rename from python/cudf/cudf/_lib/cpp/round.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/round.pxd index 66d76c35d72..06ff42485ea 100644 --- a/python/cudf/cudf/_lib/cpp/round.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/round.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/round.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/scalar/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/scalar/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/scalar/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/scalar/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/scalar/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/scalar/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/scalar/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/scalar/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/scalar/scalar.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/scalar/scalar.pxd similarity index 89% rename from python/cudf/cudf/_lib/cpp/scalar/scalar.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/scalar/scalar.pxd index b5e9b0ba06b..662eb90096e 100644 --- a/python/cudf/cudf/_lib/cpp/scalar/scalar.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/scalar/scalar.pxd @@ -1,13 +1,13 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t, int64_t from libcpp cimport bool from libcpp.string cimport string -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport data_type -from cudf._lib.cpp.wrappers.decimals cimport scale_type +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type +from cudf._lib.pylibcudf.libcudf.wrappers.decimals cimport scale_type cdef extern from "cudf/scalar/scalar.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/search.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/search.pxd similarity index 69% rename from python/cudf/cudf/_lib/cpp/search.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/search.pxd index 8baef0aa1b9..e2247a1366f 100644 --- a/python/cudf/cudf/_lib/cpp/search.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/search.pxd @@ -1,12 +1,12 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.vector cimport vector -cimport cudf._lib.cpp.types as libcudf_types -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table_view cimport table_view +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/search.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/sorting.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/sorting.pxd similarity index 86% rename from python/cudf/cudf/_lib/cpp/sorting.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/sorting.pxd index 86dc0f0de95..3d7d3aa2790 100644 --- a/python/cudf/cudf/_lib/cpp/sorting.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/sorting.pxd @@ -6,12 +6,12 @@ from libcpp.vector cimport vector from cudf._lib.types import cudf_to_np_types, np_to_cudf_types -cimport cudf._lib.cpp.types as libcudf_types -from cudf._lib.cpp.aggregation cimport rank_method -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types +from cudf._lib.pylibcudf.libcudf.aggregation cimport rank_method +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/sorting.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/stream_compaction.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/stream_compaction.pxd similarity index 88% rename from python/cudf/cudf/_lib/cpp/stream_compaction.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/stream_compaction.pxd index 55854a9444f..11d803e5b76 100644 --- a/python/cudf/cudf/_lib/cpp/stream_compaction.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/stream_compaction.pxd @@ -6,11 +6,11 @@ from libcpp.vector cimport vector from cudf._lib.types import cudf_to_np_types, np_to_cudf_types -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( nan_equality, nan_policy, null_equality, diff --git a/python/cudf/cudf/_lib/cpp/stream_compaction.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/stream_compaction.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/stream_compaction.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/stream_compaction.pyx diff --git a/python/cudf/cudf/_lib/cpp/strings/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/strings/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/strings/attributes.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/attributes.pxd similarity index 68% rename from python/cudf/cudf/_lib/cpp/strings/attributes.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/attributes.pxd index 31133b45b6d..c4d52c83663 100644 --- a/python/cudf/cudf/_lib/cpp/strings/attributes.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/attributes.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/strings/attributes.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/capitalize.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/capitalize.pxd similarity index 67% rename from python/cudf/cudf/_lib/cpp/strings/capitalize.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/capitalize.pxd index d193a8265b1..f95d4f35566 100644 --- a/python/cudf/cudf/_lib/cpp/strings/capitalize.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/capitalize.pxd @@ -1,8 +1,8 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/strings/capitalize.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/case.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/case.pxd similarity index 67% rename from python/cudf/cudf/_lib/cpp/strings/case.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/case.pxd index 01cd08c10ff..9ccd2737afe 100644 --- a/python/cudf/cudf/_lib/cpp/strings/case.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/case.pxd @@ -1,8 +1,8 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/strings/case.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/char_types.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/char_types.pxd similarity index 84% rename from python/cudf/cudf/_lib/cpp/strings/char_types.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/char_types.pxd index ae921c6ead9..408b3687c4a 100644 --- a/python/cudf/cudf/_lib/cpp/strings/char_types.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/char_types.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar cdef extern from "cudf/strings/char_types/char_types.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/strings/combine.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/combine.pxd similarity index 80% rename from python/cudf/cudf/_lib/cpp/strings/combine.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/combine.pxd index 2b10427283f..b05e46af0d6 100644 --- a/python/cudf/cudf/_lib/cpp/strings/combine.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/combine.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/strings/combine.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/contains.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/contains.pxd similarity index 64% rename from python/cudf/cudf/_lib/cpp/strings/contains.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/contains.pxd index 94c2fb21fc1..f8ed253ff3c 100644 --- a/python/cudf/cudf/_lib/cpp/strings/contains.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/contains.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program cdef extern from "cudf/strings/contains.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/convert/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/convert/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_booleans.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_booleans.pxd similarity index 62% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_booleans.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_booleans.pxd index 96cb43973f1..daac2b5be28 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_booleans.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_booleans.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar cdef extern from "cudf/strings/convert/convert_booleans.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_datetime.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_datetime.pxd similarity index 70% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_datetime.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_datetime.pxd index 5e7380c1d4e..263cee4fe1e 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_datetime.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_datetime.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/strings/convert/convert_datetime.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_durations.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_durations.pxd similarity index 65% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_durations.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_durations.pxd index 8c54fd52aa2..af357b9bde4 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_durations.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_durations.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/strings/convert/convert_durations.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_fixed_point.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_fixed_point.pxd similarity index 66% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_fixed_point.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_fixed_point.pxd index a993c5b17b8..91c1abdb5e4 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_fixed_point.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_fixed_point.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/strings/convert/convert_fixed_point.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_floats.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_floats.pxd similarity index 64% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_floats.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_floats.pxd index 6388f43077d..5fbf2be0244 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_floats.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_floats.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/strings/convert/convert_floats.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_integers.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_integers.pxd similarity index 75% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_integers.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_integers.pxd index b5443979b81..3d6c59cbfcf 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_integers.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_integers.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/strings/convert/convert_integers.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_ipv4.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_ipv4.pxd similarity index 69% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_ipv4.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_ipv4.pxd index d6e881caea4..86de956b6b6 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_ipv4.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_ipv4.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/strings/convert/convert_ipv4.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_lists.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_lists.pxd similarity index 53% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_lists.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_lists.pxd index 99bb80a813d..aba2dbcca64 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_lists.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_lists.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar cdef extern from "cudf/strings/convert/convert_lists.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/convert/convert_urls.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_urls.pxd similarity index 62% rename from python/cudf/cudf/_lib/cpp/strings/convert/convert_urls.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_urls.pxd index 5d9991dd610..fb7e0cae6de 100644 --- a/python/cudf/cudf/_lib/cpp/strings/convert/convert_urls.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/convert/convert_urls.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/strings/convert/convert_urls.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/extract.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/extract.pxd new file mode 100644 index 00000000000..57903ca27de --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/extract.pxd @@ -0,0 +1,15 @@ +# Copyright (c) 2020-2024, NVIDIA CORPORATION. + +from libcpp.memory cimport unique_ptr + +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.table.table cimport table + + +cdef extern from "cudf/strings/extract.hpp" namespace "cudf::strings" nogil: + + cdef unique_ptr[table] extract( + column_view source_strings, + regex_program) except + diff --git a/python/cudf/cudf/_lib/cpp/strings/find.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/find.pxd similarity index 83% rename from python/cudf/cudf/_lib/cpp/strings/find.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/find.pxd index dfbdebb9651..04e2ed554ee 100644 --- a/python/cudf/cudf/_lib/cpp/strings/find.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/find.pxd @@ -3,10 +3,10 @@ from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/find.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/find_multiple.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/find_multiple.pxd similarity index 58% rename from python/cudf/cudf/_lib/cpp/strings/find_multiple.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/find_multiple.pxd index 27b19728f60..1f1adc8e99f 100644 --- a/python/cudf/cudf/_lib/cpp/strings/find_multiple.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/find_multiple.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view cdef extern from "cudf/strings/find_multiple.hpp" namespace "cudf::strings" \ diff --git a/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/findall.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/findall.pxd new file mode 100644 index 00000000000..4bc450b8911 --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/findall.pxd @@ -0,0 +1,14 @@ +# Copyright (c) 2019-2024, NVIDIA CORPORATION. + +from libcpp.memory cimport unique_ptr + +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program + + +cdef extern from "cudf/strings/findall.hpp" namespace "cudf::strings" nogil: + + cdef unique_ptr[column] findall( + column_view source_strings, + regex_program) except + diff --git a/python/cudf/cudf/_lib/cpp/strings/json.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/json.pxd similarity index 75% rename from python/cudf/cudf/_lib/cpp/strings/json.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/json.pxd index eed627c96b5..5926fa1d29f 100644 --- a/python/cudf/cudf/_lib/cpp/strings/json.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/json.pxd @@ -1,12 +1,12 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport scalar, string_scalar +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar, string_scalar cdef extern from "cudf/json/json.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/padding.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/padding.pxd similarity index 54% rename from python/cudf/cudf/_lib/cpp/strings/padding.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/padding.pxd index c3906a5b4c6..26681a1aa00 100644 --- a/python/cudf/cudf/_lib/cpp/strings/padding.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/padding.pxd @@ -1,13 +1,13 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.side_type cimport side_type -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.side_type cimport side_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/padding.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/regex_flags.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/regex_flags.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/regex_flags.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/regex_flags.pxd diff --git a/python/cudf/cudf/_lib/cpp/strings/regex_program.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/regex_program.pxd similarity index 74% rename from python/cudf/cudf/_lib/cpp/strings/regex_program.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/regex_program.pxd index 7818c9c7d01..e92c8bd7737 100644 --- a/python/cudf/cudf/_lib/cpp/strings/regex_program.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/regex_program.pxd @@ -1,9 +1,9 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.strings.regex_flags cimport regex_flags +from cudf._lib.pylibcudf.libcudf.strings.regex_flags cimport regex_flags cdef extern from "cudf/strings/regex/regex_program.hpp" \ diff --git a/python/cudf/cudf/_lib/cpp/strings/repeat.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/repeat.pxd similarity index 60% rename from python/cudf/cudf/_lib/cpp/strings/repeat.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/repeat.pxd index 2a6754b9a11..9e128529406 100644 --- a/python/cudf/cudf/_lib/cpp/strings/repeat.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/repeat.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/repeat_strings.hpp" namespace "cudf::strings" \ diff --git a/python/cudf/cudf/_lib/cpp/strings/replace.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/replace.pxd similarity index 68% rename from python/cudf/cudf/_lib/cpp/strings/replace.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/replace.pxd index 2a9c6913bb3..92e142b33fc 100644 --- a/python/cudf/cudf/_lib/cpp/strings/replace.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/replace.pxd @@ -1,13 +1,13 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/replace.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/replace_re.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/replace_re.pxd similarity index 59% rename from python/cudf/cudf/_lib/cpp/strings/replace_re.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/replace_re.pxd index 94f3d0528a5..739505cd51d 100644 --- a/python/cudf/cudf/_lib/cpp/strings/replace_re.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/replace_re.pxd @@ -1,15 +1,15 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.regex_program cimport regex_program -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/replace_re.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/side_type.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/side_type.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/side_type.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/side_type.pxd diff --git a/python/cudf/cudf/_lib/cpp/strings/split/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/split/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/strings/split/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/strings/split/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/strings/split/partition.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/partition.pxd similarity index 56% rename from python/cudf/cudf/_lib/cpp/strings/split/partition.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/partition.pxd index fb83512e9f0..5119124b3e3 100644 --- a/python/cudf/cudf/_lib/cpp/strings/split/partition.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/partition.pxd @@ -1,12 +1,12 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.table.table cimport table +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.table.table cimport table cdef extern from "cudf/strings/split/partition.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/strings/split/split.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/split.pxd similarity index 76% rename from python/cudf/cudf/_lib/cpp/strings/split/split.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/split.pxd index d6207cd5c76..4f75664e47a 100644 --- a/python/cudf/cudf/_lib/cpp/strings/split/split.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/split/split.pxd @@ -1,14 +1,14 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.regex_program cimport regex_program -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/split/split.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/strip.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/strip.pxd new file mode 100644 index 00000000000..2d6fd6a9e89 --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/strip.pxd @@ -0,0 +1,16 @@ +# Copyright (c) 2020-2024, NVIDIA CORPORATION. + +from libcpp.memory cimport unique_ptr + +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.side_type cimport side_type + + +cdef extern from "cudf/strings/strip.hpp" namespace "cudf::strings" nogil: + + cdef unique_ptr[column] strip( + column_view source_strings, + side_type stype, + string_scalar to_strip) except + diff --git a/python/cudf/cudf/_lib/cpp/strings/substring.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/substring.pxd similarity index 60% rename from python/cudf/cudf/_lib/cpp/strings/substring.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/substring.pxd index 99ea8c7ff3f..02123cc0807 100644 --- a/python/cudf/cudf/_lib/cpp/strings/substring.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/substring.pxd @@ -1,11 +1,11 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport numeric_scalar -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport numeric_scalar +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/slice.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/cpp/strings/translate.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/translate.pxd similarity index 69% rename from python/cudf/cudf/_lib/cpp/strings/translate.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings/translate.pxd index 3239ba314e4..b23ac277216 100644 --- a/python/cudf/cudf/_lib/cpp/strings/translate.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/translate.pxd @@ -1,14 +1,14 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.pair cimport pair from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.types cimport char_utf8 +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.types cimport char_utf8 cdef extern from "cudf/strings/translate.hpp" namespace "cudf::strings" nogil: diff --git a/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/wrap.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/wrap.pxd new file mode 100644 index 00000000000..1d92d445634 --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings/wrap.pxd @@ -0,0 +1,14 @@ +# Copyright (c) 2020-2024, NVIDIA CORPORATION. + +from libcpp.memory cimport unique_ptr + +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type + + +cdef extern from "cudf/strings/wrap.hpp" namespace "cudf::strings" nogil: + + cdef unique_ptr[column] wrap( + column_view source_strings, + size_type width) except + diff --git a/python/cudf/cudf/_lib/cpp/strings_udf.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings_udf.pxd similarity index 81% rename from python/cudf/cudf/_lib/cpp/strings_udf.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/strings_udf.pxd index 7d45bc858f5..b895d5e6925 100644 --- a/python/cudf/cudf/_lib/cpp/strings_udf.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/strings_udf.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. from libc.stdint cimport uint8_t, uint16_t from libcpp.memory cimport unique_ptr @@ -7,9 +7,9 @@ from libcpp.vector cimport vector from rmm._lib.device_buffer cimport DeviceBuffer, device_buffer -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/strings/udf/udf_string.hpp" namespace \ diff --git a/python/cudf/cudf/_lib/cpp/table/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/table/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/table/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/table/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/table/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/table/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/table/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/table/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/table/table.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/table/table.pxd similarity index 62% rename from python/cudf/cudf/_lib/cpp/table/table.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/table/table.pxd index ac93e3def19..737a1327d45 100644 --- a/python/cudf/cudf/_lib/cpp/table/table.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/table/table.pxd @@ -1,11 +1,14 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.table.table_view cimport mutable_table_view, table_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.table.table_view cimport ( + mutable_table_view, + table_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/table/table.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/table/table_view.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/table/table_view.pxd similarity index 77% rename from python/cudf/cudf/_lib/cpp/table/table_view.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/table/table_view.pxd index 728b6d2be4b..00e1a89c025 100644 --- a/python/cudf/cudf/_lib/cpp/table/table_view.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/table/table_view.pxd @@ -1,9 +1,12 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.vector cimport vector -from cudf._lib.cpp.column.column_view cimport column_view, mutable_column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column_view cimport ( + column_view, + mutable_column_view, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type cdef extern from "cudf/table/table_view.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/transform.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/transform.pxd similarity index 70% rename from python/cudf/cudf/_lib/cpp/transform.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/transform.pxd index d9de04b676e..b0a978fe5c5 100644 --- a/python/cudf/cudf/_lib/cpp/transform.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/transform.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr @@ -7,12 +7,16 @@ from libcpp.string cimport string from rmm._lib.device_buffer cimport device_buffer -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.expressions cimport expression -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport bitmask_type, data_type, size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.expressions cimport expression +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( + bitmask_type, + data_type, + size_type, +) cdef extern from "cudf/transform.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/transpose.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/transpose.pxd similarity index 59% rename from python/cudf/cudf/_lib/cpp/transpose.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/transpose.pxd index 8cbfb0055bd..5dcb9c165ad 100644 --- a/python/cudf/cudf/_lib/cpp/transpose.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/transpose.pxd @@ -1,10 +1,10 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.pair cimport pair -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef extern from "cudf/transpose.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/types.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/types.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/types.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/types.pxd diff --git a/python/cudf/cudf/_lib/cpp/types.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/types.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/types.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/types.pyx diff --git a/python/cudf/cudf/_lib/cpp/unary.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/unary.pxd similarity index 84% rename from python/cudf/cudf/_lib/cpp/unary.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/unary.pxd index cc07290b6c4..7f8ae2b7617 100644 --- a/python/cudf/cudf/_lib/cpp/unary.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/unary.pxd @@ -3,9 +3,9 @@ from libc.stdint cimport int32_t from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport data_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport data_type cdef extern from "cudf/unary.hpp" namespace "cudf" nogil: diff --git a/python/cudf/cudf/_lib/cpp/unary.pyx b/python/cudf/cudf/_lib/pylibcudf/libcudf/unary.pyx similarity index 100% rename from python/cudf/cudf/_lib/cpp/unary.pyx rename to python/cudf/cudf/_lib/pylibcudf/libcudf/unary.pyx diff --git a/python/cudf/cudf/_lib/cpp/utilities/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/utilities/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/utilities/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/utilities/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/utilities/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/utilities/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/utilities/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/utilities/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/utilities/host_span.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/utilities/host_span.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/utilities/host_span.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/utilities/host_span.pxd diff --git a/python/cudf/cudf/_lib/cpp/wrappers/__init__.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/__init__.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/wrappers/__init__.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/__init__.pxd diff --git a/python/cudf/cudf/_lib/cpp/wrappers/__init__.py b/python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/__init__.py similarity index 100% rename from python/cudf/cudf/_lib/cpp/wrappers/__init__.py rename to python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/__init__.py diff --git a/python/cudf/cudf/_lib/cpp/wrappers/decimals.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/decimals.pxd similarity index 82% rename from python/cudf/cudf/_lib/cpp/wrappers/decimals.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/decimals.pxd index 858569fd696..09b0c87e4b8 100644 --- a/python/cudf/cudf/_lib/cpp/wrappers/decimals.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/decimals.pxd @@ -1,8 +1,8 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t, int64_t -from cudf._lib.cpp.types cimport int128 +from cudf._lib.pylibcudf.libcudf.types cimport int128 cdef extern from "cudf/fixed_point/fixed_point.hpp" namespace "numeric" nogil: diff --git a/python/cudf/cudf/_lib/cpp/wrappers/durations.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/durations.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/wrappers/durations.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/durations.pxd diff --git a/python/cudf/cudf/_lib/cpp/wrappers/timestamps.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/timestamps.pxd similarity index 100% rename from python/cudf/cudf/_lib/cpp/wrappers/timestamps.pxd rename to python/cudf/cudf/_lib/pylibcudf/libcudf/wrappers/timestamps.pxd diff --git a/python/cudf/cudf/_lib/pylibcudf/lists.pxd b/python/cudf/cudf/_lib/pylibcudf/lists.pxd index cf96dfcb81e..b780d299977 100644 --- a/python/cudf/cudf/_lib/pylibcudf/lists.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/lists.pxd @@ -1,6 +1,6 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/lists.pyx b/python/cudf/cudf/_lib/pylibcudf/lists.pyx index faeca56286e..654f39742b6 100644 --- a/python/cudf/cudf/_lib/pylibcudf/lists.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/lists.pyx @@ -3,9 +3,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp.lists cimport explode as cpp_explode -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.lists cimport explode as cpp_explode +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/merge.pyx b/python/cudf/cudf/_lib/pylibcudf/merge.pyx index 91b2b0ea65b..5aa46c142f6 100644 --- a/python/cudf/cudf/_lib/pylibcudf/merge.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/merge.pyx @@ -4,10 +4,10 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp cimport merge as cpp_merge -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport null_order, order, size_type +from cudf._lib.pylibcudf.libcudf cimport merge as cpp_merge +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport null_order, order, size_type from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/reduce.pxd b/python/cudf/cudf/_lib/pylibcudf/reduce.pxd index a613e877ce2..935efd4acf2 100644 --- a/python/cudf/cudf/_lib/pylibcudf/reduce.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/reduce.pxd @@ -1,6 +1,6 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.reduce cimport scan_type +from cudf._lib.pylibcudf.libcudf.reduce cimport scan_type from .aggregation cimport Aggregation from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/reduce.pyx b/python/cudf/cudf/_lib/pylibcudf/reduce.pyx index d12da712fcf..c272f183007 100644 --- a/python/cudf/cudf/_lib/pylibcudf/reduce.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/reduce.pyx @@ -4,18 +4,22 @@ from cython.operator cimport dereference from libcpp.memory cimport unique_ptr from libcpp.utility cimport move, pair -from cudf._lib.cpp cimport reduce as cpp_reduce -from cudf._lib.cpp.aggregation cimport reduce_aggregation, scan_aggregation -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.reduce cimport scan_type -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf cimport reduce as cpp_reduce +from cudf._lib.pylibcudf.libcudf.aggregation cimport ( + reduce_aggregation, + scan_aggregation, +) +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.reduce cimport scan_type +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar from .aggregation cimport Aggregation from .column cimport Column from .scalar cimport Scalar from .types cimport DataType -from cudf._lib.cpp.reduce import scan_type as ScanType # no-cython-lint +from cudf._lib.pylibcudf.libcudf.reduce import \ + scan_type as ScanType # no-cython-lint cpdef Scalar reduce(Column col, Aggregation agg, DataType data_type): diff --git a/python/cudf/cudf/_lib/pylibcudf/replace.pxd b/python/cudf/cudf/_lib/pylibcudf/replace.pxd index fc42b985c8e..40484c728db 100644 --- a/python/cudf/cudf/_lib/pylibcudf/replace.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/replace.pxd @@ -2,7 +2,7 @@ from libcpp cimport bool -from cudf._lib.cpp.replace cimport replace_policy +from cudf._lib.pylibcudf.libcudf.replace cimport replace_policy from .column cimport Column from .scalar cimport Scalar diff --git a/python/cudf/cudf/_lib/pylibcudf/replace.pyx b/python/cudf/cudf/_lib/pylibcudf/replace.pyx index dd3a733ee3a..6e08e8f64a9 100644 --- a/python/cudf/cudf/_lib/pylibcudf/replace.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/replace.pyx @@ -7,10 +7,10 @@ from libcpp cimport bool from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp cimport replace as cpp_replace -from cudf._lib.cpp.column.column cimport column +from cudf._lib.pylibcudf.libcudf cimport replace as cpp_replace +from cudf._lib.pylibcudf.libcudf.column.column cimport column -from cudf._lib.cpp.replace import \ +from cudf._lib.pylibcudf.libcudf.replace import \ replace_policy as ReplacePolicy # no-cython-lint from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/rolling.pxd b/python/cudf/cudf/_lib/pylibcudf/rolling.pxd index 88d683c0c35..cdadee68d43 100644 --- a/python/cudf/cudf/_lib/pylibcudf/rolling.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/rolling.pxd @@ -1,6 +1,6 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .aggregation cimport Aggregation from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/rolling.pyx b/python/cudf/cudf/_lib/pylibcudf/rolling.pyx index 8a1d83911ca..7aa7828a5dd 100644 --- a/python/cudf/cudf/_lib/pylibcudf/rolling.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/rolling.pyx @@ -4,10 +4,10 @@ from cython.operator cimport dereference from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp cimport rolling as cpp_rolling -from cudf._lib.cpp.aggregation cimport rolling_aggregation -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf cimport rolling as cpp_rolling +from cudf._lib.pylibcudf.libcudf.aggregation cimport rolling_aggregation +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.types cimport size_type from .aggregation cimport Aggregation from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/scalar.pxd b/python/cudf/cudf/_lib/pylibcudf/scalar.pxd index 85744eca902..3de86d93519 100644 --- a/python/cudf/cudf/_lib/pylibcudf/scalar.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/scalar.pxd @@ -5,7 +5,7 @@ from libcpp.memory cimport unique_ptr from rmm._lib.memory_resource cimport DeviceMemoryResource -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar from .types cimport DataType diff --git a/python/cudf/cudf/_lib/pylibcudf/scalar.pyx b/python/cudf/cudf/_lib/pylibcudf/scalar.pyx index 4a2d8f393bd..6799c37cea2 100644 --- a/python/cudf/cudf/_lib/pylibcudf/scalar.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/scalar.pyx @@ -5,7 +5,7 @@ from libcpp.memory cimport unique_ptr from rmm._lib.memory_resource cimport get_current_device_resource -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar from .types cimport DataType diff --git a/python/cudf/cudf/_lib/pylibcudf/search.pyx b/python/cudf/cudf/_lib/pylibcudf/search.pyx index a186167af13..151a39f204f 100644 --- a/python/cudf/cudf/_lib/pylibcudf/search.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/search.pyx @@ -4,9 +4,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp cimport search as cpp_search -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.types cimport null_order, order +from cudf._lib.pylibcudf.libcudf cimport search as cpp_search +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.types cimport null_order, order from .column cimport Column from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/sorting.pxd b/python/cudf/cudf/_lib/pylibcudf/sorting.pxd index 3ed241622c0..a4ea541a03b 100644 --- a/python/cudf/cudf/_lib/pylibcudf/sorting.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/sorting.pxd @@ -2,8 +2,13 @@ from libcpp cimport bool -from cudf._lib.cpp.aggregation cimport rank_method -from cudf._lib.cpp.types cimport null_order, null_policy, order, size_type +from cudf._lib.pylibcudf.libcudf.aggregation cimport rank_method +from cudf._lib.pylibcudf.libcudf.types cimport ( + null_order, + null_policy, + order, + size_type, +) from .column cimport Column from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/sorting.pyx b/python/cudf/cudf/_lib/pylibcudf/sorting.pyx index 1668a3efc7c..8c5a8e26899 100644 --- a/python/cudf/cudf/_lib/pylibcudf/sorting.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/sorting.pyx @@ -4,11 +4,11 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp cimport sorting as cpp_sorting -from cudf._lib.cpp.aggregation cimport rank_method -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport null_order, null_policy, order +from cudf._lib.pylibcudf.libcudf cimport sorting as cpp_sorting +from cudf._lib.pylibcudf.libcudf.aggregation cimport rank_method +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport null_order, null_policy, order from .column cimport Column from .table cimport Table diff --git a/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pxd b/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pxd index 29acc21fc05..6f89aaf90e7 100644 --- a/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pxd @@ -1,7 +1,9 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.stream_compaction cimport duplicate_keep_option -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.stream_compaction cimport ( + duplicate_keep_option, +) +from cudf._lib.pylibcudf.libcudf.types cimport ( nan_equality, nan_policy, null_equality, diff --git a/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pyx b/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pyx index af7a85d31bf..43449d3690a 100644 --- a/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/stream_compaction.pyx @@ -4,11 +4,15 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp cimport stream_compaction as cpp_stream_compaction -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.stream_compaction cimport duplicate_keep_option -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf cimport ( + stream_compaction as cpp_stream_compaction, +) +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.stream_compaction cimport ( + duplicate_keep_option, +) +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport ( nan_equality, nan_policy, null_equality, @@ -16,7 +20,7 @@ from cudf._lib.cpp.types cimport ( size_type, ) -from cudf._lib.cpp.stream_compaction import \ +from cudf._lib.pylibcudf.libcudf.stream_compaction import \ duplicate_keep_option as DuplicateKeepOption # no-cython-lint, isort:skip from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/strings/case.pyx b/python/cudf/cudf/_lib/pylibcudf/strings/case.pyx index 69910fd8c50..3a360fd6b10 100644 --- a/python/cudf/cudf/_lib/pylibcudf/strings/case.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/strings/case.pyx @@ -3,9 +3,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.strings cimport case as cpp_case from cudf._lib.pylibcudf.column cimport Column +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.strings cimport case as cpp_case cpdef Column to_lower(Column input): diff --git a/python/cudf/cudf/_lib/pylibcudf/strings/find.pxd b/python/cudf/cudf/_lib/pylibcudf/strings/find.pxd index 22e933106c7..bb43069f190 100644 --- a/python/cudf/cudf/_lib/pylibcudf/strings/find.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/strings/find.pxd @@ -1,7 +1,7 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.types cimport size_type from cudf._lib.pylibcudf.column cimport Column +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.pylibcudf.scalar cimport Scalar ctypedef fused ColumnOrScalar: diff --git a/python/cudf/cudf/_lib/pylibcudf/strings/find.pyx b/python/cudf/cudf/_lib/pylibcudf/strings/find.pyx index 1d94132a8b3..a0214efd0a1 100644 --- a/python/cudf/cudf/_lib/pylibcudf/strings/find.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/strings/find.pyx @@ -2,14 +2,14 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.strings cimport find as cpp_find from cudf._lib.pylibcudf.column cimport Column +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.strings cimport find as cpp_find from cudf._lib.pylibcudf.scalar cimport Scalar from cython.operator import dereference -from cudf._lib.cpp.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar cpdef Column find( diff --git a/python/cudf/cudf/_lib/pylibcudf/table.pxd b/python/cudf/cudf/_lib/pylibcudf/table.pxd index 7467bfccaa8..e476fc770e3 100644 --- a/python/cudf/cudf/_lib/pylibcudf/table.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/table.pxd @@ -2,8 +2,8 @@ from libcpp.memory cimport unique_ptr -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view cdef class Table: diff --git a/python/cudf/cudf/_lib/pylibcudf/table.pyx b/python/cudf/cudf/_lib/pylibcudf/table.pyx index 1fa60ec2b6c..d93ac78721b 100644 --- a/python/cudf/cudf/_lib/pylibcudf/table.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/table.pyx @@ -5,9 +5,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.table.table cimport table +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/types.pxd b/python/cudf/cudf/_lib/pylibcudf/types.pxd index 6c53636d332..e54a259819e 100644 --- a/python/cudf/cudf/_lib/pylibcudf/types.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/types.pxd @@ -3,7 +3,7 @@ from libc.stdint cimport int32_t from libcpp cimport bool as cbool -from cudf._lib.cpp.types cimport ( +from cudf._lib.pylibcudf.libcudf.types cimport ( data_type, interpolation, mask_state, diff --git a/python/cudf/cudf/_lib/pylibcudf/types.pyx b/python/cudf/cudf/_lib/pylibcudf/types.pyx index baf92223714..ebe4d66fa20 100644 --- a/python/cudf/cudf/_lib/pylibcudf/types.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/types.pyx @@ -2,17 +2,17 @@ from libc.stdint cimport int32_t -from cudf._lib.cpp.types cimport data_type, type_id +from cudf._lib.pylibcudf.libcudf.types cimport data_type, type_id -from cudf._lib.cpp.types import type_id as TypeId # no-cython-lint, isort:skip -from cudf._lib.cpp.types import nan_policy as NanPolicy # no-cython-lint, isort:skip -from cudf._lib.cpp.types import null_policy as NullPolicy # no-cython-lint, isort:skip -from cudf._lib.cpp.types import interpolation as Interpolation # no-cython-lint, isort:skip -from cudf._lib.cpp.types import nan_equality as NanEquality # no-cython-lint, isort:skip -from cudf._lib.cpp.types import null_equality as NullEquality # no-cython-lint, isort:skip -from cudf._lib.cpp.types import null_order as NullOrder # no-cython-lint, isort:skip -from cudf._lib.cpp.types import order as Order # no-cython-lint, isort:skip -from cudf._lib.cpp.types import sorted as Sorted # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import type_id as TypeId # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import nan_policy as NanPolicy # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import null_policy as NullPolicy # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import interpolation as Interpolation # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import nan_equality as NanEquality # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import null_equality as NullEquality # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import null_order as NullOrder # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import order as Order # no-cython-lint, isort:skip +from cudf._lib.pylibcudf.libcudf.types import sorted as Sorted # no-cython-lint, isort:skip cdef class DataType: diff --git a/python/cudf/cudf/_lib/pylibcudf/unary.pxd b/python/cudf/cudf/_lib/pylibcudf/unary.pxd index b4372db4ae2..4aa4543bb80 100644 --- a/python/cudf/cudf/_lib/pylibcudf/unary.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/unary.pxd @@ -1,6 +1,6 @@ # Copyright (c) 2024, NVIDIA CORPORATION. -from cudf._lib.cpp.unary cimport unary_operator +from cudf._lib.pylibcudf.libcudf.unary cimport unary_operator from .column cimport Column from .types cimport DataType diff --git a/python/cudf/cudf/_lib/pylibcudf/unary.pyx b/python/cudf/cudf/_lib/pylibcudf/unary.pyx index 437dd313e85..0879b501a49 100644 --- a/python/cudf/cudf/_lib/pylibcudf/unary.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/unary.pyx @@ -3,11 +3,11 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move -from cudf._lib.cpp cimport unary as cpp_unary -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.unary cimport unary_operator +from cudf._lib.pylibcudf.libcudf cimport unary as cpp_unary +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.unary cimport unary_operator -from cudf._lib.cpp.unary import \ +from cudf._lib.pylibcudf.libcudf.unary import \ unary_operator as UnaryOperator # no-cython-lint from .column cimport Column diff --git a/python/cudf/cudf/_lib/pylibcudf/utils.pxd b/python/cudf/cudf/_lib/pylibcudf/utils.pxd index 7efeaaf7e24..77c05086397 100644 --- a/python/cudf/cudf/_lib/pylibcudf/utils.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/utils.pxd @@ -3,8 +3,8 @@ from libcpp.functional cimport reference_wrapper from libcpp.vector cimport vector -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport bitmask_type +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport bitmask_type cdef void * int_to_void_ptr(Py_ssize_t ptr) nogil diff --git a/python/cudf/cudf/_lib/pylibcudf/utils.pyx b/python/cudf/cudf/_lib/pylibcudf/utils.pyx index ea34a87a72a..b4427e8ecff 100644 --- a/python/cudf/cudf/_lib/pylibcudf/utils.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/utils.pyx @@ -6,8 +6,8 @@ from libc.stdint cimport uintptr_t from libcpp.functional cimport reference_wrapper from libcpp.vector cimport vector -from cudf._lib.cpp.scalar.scalar cimport scalar -from cudf._lib.cpp.types cimport bitmask_type +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.types cimport bitmask_type from .scalar cimport Scalar diff --git a/python/cudf/cudf/_lib/quantiles.pyx b/python/cudf/cudf/_lib/quantiles.pyx index d3a02fa7cbf..3d20454a7ce 100644 --- a/python/cudf/cudf/_lib/quantiles.pyx +++ b/python/cudf/cudf/_lib/quantiles.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -17,15 +17,20 @@ from cudf._lib.types cimport ( from cudf._lib.types import Interpolation -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.quantiles cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.quantiles cimport ( quantile as cpp_quantile, quantiles as cpp_quantile_table, ) -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport interpolation, null_order, order, sorted +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( + interpolation, + null_order, + order, + sorted, +) from cudf._lib.utils cimport columns_from_unique_ptr, table_view_from_columns diff --git a/python/cudf/cudf/_lib/reshape.pyx b/python/cudf/cudf/_lib/reshape.pyx index c237b7b1389..48e386bcf02 100644 --- a/python/cudf/cudf/_lib/reshape.pyx +++ b/python/cudf/cudf/_lib/reshape.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,14 +6,14 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.reshape cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.reshape cimport ( interleave_columns as cpp_interleave_columns, tile as cpp_tile, ) -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.utils cimport columns_from_unique_ptr, table_view_from_columns diff --git a/python/cudf/cudf/_lib/round.pyx b/python/cudf/cudf/_lib/round.pyx index 7eddb1b8cbd..c1c36dd8854 100644 --- a/python/cudf/cudf/_lib/round.pyx +++ b/python/cudf/cudf/_lib/round.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,9 +6,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.round cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.round cimport ( round as cpp_round, rounding_method as cpp_rounding_method, ) diff --git a/python/cudf/cudf/_lib/scalar.pxd b/python/cudf/cudf/_lib/scalar.pxd index 154ee22e796..b57acbb37f1 100644 --- a/python/cudf/cudf/_lib/scalar.pxd +++ b/python/cudf/cudf/_lib/scalar.pxd @@ -5,7 +5,7 @@ from libcpp.memory cimport unique_ptr from rmm._lib.memory_resource cimport DeviceMemoryResource -from cudf._lib.cpp.scalar.scalar cimport scalar +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport scalar cdef class DeviceScalar: diff --git a/python/cudf/cudf/_lib/scalar.pyx b/python/cudf/cudf/_lib/scalar.pyx index aee496e9f1c..e68398498d1 100644 --- a/python/cudf/cudf/_lib/scalar.pyx +++ b/python/cudf/cudf/_lib/scalar.pyx @@ -17,27 +17,27 @@ from cudf._lib.types import LIBCUDF_TO_SUPPORTED_NUMPY_TYPES from cudf.core.dtypes import ListDtype, StructDtype from cudf.core.missing import NA, NaT -cimport cudf._lib.cpp.types as libcudf_types +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types # We currently need this cimport because some of the implementations here # access the c_obj of the scalar, and because we need to be able to call # pylibcudf.Scalar.from_libcudf. Both of those are temporarily acceptable until # DeviceScalar is phased out entirely from cuDF Cython (at which point # cudf.Scalar will be directly backed by pylibcudf.Scalar). -from cudf._lib cimport pylibcudf -from cudf._lib.cpp.scalar.scalar cimport ( +from cudf._lib.pylibcudf cimport Scalar as plc_Scalar +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport ( duration_scalar, list_scalar, scalar, struct_scalar, timestamp_scalar, ) -from cudf._lib.cpp.wrappers.durations cimport ( +from cudf._lib.pylibcudf.libcudf.wrappers.durations cimport ( duration_ms, duration_ns, duration_s, duration_us, ) -from cudf._lib.cpp.wrappers.timestamps cimport ( +from cudf._lib.pylibcudf.libcudf.wrappers.timestamps cimport ( timestamp_ms, timestamp_ns, timestamp_s, @@ -206,7 +206,7 @@ cdef class DeviceScalar: return self._to_host_scalar() cdef const scalar* get_raw_ptr(self) except *: - return ( self.c_value).c_obj.get() + return ( self.c_value).c_obj.get() cpdef bool is_valid(self): """ @@ -230,7 +230,7 @@ cdef class DeviceScalar: """ cdef DeviceScalar s = DeviceScalar.__new__(DeviceScalar) # Note: This line requires pylibcudf to be cimported - s.c_value = pylibcudf.Scalar.from_libcudf(move(ptr)) + s.c_value = plc_Scalar.from_libcudf(move(ptr)) s._set_dtype(dtype) return s @@ -369,11 +369,11 @@ def _create_proxy_nat_scalar(dtype): nat = dtype.type('NaT').astype(dtype) if dtype.type == np.datetime64: _set_datetime64_from_np_scalar( - ( result.c_value).c_obj, nat, dtype, True + ( result.c_value).c_obj, nat, dtype, True ) elif dtype.type == np.timedelta64: _set_timedelta64_from_np_scalar( - ( result.c_value).c_obj, nat, dtype, True + ( result.c_value).c_obj, nat, dtype, True ) return result else: diff --git a/python/cudf/cudf/_lib/sort.pyx b/python/cudf/cudf/_lib/sort.pyx index b2b84c17cf4..ff9565b9a89 100644 --- a/python/cudf/cudf/_lib/sort.pyx +++ b/python/cudf/cudf/_lib/sort.pyx @@ -10,11 +10,11 @@ from libcpp.utility cimport move from libcpp.vector cimport vector from cudf._lib.column cimport Column -from cudf._lib.cpp.aggregation cimport rank_method -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.search cimport lower_bound, upper_bound -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport null_order, order as cpp_order +from cudf._lib.pylibcudf.libcudf.aggregation cimport rank_method +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.search cimport lower_bound, upper_bound +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport null_order, order as cpp_order from cudf._lib.utils cimport ( columns_from_pylibcudf_table, table_view_from_columns, diff --git a/python/cudf/cudf/_lib/string_casting.pyx b/python/cudf/cudf/_lib/string_casting.pyx index 3826e71f850..dfad7fd101c 100644 --- a/python/cudf/cudf/_lib/string_casting.pyx +++ b/python/cudf/cudf/_lib/string_casting.pyx @@ -12,39 +12,39 @@ from libcpp.memory cimport unique_ptr from libcpp.string cimport string from libcpp.utility cimport move -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.convert.convert_booleans cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_booleans cimport ( from_booleans as cpp_from_booleans, to_booleans as cpp_to_booleans, ) -from cudf._lib.cpp.strings.convert.convert_datetime cimport ( +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_datetime cimport ( from_timestamps as cpp_from_timestamps, is_timestamp as cpp_is_timestamp, to_timestamps as cpp_to_timestamps, ) -from cudf._lib.cpp.strings.convert.convert_durations cimport ( +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_durations cimport ( from_durations as cpp_from_durations, to_durations as cpp_to_durations, ) -from cudf._lib.cpp.strings.convert.convert_floats cimport ( +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_floats cimport ( from_floats as cpp_from_floats, to_floats as cpp_to_floats, ) -from cudf._lib.cpp.strings.convert.convert_integers cimport ( +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_integers cimport ( from_integers as cpp_from_integers, hex_to_integers as cpp_hex_to_integers, integers_to_hex as cpp_integers_to_hex, is_hex as cpp_is_hex, to_integers as cpp_to_integers, ) -from cudf._lib.cpp.strings.convert.convert_ipv4 cimport ( +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_ipv4 cimport ( integers_to_ipv4 as cpp_integers_to_ipv4, ipv4_to_integers as cpp_ipv4_to_integers, is_ipv4 as cpp_is_ipv4, ) -from cudf._lib.cpp.types cimport data_type, type_id +from cudf._lib.pylibcudf.libcudf.types cimport data_type, type_id from cudf._lib.types cimport underlying_type_t_type_id import cudf diff --git a/python/cudf/cudf/_lib/strings/attributes.pyx b/python/cudf/cudf/_lib/strings/attributes.pyx index c1b69dda353..1f3d7c4eb1b 100644 --- a/python/cudf/cudf/_lib/strings/attributes.pyx +++ b/python/cudf/cudf/_lib/strings/attributes.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2022, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,9 +6,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.attributes cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.attributes cimport ( code_points as cpp_code_points, count_bytes as cpp_count_bytes, count_characters as cpp_count_characters, diff --git a/python/cudf/cudf/_lib/strings/capitalize.pyx b/python/cudf/cudf/_lib/strings/capitalize.pyx index f6a80ac8fbe..1420a2bbaf2 100644 --- a/python/cudf/cudf/_lib/strings/capitalize.pyx +++ b/python/cudf/cudf/_lib/strings/capitalize.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2022, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,9 +6,9 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.capitalize cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.capitalize cimport ( capitalize as cpp_capitalize, is_title as cpp_is_title, title as cpp_title, diff --git a/python/cudf/cudf/_lib/strings/char_types.pyx b/python/cudf/cudf/_lib/strings/char_types.pyx index 14d78cdaa51..5b7b6d19d9e 100644 --- a/python/cudf/cudf/_lib/strings/char_types.pyx +++ b/python/cudf/cudf/_lib/strings/char_types.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp cimport bool @@ -8,10 +8,10 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.char_types cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.char_types cimport ( all_characters_of_type as cpp_all_characters_of_type, filter_characters_of_type as cpp_filter_characters_of_type, string_character_types, diff --git a/python/cudf/cudf/_lib/strings/combine.pyx b/python/cudf/cudf/_lib/strings/combine.pyx index 7d86d34ab25..288f333d4d8 100644 --- a/python/cudf/cudf/_lib/strings/combine.pyx +++ b/python/cudf/cudf/_lib/strings/combine.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cudf.core.buffer import acquire_spill_lock @@ -6,17 +6,17 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.combine cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.combine cimport ( concatenate as cpp_concatenate, join_list_elements as cpp_join_list_elements, join_strings as cpp_join_strings, output_if_empty_list, separator_on_nulls, ) -from cudf._lib.cpp.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view from cudf._lib.scalar cimport DeviceScalar from cudf._lib.utils cimport table_view_from_columns diff --git a/python/cudf/cudf/_lib/strings/contains.pyx b/python/cudf/cudf/_lib/strings/contains.pyx index 82034f7f8b7..087acd8062d 100644 --- a/python/cudf/cudf/_lib/strings/contains.pyx +++ b/python/cudf/cudf/_lib/strings/contains.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cython.operator cimport dereference from libc.stdint cimport uint32_t @@ -10,17 +10,17 @@ from libcpp.string cimport string from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.contains cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.contains cimport ( contains_re as cpp_contains_re, count_re as cpp_count_re, like as cpp_like, matches_re as cpp_matches_re, ) -from cudf._lib.cpp.strings.regex_flags cimport regex_flags -from cudf._lib.cpp.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.strings.regex_flags cimport regex_flags +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/strings/convert/convert_fixed_point.pyx b/python/cudf/cudf/_lib/strings/convert/convert_fixed_point.pyx index 2085d5c2896..6faff606226 100644 --- a/python/cudf/cudf/_lib/strings/convert/convert_fixed_point.pyx +++ b/python/cudf/cudf/_lib/strings/convert/convert_fixed_point.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. import cudf @@ -8,14 +8,14 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.convert.convert_fixed_point cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_fixed_point cimport ( from_fixed_point as cpp_from_fixed_point, is_fixed_point as cpp_is_fixed_point, to_fixed_point as cpp_to_fixed_point, ) -from cudf._lib.cpp.types cimport data_type, type_id +from cudf._lib.pylibcudf.libcudf.types cimport data_type, type_id @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/strings/convert/convert_floats.pyx b/python/cudf/cudf/_lib/strings/convert/convert_floats.pyx index d1617d85593..341cbc99dab 100644 --- a/python/cudf/cudf/_lib/strings/convert/convert_floats.pyx +++ b/python/cudf/cudf/_lib/strings/convert/convert_floats.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,9 +6,9 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.convert.convert_floats cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_floats cimport ( is_float as cpp_is_float, ) diff --git a/python/cudf/cudf/_lib/strings/convert/convert_integers.pyx b/python/cudf/cudf/_lib/strings/convert/convert_integers.pyx index 52a4791775a..081b03cdc0d 100644 --- a/python/cudf/cudf/_lib/strings/convert/convert_integers.pyx +++ b/python/cudf/cudf/_lib/strings/convert/convert_integers.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,9 +6,9 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.convert.convert_integers cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_integers cimport ( is_integer as cpp_is_integer, ) diff --git a/python/cudf/cudf/_lib/strings/convert/convert_lists.pyx b/python/cudf/cudf/_lib/strings/convert/convert_lists.pyx index 1a89fa7604b..4418bf2a72d 100644 --- a/python/cudf/cudf/_lib/strings/convert/convert_lists.pyx +++ b/python/cudf/cudf/_lib/strings/convert/convert_lists.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,10 +6,10 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.convert.convert_lists cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_lists cimport ( format_list_column as cpp_format_list_column, ) diff --git a/python/cudf/cudf/_lib/strings/convert/convert_urls.pyx b/python/cudf/cudf/_lib/strings/convert/convert_urls.pyx index bc8123281f0..5f62efe5c00 100644 --- a/python/cudf/cudf/_lib/strings/convert/convert_urls.pyx +++ b/python/cudf/cudf/_lib/strings/convert/convert_urls.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,9 +6,9 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.convert.convert_urls cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.convert.convert_urls cimport ( url_decode as cpp_url_decode, url_encode as cpp_url_encode, ) diff --git a/python/cudf/cudf/_lib/strings/extract.pyx b/python/cudf/cudf/_lib/strings/extract.pyx index d3d8610cdf0..3b80c4f6368 100644 --- a/python/cudf/cudf/_lib/strings/extract.pyx +++ b/python/cudf/cudf/_lib/strings/extract.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cython.operator cimport dereference from libc.stdint cimport uint32_t @@ -9,11 +9,11 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.extract cimport extract as cpp_extract -from cudf._lib.cpp.strings.regex_flags cimport regex_flags -from cudf._lib.cpp.strings.regex_program cimport regex_program -from cudf._lib.cpp.table.table cimport table +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.extract cimport extract as cpp_extract +from cudf._lib.pylibcudf.libcudf.strings.regex_flags cimport regex_flags +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.table.table cimport table from cudf._lib.utils cimport data_from_unique_ptr diff --git a/python/cudf/cudf/_lib/strings/find.pyx b/python/cudf/cudf/_lib/strings/find.pyx index 341776b102c..3c0009ee569 100644 --- a/python/cudf/cudf/_lib/strings/find.pyx +++ b/python/cudf/cudf/_lib/strings/find.pyx @@ -4,7 +4,7 @@ import cudf._lib.pylibcudf as plc from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/strings/find_multiple.pyx b/python/cudf/cudf/_lib/strings/find_multiple.pyx index c2a97a4fd7c..c75f28db21b 100644 --- a/python/cudf/cudf/_lib/strings/find_multiple.pyx +++ b/python/cudf/cudf/_lib/strings/find_multiple.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,9 +6,9 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.find_multiple cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.find_multiple cimport ( find_multiple as cpp_find_multiple, ) diff --git a/python/cudf/cudf/_lib/strings/findall.pyx b/python/cudf/cudf/_lib/strings/findall.pyx index 6df1d32dcfe..0d409889bc8 100644 --- a/python/cudf/cudf/_lib/strings/findall.pyx +++ b/python/cudf/cudf/_lib/strings/findall.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. from cython.operator cimport dereference from libc.stdint cimport uint32_t @@ -9,11 +9,11 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.findall cimport findall as cpp_findall -from cudf._lib.cpp.strings.regex_flags cimport regex_flags -from cudf._lib.cpp.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.findall cimport findall as cpp_findall +from cudf._lib.pylibcudf.libcudf.strings.regex_flags cimport regex_flags +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/strings/json.pyx b/python/cudf/cudf/_lib/strings/json.pyx index 861e0daa6e3..560f284b56c 100644 --- a/python/cudf/cudf/_lib/strings/json.pyx +++ b/python/cudf/cudf/_lib/strings/json.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,10 +6,10 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.json cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.json cimport ( get_json_object as cpp_get_json_object, get_json_object_options, ) diff --git a/python/cudf/cudf/_lib/strings/padding.pyx b/python/cudf/cudf/_lib/strings/padding.pyx index 340d7eb52d8..9226810951f 100644 --- a/python/cudf/cudf/_lib/strings/padding.pyx +++ b/python/cudf/cudf/_lib/strings/padding.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.string cimport string @@ -7,14 +7,17 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type from enum import IntEnum -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.strings.padding cimport pad as cpp_pad, zfill as cpp_zfill -from cudf._lib.cpp.strings.side_type cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.strings.padding cimport ( + pad as cpp_pad, + zfill as cpp_zfill, +) +from cudf._lib.pylibcudf.libcudf.strings.side_type cimport ( side_type, underlying_type_t_side_type, ) diff --git a/python/cudf/cudf/_lib/strings/repeat.pyx b/python/cudf/cudf/_lib/strings/repeat.pyx index 4896fb74f41..2b8116848cf 100644 --- a/python/cudf/cudf/_lib/strings/repeat.pyx +++ b/python/cudf/cudf/_lib/strings/repeat.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,10 +6,10 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings cimport repeat as cpp_repeat -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings cimport repeat as cpp_repeat +from cudf._lib.pylibcudf.libcudf.types cimport size_type @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/strings/replace.pyx b/python/cudf/cudf/_lib/strings/replace.pyx index 80c9ba95fd8..880201e65a2 100644 --- a/python/cudf/cudf/_lib/strings/replace.pyx +++ b/python/cudf/cudf/_lib/strings/replace.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t from libcpp.memory cimport unique_ptr @@ -7,14 +7,14 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.replace cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.replace cimport ( replace as cpp_replace, replace_slice as cpp_replace_slice, ) -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/strings/replace_re.pyx b/python/cudf/cudf/_lib/strings/replace_re.pyx index 1fbbaa8f44f..e13880a6186 100644 --- a/python/cudf/cudf/_lib/strings/replace_re.pyx +++ b/python/cudf/cudf/_lib/strings/replace_re.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cython.operator cimport dereference from libcpp.memory cimport unique_ptr @@ -9,16 +9,16 @@ from libcpp.vector cimport vector from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.regex_flags cimport regex_flags -from cudf._lib.cpp.strings.regex_program cimport regex_program -from cudf._lib.cpp.strings.replace_re cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.regex_flags cimport regex_flags +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.strings.replace_re cimport ( replace_re as cpp_replace_re, replace_with_backrefs as cpp_replace_with_backrefs, ) -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/strings/split/partition.pyx b/python/cudf/cudf/_lib/strings/split/partition.pyx index 281d131372a..be377c0f86b 100644 --- a/python/cudf/cudf/_lib/strings/split/partition.pyx +++ b/python/cudf/cudf/_lib/strings/split/partition.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,13 +6,13 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.split.partition cimport ( +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.split.partition cimport ( partition as cpp_partition, rpartition as cpp_rpartition, ) -from cudf._lib.cpp.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table cimport table from cudf._lib.scalar cimport DeviceScalar from cudf._lib.utils cimport data_from_unique_ptr diff --git a/python/cudf/cudf/_lib/strings/split/split.pyx b/python/cudf/cudf/_lib/strings/split/split.pyx index 08c7dde921f..942235686d7 100644 --- a/python/cudf/cudf/_lib/strings/split/split.pyx +++ b/python/cudf/cudf/_lib/strings/split/split.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from cython.operator cimport dereference from libcpp.memory cimport unique_ptr @@ -8,12 +8,12 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.regex_flags cimport regex_flags -from cudf._lib.cpp.strings.regex_program cimport regex_program -from cudf._lib.cpp.strings.split.split cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.regex_flags cimport regex_flags +from cudf._lib.pylibcudf.libcudf.strings.regex_program cimport regex_program +from cudf._lib.pylibcudf.libcudf.strings.split.split cimport ( rsplit as cpp_rsplit, rsplit_re as cpp_rsplit_re, rsplit_record as cpp_rsplit_record, @@ -23,8 +23,8 @@ from cudf._lib.cpp.strings.split.split cimport ( split_record as cpp_split_record, split_record_re as cpp_split_record_re, ) -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar cimport DeviceScalar from cudf._lib.utils cimport data_from_unique_ptr diff --git a/python/cudf/cudf/_lib/strings/strip.pyx b/python/cudf/cudf/_lib/strings/strip.pyx index 2c53782d6ba..199fa5fc3b6 100644 --- a/python/cudf/cudf/_lib/strings/strip.pyx +++ b/python/cudf/cudf/_lib/strings/strip.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,11 +6,11 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.side_type cimport side_type -from cudf._lib.cpp.strings.strip cimport strip as cpp_strip +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.side_type cimport side_type +from cudf._lib.pylibcudf.libcudf.strings.strip cimport strip as cpp_strip from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/strings/substring.pyx b/python/cudf/cudf/_lib/strings/substring.pyx index e6b8cdd28ee..170c1016b89 100644 --- a/python/cudf/cudf/_lib/strings/substring.pyx +++ b/python/cudf/cudf/_lib/strings/substring.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. import numpy as np @@ -8,14 +8,16 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.substring cimport slice_strings as cpp_slice_strings -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.substring cimport ( + slice_strings as cpp_slice_strings, +) +from cudf._lib.pylibcudf.libcudf.types cimport size_type from cudf._lib.scalar import as_device_scalar -from cudf._lib.cpp.scalar.scalar cimport numeric_scalar +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport numeric_scalar from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/strings/translate.pyx b/python/cudf/cudf/_lib/strings/translate.pyx index 55659e98dcb..8846e2e280d 100644 --- a/python/cudf/cudf/_lib/strings/translate.pyx +++ b/python/cudf/cudf/_lib/strings/translate.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. from libcpp cimport bool from libcpp.memory cimport unique_ptr @@ -9,15 +9,15 @@ from libcpp.vector cimport vector from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.scalar.scalar cimport string_scalar -from cudf._lib.cpp.strings.translate cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.scalar.scalar cimport string_scalar +from cudf._lib.pylibcudf.libcudf.strings.translate cimport ( filter_characters as cpp_filter_characters, filter_type, translate as cpp_translate, ) -from cudf._lib.cpp.types cimport char_utf8 +from cudf._lib.pylibcudf.libcudf.types cimport char_utf8 from cudf._lib.scalar cimport DeviceScalar diff --git a/python/cudf/cudf/_lib/strings/wrap.pyx b/python/cudf/cudf/_lib/strings/wrap.pyx index 8b0c367e791..92750f21e4d 100644 --- a/python/cudf/cudf/_lib/strings/wrap.pyx +++ b/python/cudf/cudf/_lib/strings/wrap.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.utility cimport move @@ -6,10 +6,10 @@ from libcpp.utility cimport move from cudf.core.buffer import acquire_spill_lock from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.strings.wrap cimport wrap as cpp_wrap -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.strings.wrap cimport wrap as cpp_wrap +from cudf._lib.pylibcudf.libcudf.types cimport size_type @acquire_spill_lock() diff --git a/python/cudf/cudf/_lib/strings_udf.pyx b/python/cudf/cudf/_lib/strings_udf.pyx index a59e6db1b72..e952492c45d 100644 --- a/python/cudf/cudf/_lib/strings_udf.pyx +++ b/python/cudf/cudf/_lib/strings_udf.pyx @@ -1,8 +1,8 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. from libc.stdint cimport uint8_t, uint16_t, uintptr_t -from cudf._lib.cpp.strings_udf cimport ( +from cudf._lib.pylibcudf.libcudf.strings_udf cimport ( get_character_cases_table as cpp_get_character_cases_table, get_character_flags_table as cpp_get_character_flags_table, get_special_case_mapping_table as cpp_get_special_case_mapping_table, @@ -18,8 +18,8 @@ from cudf.core.buffer import as_buffer from rmm._lib.device_buffer cimport DeviceBuffer, device_buffer from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column, column_view -from cudf._lib.cpp.strings_udf cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column, column_view +from cudf._lib.pylibcudf.libcudf.strings_udf cimport ( column_from_udf_string_array as cpp_column_from_udf_string_array, free_udf_string_array as cpp_free_udf_string_array, to_string_view_array as cpp_to_string_view_array, diff --git a/python/cudf/cudf/_lib/text.pyx b/python/cudf/cudf/_lib/text.pyx index a7346cdd586..6e63b8758b8 100644 --- a/python/cudf/cudf/_lib/text.pyx +++ b/python/cudf/cudf/_lib/text.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from io import TextIOBase @@ -9,8 +9,8 @@ from libcpp.string cimport string from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.io.text cimport ( +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.io.text cimport ( byte_range_info, data_chunk_source, make_source, diff --git a/python/cudf/cudf/_lib/timezone.pyx b/python/cudf/cudf/_lib/timezone.pyx index 808d1321b0b..53977e984c2 100644 --- a/python/cudf/cudf/_lib/timezone.pyx +++ b/python/cudf/cudf/_lib/timezone.pyx @@ -1,14 +1,14 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.optional cimport make_optional from libcpp.string cimport string from libcpp.utility cimport move -from cudf._lib.cpp.io.timezone cimport ( +from cudf._lib.pylibcudf.libcudf.io.timezone cimport ( make_timezone_transition_table as cpp_make_timezone_transition_table, ) -from cudf._lib.cpp.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table cimport table from cudf._lib.utils cimport columns_from_unique_ptr diff --git a/python/cudf/cudf/_lib/transform.pyx b/python/cudf/cudf/_lib/transform.pyx index d8eb6134042..b325173f20d 100644 --- a/python/cudf/cudf/_lib/transform.pyx +++ b/python/cudf/cudf/_lib/transform.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from numba.np import numpy_support @@ -17,15 +17,20 @@ from libcpp.utility cimport move from rmm._lib.device_buffer cimport DeviceBuffer, device_buffer -cimport cudf._lib.cpp.transform as libcudf_transform +cimport cudf._lib.pylibcudf.libcudf.transform as libcudf_transform from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.expressions cimport expression -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport bitmask_type, data_type, size_type, type_id from cudf._lib.expressions cimport Expression +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.expressions cimport expression +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport ( + bitmask_type, + data_type, + size_type, + type_id, +) from cudf._lib.types cimport underlying_type_t_type_id from cudf._lib.utils cimport ( columns_from_unique_ptr, diff --git a/python/cudf/cudf/_lib/transpose.pyx b/python/cudf/cudf/_lib/transpose.pyx index 51e49b1f27a..82b23439e6a 100644 --- a/python/cudf/cudf/_lib/transpose.pyx +++ b/python/cudf/cudf/_lib/transpose.pyx @@ -1,13 +1,13 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libcpp.memory cimport unique_ptr from libcpp.pair cimport pair from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.transpose cimport transpose as cpp_transpose +from cudf._lib.pylibcudf.libcudf.column.column cimport column +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.transpose cimport transpose as cpp_transpose from cudf._lib.utils cimport columns_from_table_view, table_view_from_columns diff --git a/python/cudf/cudf/_lib/types.pxd b/python/cudf/cudf/_lib/types.pxd index a95db84ceff..519d5ff8554 100644 --- a/python/cudf/cudf/_lib/types.pxd +++ b/python/cudf/cudf/_lib/types.pxd @@ -1,11 +1,13 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t from libcpp cimport bool -cimport cudf._lib.cpp.types as libcudf_types -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) ctypedef bool underlying_type_t_order ctypedef bool underlying_type_t_null_order diff --git a/python/cudf/cudf/_lib/types.pyx b/python/cudf/cudf/_lib/types.pyx index 1b4f4617e97..895e1afc502 100644 --- a/python/cudf/cudf/_lib/types.pyx +++ b/python/cudf/cudf/_lib/types.pyx @@ -7,9 +7,11 @@ import pandas as pd from libcpp.memory cimport make_shared, shared_ptr -cimport cudf._lib.cpp.types as libcudf_types -from cudf._lib.cpp.column.column_view cimport column_view -from cudf._lib.cpp.lists.lists_column_view cimport lists_column_view +cimport cudf._lib.pylibcudf.libcudf.types as libcudf_types +from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view +from cudf._lib.pylibcudf.libcudf.lists.lists_column_view cimport ( + lists_column_view, +) from cudf._lib.types cimport ( underlying_type_t_interpolation, underlying_type_t_order, diff --git a/python/cudf/cudf/_lib/utils.pxd b/python/cudf/cudf/_lib/utils.pxd index 51c69bdcaf9..c5a1e7552b9 100644 --- a/python/cudf/cudf/_lib/utils.pxd +++ b/python/cudf/cudf/_lib/utils.pxd @@ -4,8 +4,8 @@ from libcpp.memory cimport unique_ptr from libcpp.string cimport string from libcpp.vector cimport vector -from cudf._lib.cpp.column.column cimport column_view -from cudf._lib.cpp.table.table cimport table, table_view +from cudf._lib.pylibcudf.libcudf.column.column cimport column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table, table_view cdef data_from_unique_ptr( diff --git a/python/cudf/cudf/_lib/utils.pyx b/python/cudf/cudf/_lib/utils.pyx index 0afecb215e4..4c4cd48d6ed 100644 --- a/python/cudf/cudf/_lib/utils.pyx +++ b/python/cudf/cudf/_lib/utils.pyx @@ -11,10 +11,10 @@ from libcpp.utility cimport move from libcpp.vector cimport vector from cudf._lib.column cimport Column -from cudf._lib.cpp.column.column cimport column, column_view -from cudf._lib.cpp.table.table cimport table -from cudf._lib.cpp.table.table_view cimport table_view -from cudf._lib.cpp.types cimport size_type +from cudf._lib.pylibcudf.libcudf.column.column cimport column, column_view +from cudf._lib.pylibcudf.libcudf.table.table cimport table +from cudf._lib.pylibcudf.libcudf.table.table_view cimport table_view +from cudf._lib.pylibcudf.libcudf.types cimport size_type try: import ujson as json diff --git a/python/cudf_kafka/cudf_kafka/_lib/kafka.pxd b/python/cudf_kafka/cudf_kafka/_lib/kafka.pxd index 068837d04ee..84a3a32646d 100644 --- a/python/cudf_kafka/cudf_kafka/_lib/kafka.pxd +++ b/python/cudf_kafka/cudf_kafka/_lib/kafka.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t, int64_t from libcpp cimport bool @@ -7,8 +7,8 @@ from libcpp.memory cimport unique_ptr from libcpp.string cimport string from libcpp.vector cimport vector -from cudf._lib.cpp.io.datasource cimport datasource from cudf._lib.io.datasource cimport Datasource +from cudf._lib.pylibcudf.libcudf.io.datasource cimport datasource cdef extern from "cudf_kafka/kafka_callback.hpp" \ diff --git a/python/cudf_kafka/cudf_kafka/_lib/kafka.pyx b/python/cudf_kafka/cudf_kafka/_lib/kafka.pyx index 2fbaacff7c6..2927dc0aa9a 100644 --- a/python/cudf_kafka/cudf_kafka/_lib/kafka.pyx +++ b/python/cudf_kafka/cudf_kafka/_lib/kafka.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, NVIDIA CORPORATION. from libc.stdint cimport int32_t, int64_t from libcpp cimport bool, nullptr @@ -7,7 +7,7 @@ from libcpp.memory cimport make_unique, unique_ptr from libcpp.string cimport string from libcpp.utility cimport move -from cudf._lib.cpp.io.datasource cimport datasource +from cudf._lib.pylibcudf.libcudf.io.datasource cimport datasource from cudf_kafka._lib.kafka cimport kafka_consumer