Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/pylibcudf/pylibcudf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand All @@ -10,6 +10,7 @@ set(cython_sources
binaryop.pyx
column.pyx
column_factories.pyx
context.pyx
contiguous_split.pyx
concatenate.pyx
copying.pyx
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
binaryop,
column_factories,
concatenate,
context,
contiguous_split,
copying,
datetime,
Expand Down Expand Up @@ -71,6 +72,7 @@
"binaryop",
"column_factories",
"concatenate",
"context",
"contiguous_split",
"copying",
"datetime",
Expand Down
6 changes: 6 additions & 0 deletions python/pylibcudf/pylibcudf/context.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

cpdef enable_jit_cache(bool enable)

cpdef clear_jit_cache()
5 changes: 5 additions & 0 deletions python/pylibcudf/pylibcudf/context.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

def enable_jit_cache(enable: bool) -> None: ...
def clear_jit_cache() -> None: ...
29 changes: 29 additions & 0 deletions python/pylibcudf/pylibcudf/context.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

from pylibcudf.libcudf cimport context as cpp_context


__all__ = ["clear_jit_cache", "enable_jit_cache"]


cpdef enable_jit_cache(bool enable):
"""Enable or disable the JIT program cache.

When disabled, the cache will not be used for storing or retrieving
compiled programs. When enabled, the cache will be used as normal.

Parameters
----------
enable : bool
If ``True``, the JIT program cache is enabled; if ``False``, it is
disabled.
"""
cpp_context.enable_jit_cache(enable)


cpdef clear_jit_cache():
"""Clear the JIT program cache, removing all cached programs from memory
and disk.
"""
cpp_context.clear_jit_cache()
10 changes: 10 additions & 0 deletions python/pylibcudf/pylibcudf/libcudf/context.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

from libcpp cimport bool
from pylibcudf.exception_handler cimport libcudf_exception_handler


cdef extern from "cudf/context.hpp" namespace "cudf" nogil:
void enable_jit_cache(bool enable) noexcept
void clear_jit_cache() except +libcudf_exception_handler
Loading