Skip to content

Commit

Permalink
Update copyright years
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcrimsontianyu committed Jan 23, 2025
1 parent 008b63b commit 48c19c4
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion cpp/include/kvikio/cufile/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ namespace kvikio {
*
* @return The filepath to the cufile.json file or the empty string if it isn't found.
*/
[[nodiscard]] KVIKIO_EXPORT const std::string& config_path();
[[nodiscard]] KVIKIO_EXPORT std::string const& config_path();

} // namespace kvikio
2 changes: 1 addition & 1 deletion cpp/include/kvikio/shim/cufile_h_wrapper.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
* Copyright (c) 2022-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/kvikio/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ template <typename T, std::enable_if_t<std::is_floating_point_v<T>>* = nullptr>
* @return The boolean answer
*/
#ifdef KVIKIO_CUDA_FOUND
bool is_host_memory(const void* ptr);
bool is_host_memory(void const* ptr);
#else
constexpr bool is_host_memory(const void* ptr) { return true; }
constexpr bool is_host_memory(void const* ptr) { return true; }
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/file_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int open_fd(std::string const& file_path, std::string const& flags, bool o_direc
*/
[[nodiscard]] std::size_t get_file_size(int file_descriptor)
{
struct stat st{};
struct stat st {};
int ret = fstat(file_descriptor, &st);
if (ret == -1) {
throw std::system_error(errno, std::generic_category(), "Unable to query file size");
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/shim/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void* load_library(std::vector<char const*> const& names, int mode)
bool is_running_in_wsl() noexcept
{
try {
struct utsname buf{};
struct utsname buf {};
int err = ::uname(&buf);
if (err == 0) {
std::string const name(static_cast<char*>(buf.release));
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ CUdeviceptr convert_void2deviceptr(void const* devPtr)
}

#ifdef KVIKIO_CUDA_FOUND
bool is_host_memory(const void* ptr)
bool is_host_memory(void const* ptr)
{
CUpointer_attribute attrs[1] = {
CU_POINTER_ATTRIBUTE_MEMORY_TYPE,
Expand Down
4 changes: 2 additions & 2 deletions cpp/tests/test_basic_io.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -77,7 +77,7 @@ TEST_F(BasicIOTest, write_read_async)

// Explicitly set compatibility mode
std::array<kvikio::CompatMode, 2> compat_modes{kvikio::CompatMode::AUTO, kvikio::CompatMode::ON};
for (const auto& compat_mode : compat_modes) {
for (auto const& compat_mode : compat_modes) {
{
kvikio::FileHandle f(_filepath, "w", kvikio::FileHandle::m644, compat_mode);
auto stream_future = f.write_async(_dev_a.ptr, _dev_a.nbytes, 0, 0, stream);
Expand Down
10 changes: 5 additions & 5 deletions cpp/tests/test_defaults.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,29 +24,29 @@ TEST(Defaults, parse_compat_mode_str)
{
std::vector<std::string> inputs{
"ON", "on", "On", "TRUE", "true", "True", "YES", "yes", "Yes", "1"};
for (const auto& input : inputs) {
for (auto const& input : inputs) {
EXPECT_EQ(kvikio::detail::parse_compat_mode_str(input), kvikio::CompatMode::ON);
}
}

{
std::vector<std::string> inputs{
"OFF", "off", "oFf", "FALSE", "false", "False", "NO", "no", "No", "0"};
for (const auto& input : inputs) {
for (auto const& input : inputs) {
EXPECT_EQ(kvikio::detail::parse_compat_mode_str(input), kvikio::CompatMode::OFF);
}
}

{
std::vector<std::string> inputs{"AUTO", "auto", "aUtO"};
for (const auto& input : inputs) {
for (auto const& input : inputs) {
EXPECT_EQ(kvikio::detail::parse_compat_mode_str(input), kvikio::CompatMode::AUTO);
}
}

{
std::vector<std::string> inputs{"", "invalidOption", "11", "*&^Yes"};
for (const auto& input : inputs) {
for (auto const& input : inputs) {
EXPECT_THROW(kvikio::detail::parse_compat_mode_str(input), std::invalid_argument);
}
}
Expand Down
18 changes: 9 additions & 9 deletions cpp/tests/utils.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace kvikio::test {
*/
class TempDir {
public:
TempDir(const bool cleanup = true) : _cleanup{cleanup}
TempDir(bool const cleanup = true) : _cleanup{cleanup}
{
std::string tpl{std::filesystem::temp_directory_path() / "kvikio.XXXXXX"};
if (mkdtemp(tpl.data()) == nullptr) {
Expand All @@ -91,17 +91,17 @@ class TempDir {
}
}

TempDir(const TempDir&) = delete;
TempDir(TempDir const&) = delete;
TempDir& operator=(TempDir const&) = delete;
TempDir(const TempDir&&) = delete;
TempDir(TempDir const&&) = delete;
TempDir&& operator=(TempDir const&&) = delete;

const std::filesystem::path& path() { return _dir_path; }
std::filesystem::path const& path() { return _dir_path; }

operator std::string() { return path(); }

private:
const bool _cleanup;
bool const _cleanup;
std::filesystem::path _dir_path{};
};

Expand All @@ -120,7 +120,7 @@ class DevBuffer {
{
KVIKIO_CHECK_CUDA(cudaMalloc(&ptr, nbytes));
}
DevBuffer(const std::vector<std::int64_t>& host_buffer) : DevBuffer{host_buffer.size()}
DevBuffer(std::vector<std::int64_t> const& host_buffer) : DevBuffer{host_buffer.size()}
{
KVIKIO_CHECK_CUDA(cudaMemcpy(ptr, host_buffer.data(), nbytes, cudaMemcpyHostToDevice));
}
Expand Down Expand Up @@ -149,7 +149,7 @@ class DevBuffer {
return DevBuffer{host_buffer};
}

[[nodiscard]] static DevBuffer zero_like(const DevBuffer& prototype)
[[nodiscard]] static DevBuffer zero_like(DevBuffer const& prototype)
{
DevBuffer ret{prototype.nelem};
KVIKIO_CHECK_CUDA(cudaMemset(ret.ptr, 0, ret.nbytes));
Expand All @@ -176,7 +176,7 @@ class DevBuffer {
/**
* @brief Check that two buffers are equal
*/
inline void expect_equal(const DevBuffer& a, const DevBuffer& b)
inline void expect_equal(DevBuffer const& a, DevBuffer const& b)
{
EXPECT_EQ(a.nbytes, b.nbytes);
auto a_vec = a.to_vector();
Expand Down
4 changes: 2 additions & 2 deletions java/src/main/native/src/CuFileJni.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -168,7 +168,7 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_kvikio_cufile_CuFileDriver_create(JNIEnv*
{
try {
return reinterpret_cast<jlong>(new cufile_driver());
} catch (const std::exception& e) {
} catch (std::exception const& e) {
jlong default_ret_val = 0;
if (env->ExceptionOccurred()) { return default_ret_val; }

Expand Down

0 comments on commit 48c19c4

Please sign in to comment.