Skip to content

Commit

Permalink
Expose pylibcudf API
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Jun 13, 2024
1 parent 3961bb4 commit 9ac49e3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/cudf/cudf/_lib/pylibcudf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(cython_sources
concatenate.pyx
copying.pyx
datetime.pyx
experimental.pyx
filling.pyx
gpumemoryview.pyx
groupby.pyx
Expand Down
3 changes: 3 additions & 0 deletions python/cudf/cudf/_lib/pylibcudf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
concatenate,
copying,
datetime,
experimental,
filling,
groupby,
interop,
Expand Down Expand Up @@ -44,6 +45,7 @@
"concatenate",
"copying",
"datetime",
"experimental",
"filling",
"gpumemoryview",
"groupby",
Expand All @@ -54,6 +56,7 @@
"quantiles",
"reduce",
"replace",
"reshape",
"rolling",
"round",
"search",
Expand Down
16 changes: 16 additions & 0 deletions python/cudf/cudf/_lib/pylibcudf/experimental.pyx
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 15 additions & 0 deletions python/cudf/cudf/_lib/pylibcudf/libcudf/experimental.pxd
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 9ac49e3

Please sign in to comment.