-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract debug_utilities.hpp/cu
from column_utilities.hpp/cu
#13720
Merged
Merged
Changes from 27 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
5e69cb2
Add new file in cmake
ttnghia c22317d
Extract print code
ttnghia edb5e4b
Replace stream
ttnghia c6bcdd5
WIP
ttnghia 7f44d5e
Add comments
ttnghia 5698705
Cleanup headers
ttnghia 70aaeb9
Remove declaration
ttnghia 1e8a158
Cleanup
ttnghia 422b793
Cleanup
ttnghia 45824ba
Rename namespace
ttnghia cc57d6d
Add comment
ttnghia 01a5f0e
Remove parameter
ttnghia 4cf2007
Add comment about usage
ttnghia d7bff67
Update meta.yaml
ttnghia 851300c
Update meta.yaml
ttnghia ee09eb6
Change comment
ttnghia 761a842
Fix struct test
ttnghia e7df8fb
Control adding source file by cmake
ttnghia 58447f9
Revert "Control adding source file by cmake"
ttnghia 6485ffc
Merge branch 'branch-23.08' into debug_utils
ttnghia 1ed6980
Fix column_utility_tests.cpp
ttnghia 25ccbac
Merge branch 'branch-23.10' into debug_utils
ttnghia ecebebd
Merge branch 'branch-23.10' into debug_utils
ttnghia b37b373
Merge branch 'branch-23.12' into debug_utils
ttnghia abbe5cf
Merge branch 'branch-23.12' into debug_utils
ttnghia df6e608
Merge branch 'branch-23.12' into debug_utils
ttnghia 3ae27f3
Merge branch 'branch-23.12' into debug_utils
ttnghia ecbeef9
Use macro to detect gtest
ttnghia b6e2782
Merge branch 'branch-23.12' into debug_utils
ttnghia 048d8cb
Remove header check
ttnghia cb6b874
Merge branch 'branch-23.12' into debug_utils
ttnghia ae2dd49
Extract debug tests
ttnghia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2020-2023, 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. | ||
*/ | ||
|
||
#pragma once | ||
|
||
// | ||
// Do NOT include any header that directly or indirectly depends on gtest. | ||
// It is to make sure this file can be used and compiled outside of the test framework. | ||
// | ||
// In order to use the APIs listed below outside of the test framework, simply include this header | ||
// and add the corresponding source file `test/utilities/debug_utilities.cu` into the CMake | ||
// target build. | ||
// | ||
|
||
#include <cudf/column/column_view.hpp> | ||
#include <cudf/null_mask.hpp> | ||
|
||
namespace cudf::test { | ||
|
||
/** | ||
* @brief Formats a column view as a string | ||
* | ||
* @param col The input column view | ||
* @param delimiter The delimiter to put between strings | ||
*/ | ||
std::string to_string(cudf::column_view const& col, std::string const& delimiter); | ||
|
||
/** | ||
* @brief Convert column values to a host vector of strings | ||
* | ||
* @param col The input column view | ||
*/ | ||
std::vector<std::string> to_strings(cudf::column_view const& col); | ||
|
||
/** | ||
* @brief Print a column view to an ostream | ||
* | ||
* @param col The input column view | ||
* @param os The output stream | ||
*/ | ||
void print(cudf::column_view const& col, std::ostream& os = std::cout); | ||
|
||
} // namespace cudf::test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to include the file as a ifdef in the CMakeLists.txt so it could be compiled in with a cmake parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that is possible. I thought about that at the beginning but gave up as this is "just one file". Let me try again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source file
tests/utilities/debug_utilities.cu
is already part of the cudftestutil. We shouldn't be building it part of two different DSO as we could run into duplicate symbol issues from calling tests.All the libcudf tests and benchmarks have access to this function since they link to to
cudftestutil
. If you are debugging something external, you can gain access to this feature by addingcudftestutil
to your link line and not be required to recompile libcudf.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I only see your comment after pushed my cmake changes 😄 . Anyway, I tried to avoid duplicate symbols using
if/else
. Please take a look.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, I don't know if it is possible to add
cudftestutil
intolibcudf.so
, not the exec C++ application, since I need to outputcudf::test::print
intolibcudf.so
to be loaded in Spark.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spark builds libcudf statically right and embeds some extra code into a new
libcudf.so
no reason that can't also embedcudftestuil
.This approach is the wrong way to accomplish our goals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so I reverted the approach with cmake changes.
Personally I had (and still have, while compiling spark-rapids-jni) so many troubles with linking
cudftestutil
(due to my limited cmake experience) so I still prefer manually add the source file. In addition, extracting theprint
module should also make the code base cleaner.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, adding
cudftestutil
is not very straightforward, and I don't know how to fix this:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to enable position independent code ( the -fPIC flag )for the
libgtest
to resolve those link error. Can you please open this as an issue onrapids-cmake
and I can fix the issue.