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
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CommentPragmas: '(IWYU pragma:|SPDX-)'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to #22118 (comment) but for clang-format. We'll address this in more detail next week.

CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Kept the below 2 to be the same as `IndentWidth` to keep everything uniform
Expand Down
9 changes: 7 additions & 2 deletions cpp/src/runtime/context.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -55,7 +55,12 @@ void context::ensure_jit_cache_initialized()
});
}

context::~context() { rtcx::teardown(); }
context::~context()
{
_jit_bundle.reset();
_rtcx_cache.reset();
rtcx::teardown();
}

rtcx::cache_t& context::rtcx_cache()
{
Expand Down
30 changes: 29 additions & 1 deletion cpp/tests/utilities_tests/context_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

#include <cudf_test/base_fixture.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <cudf/ast/expressions.hpp>
#include <cudf/column/column.hpp>
#include <cudf/context.hpp>
#include <cudf/table/table_view.hpp>
#include <cudf/transform.hpp>

#include <gtest/gtest.h>

Expand Down Expand Up @@ -35,6 +40,29 @@ TEST_F(ContextTest, InitializeAfterTeardown)
EXPECT_NO_THROW(cudf::initialize(cudf::init_flags::INIT_JIT_CACHE));
}

TEST_F(ContextTest, TeardownAfterJitCacheUse)
{
auto compute_column = [] {
auto c_0 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{3, 20, 1, 50};
auto c_1 = cudf::test::fixed_width_column_wrapper<cudf::size_type>{10, 7, 20, 0};
auto table = cudf::table_view{{c_0, c_1}};
auto col_ref_0 = cudf::ast::column_reference(0);
auto col_ref_1 = cudf::ast::column_reference(1);
auto expression = cudf::ast::operation(cudf::ast::ast_operator::ADD, col_ref_0, col_ref_1);

auto result = cudf::compute_column_jit(table, expression);
EXPECT_EQ(result->size(), cudf::size_type{4});
};

cudf::initialize(cudf::init_flags::INIT_JIT_CACHE);
ASSERT_NO_THROW(compute_column());
EXPECT_NO_THROW(cudf::teardown());

cudf::initialize(cudf::init_flags::INIT_JIT_CACHE);
ASSERT_NO_THROW(compute_column());
EXPECT_NO_THROW(cudf::teardown());
}

TEST_F(ContextTest, TeardownWithoutInitialize) { EXPECT_NO_THROW(cudf::teardown()); }

TEST_F(ContextTest, MultipleTeardownCalls)
Expand Down
Loading