-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-24.10' of https://github.com/rapidsai/kvikio int…
…o remote-io
- Loading branch information
Showing
9 changed files
with
323 additions
and
43 deletions.
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
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,43 @@ | ||
# ============================================================================= | ||
# Copyright (c) 2024, 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. | ||
# ============================================================================= | ||
|
||
# ################################################################################################## | ||
# enable testing ----------------------------------------------------------------------------------- | ||
# ################################################################################################## | ||
enable_testing() | ||
|
||
include(rapids-test) | ||
rapids_test_init() | ||
|
||
file(GLOB SOURCES "*.cpp") | ||
add_executable(cpp_tests ${SOURCES}) | ||
set_target_properties( | ||
cpp_tests | ||
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${KvikIO_BINARY_DIR}/gtests>" | ||
CXX_STANDARD 17 | ||
CXX_STANDARD_REQUIRED ON | ||
# For std:: support of __int128_t. Can be removed once using cuda::std | ||
CXX_EXTENSIONS ON | ||
CUDA_STANDARD 17 | ||
CUDA_STANDARD_REQUIRED ON | ||
) | ||
target_link_libraries(cpp_tests PRIVATE kvikio::kvikio GTest::gmock GTest::gtest) | ||
rapids_test_add( | ||
NAME cpp_tests | ||
COMMAND cpp_tests | ||
GPUS 1 | ||
INSTALL_COMPONENT_SET testing | ||
) | ||
|
||
rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/tests/libkvikio) |
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,23 @@ | ||
/* | ||
* Copyright (c) 2024, 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. | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
::testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |
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,43 @@ | ||
/* | ||
* Copyright (c) 2024, 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. | ||
*/ | ||
|
||
#include <kvikio/file_handle.hpp> | ||
|
||
#include "utils.hpp" | ||
|
||
using namespace kvikio::test; | ||
|
||
TEST(BasicIO, write_read) | ||
{ | ||
TempDir tmp_dir{false}; | ||
auto filepath = tmp_dir.path() / "test"; | ||
|
||
auto dev_a = DevBuffer::arange(100); | ||
auto dev_b = DevBuffer::zero_like(dev_a); | ||
|
||
{ | ||
kvikio::FileHandle f(filepath, "w"); | ||
auto nbytes = f.write(dev_a.ptr, dev_a.nbytes, 0, 0); | ||
EXPECT_EQ(nbytes, dev_a.nbytes); | ||
} | ||
|
||
{ | ||
kvikio::FileHandle f(filepath, "r"); | ||
auto nbytes = f.read(dev_b.ptr, dev_b.nbytes, 0, 0); | ||
EXPECT_EQ(nbytes, dev_b.nbytes); | ||
expect_equal(dev_a, dev_b); | ||
} | ||
} |
Oops, something went wrong.