diff --git a/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt b/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt index 0a198f431a7..69fba0b4bea 100644 --- a/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt +++ b/python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt @@ -20,6 +20,7 @@ set(cython_sources concatenate.pyx copying.pyx datetime.pyx + experimental.pyx filling.pyx gpumemoryview.pyx groupby.pyx diff --git a/python/cudf/cudf/_lib/pylibcudf/__init__.py b/python/cudf/cudf/_lib/pylibcudf/__init__.py index 43a9e2aca31..7d1af4066e3 100644 --- a/python/cudf/cudf/_lib/pylibcudf/__init__.py +++ b/python/cudf/cudf/_lib/pylibcudf/__init__.py @@ -7,6 +7,7 @@ concatenate, copying, datetime, + experimental, filling, groupby, interop, @@ -44,6 +45,7 @@ "concatenate", "copying", "datetime", + "experimental", "filling", "gpumemoryview", "groupby", @@ -54,6 +56,7 @@ "quantiles", "reduce", "replace", + "reshape", "rolling", "round", "search", diff --git a/python/cudf/cudf/_lib/pylibcudf/experimental.pyx b/python/cudf/cudf/_lib/pylibcudf/experimental.pyx new file mode 100644 index 00000000000..f1ce8ba8a1b --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/experimental.pyx @@ -0,0 +1,16 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + +from libcpp cimport bool +from libcpp.string cimport string + +from cudf._lib.pylibcudf.libcudf cimport experimental as cpp_experimental + + +cpdef enable_prefetching(str key): + # helper to convert a gather map to a Column + cdef string c_key = key.encode("utf-8") + cpp_experimental.enable_prefetching(c_key) + +cpdef prefetch_debugging(bool enable): + # helper to convert a gather map to a Column + cpp_experimental.prefetch_debugging(enable) diff --git a/python/cudf/cudf/_lib/pylibcudf/libcudf/experimental.pxd b/python/cudf/cudf/_lib/pylibcudf/libcudf/experimental.pxd new file mode 100644 index 00000000000..7e0bd9c910c --- /dev/null +++ b/python/cudf/cudf/_lib/pylibcudf/libcudf/experimental.pxd @@ -0,0 +1,15 @@ +# Copyright (c) 2022-2024, NVIDIA CORPORATION. + +from libcpp cimport bool +from libcpp.string cimport string + + +cdef extern from "cudf/utilities/prefetch.hpp" \ + namespace "cudf::experimental::prefetch" nogil: + # Not technically the right signature, but it's good enough to let Cython + # generate valid C++ code. It just means we'll be copying a host string + # extra, but that's OK. If we care we could generate string_view bindings, + # but there's no real rush so if we go that route we might as well + # contribute them upstream to Cython itself. + void enable_prefetching(string key) + void prefetch_debugging(bool enable)