Skip to content

Commit

Permalink
more style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
divyegala committed Nov 9, 2023
1 parent 2c360ed commit f06e431
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion cpp/bench/ann/src/raft/raft_cagra_hnswlib.cu
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ std::unique_ptr<raft::bench::ann::ANN<T>> create_algo(const std::string& algo,
return ann;
}


template <typename T>
std::unique_ptr<typename raft::bench::ann::ANN<T>::AnnSearchParam> create_search_param(
const std::string& algo, const nlohmann::json& conf)
Expand Down
2 changes: 1 addition & 1 deletion cpp/bench/ann/src/raft/raft_cagra_hnswlib_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
#pragma once

#include "raft_cagra_wrapper.h"
#include "../hnswlib/hnswlib_wrapper.h"
#include "raft_cagra_wrapper.h"
#include <memory>

namespace raft::bench::ann {
Expand Down
6 changes: 3 additions & 3 deletions cpp/cmake/modules/ConfigureCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ endif()
# Be very strict when compiling with GCC as host compiler (and thus more lenient when compiling with
# clang)
if(CMAKE_COMPILER_IS_GNUCXX)
# list(APPEND RAFT_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations)
# list(APPEND RAFT_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations)
list(APPEND RAFT_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations)
list(APPEND RAFT_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations)

# set warnings as errors
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2.0)
# list(APPEND RAFT_CUDA_FLAGS -Werror=all-warnings)
list(APPEND RAFT_CUDA_FLAGS -Werror=all-warnings)
endif()
endif()

Expand Down
20 changes: 10 additions & 10 deletions cpp/include/raft/neighbors/detail/cagra/cagra_serialize.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#pragma once

#include "raft/core/host_mdarray.hpp"
#include "raft/core/mdspan_types.hpp"
#include "raft/core/resource/cuda_stream.hpp"
#include <raft/core/host_mdarray.hpp>
#include <raft/core/mdspan_types.hpp>
#include <raft/core/resource/cuda_stream.hpp>
#include <cstddef>
#include <cstdint>
#include <raft/core/mdarray.hpp>
Expand Down Expand Up @@ -116,10 +116,9 @@ void serialize_to_hnswlib(raft::resources const& res,
const index<T, IdxT>& index_)
{
common::nvtx::range<common::nvtx::domain::raft> fun_scope("cagra::serialize_to_hnswlib");
RAFT_LOG_DEBUG(
"Saving CAGRA index to hnswlib format, size %zu, dim %u",
static_cast<size_t>(index_.size()),
index_.dim());
RAFT_LOG_DEBUG("Saving CAGRA index to hnswlib format, size %zu, dim %u",
static_cast<size_t>(index_.size()),
index_.dim());

// offset_level_0
std::size_t offset_level_0 = 0;
Expand All @@ -133,7 +132,7 @@ void serialize_to_hnswlib(raft::resources const& res,
// Example:M: 16, dim = 128, data_t = float, index_t = uint32_t, list_size_type = uint32_t,
// labeltype: size_t size_data_per_element_ = M * 2 * sizeof(index_t) + sizeof(list_size_type) +
// dim * sizeof(data_t) + sizeof(labeltype)
auto size_data_per_element =
auto size_data_per_element =
static_cast<std::size_t>(index_.graph_degree() * 4 + 4 + index_.dim() * 4 + 8);
os.write(reinterpret_cast<char*>(&size_data_per_element), sizeof(std::size_t));
// label_offset
Expand Down Expand Up @@ -178,7 +177,7 @@ void serialize_to_hnswlib(raft::resources const& res,
resource::sync_stream(res);

auto graph = index_.graph();
auto host_graph =
auto host_graph =
raft::make_host_matrix<IdxT, int64_t, raft::row_major>(graph.extent(0), graph.extent(1));
raft::copy(host_graph.data_handle(),
graph.data_handle(),
Expand Down Expand Up @@ -223,7 +222,8 @@ void serialize_to_hnswlib(raft::resources const& res,
template <typename T, typename IdxT>
void serialize_to_hnswlib(raft::resources const& res,
const std::string& filename,
const index<T, IdxT>& index_) {
const index<T, IdxT>& index_)
{
std::ofstream of(filename, std::ios::out | std::ios::binary);
if (!of) { RAFT_FAIL("Cannot open file %s", filename.c_str()); }

Expand Down

0 comments on commit f06e431

Please sign in to comment.