Skip to content

Commit

Permalink
bump up to ubuntu24 (#547)
Browse files Browse the repository at this point in the history
* add ubuntu2404 install script

* format with clang-format 18

---------

Co-authored-by: alon-reshef <[email protected]>
  • Loading branch information
meiravgri and alonre24 authored Oct 15, 2024
1 parent 3325068 commit f08c051
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
9 changes: 9 additions & 0 deletions .install/ubuntu_24.04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
export DEBIAN_FRONTEND=noninteractive
MODE=$1 # whether to install using sudo or not

$MODE apt update -qq
$MODE apt install -yqq git wget build-essential lcov openssl libssl-dev \
python3 python3-venv python3-dev unzip rsync clang curl
source install_cmake.sh $MODE
2 changes: 1 addition & 1 deletion src/VecSim/algorithms/hnsw/graph_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct ElementLevelData {
idType links[];

explicit ElementLevelData(std::shared_ptr<VecSimAllocator> allocator)
: incomingUnidirectionalEdges(new (allocator) vecsim_stl::vector<idType>(allocator)),
: incomingUnidirectionalEdges(new(allocator) vecsim_stl::vector<idType>(allocator)),
numLinks(0) {}

linkListSize getNumLinks() const { return this->numLinks; }
Expand Down
6 changes: 3 additions & 3 deletions src/python_bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ py::object wrap_results(VecSimQueryReply **res, size_t num_res, size_t num_queri
VecSimQueryReply_Free(res[i]);
}

py::capsule free_when_done_l(data_numpy_l, [](void *labels) { delete[](long *) labels; });
py::capsule free_when_done_d(data_numpy_d, [](void *dists) { delete[](double *) dists; });
py::capsule free_when_done_l(data_numpy_l, [](void *labels) { delete[] (long *)labels; });
py::capsule free_when_done_d(data_numpy_d, [](void *dists) { delete[] (double *)dists; });
return py::make_tuple(
py::array_t<long>(
{(size_t)num_queries, num_res}, // shape
Expand Down Expand Up @@ -132,7 +132,7 @@ class PyVecSimIndex {
}

py::capsule free_when_done(data_numpy,
[](void *vector_data) { delete[](NPArrayType *) vector_data; });
[](void *vector_data) { delete[] (NPArrayType *)vector_data; });
return py::array_t<NPArrayType>(
{n_vectors, dim}, // shape
{dim * sizeof(NPArrayType),
Expand Down
12 changes: 6 additions & 6 deletions tests/module/redismodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,10 @@ RedisModuleString *(*RedisModule_HoldString)(RedisModuleCtx *ctx,
REDISMODULE_API int (*RedisModule_StringCompare)(RedisModuleString *a,
RedisModuleString *b) REDISMODULE_ATTR;
REDISMODULE_API RedisModuleCtx *(*RedisModule_GetContextFromIO)(RedisModuleIO *io)REDISMODULE_ATTR;
REDISMODULE_API const
RedisModuleString *(*RedisModule_GetKeyNameFromIO)(RedisModuleIO *io)REDISMODULE_ATTR;
REDISMODULE_API const
RedisModuleString *(*RedisModule_GetKeyNameFromModuleKey)(RedisModuleKey *key)REDISMODULE_ATTR;
REDISMODULE_API const RedisModuleString *(*RedisModule_GetKeyNameFromIO)(RedisModuleIO *io)
REDISMODULE_ATTR;
REDISMODULE_API const RedisModuleString *(*RedisModule_GetKeyNameFromModuleKey)(RedisModuleKey *key)
REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetDbIdFromModuleKey)(RedisModuleKey *key) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetDbIdFromIO)(RedisModuleIO *io) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetDbIdFromOptCtx)(RedisModuleKeyOptCtx *ctx) REDISMODULE_ATTR;
Expand All @@ -874,8 +874,8 @@ REDISMODULE_API void (*RedisModule_DigestAddLongLong)(RedisModuleDigest *md,
long long ele) REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_DigestEndSequence)(RedisModuleDigest *md) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetDbIdFromDigest)(RedisModuleDigest *dig) REDISMODULE_ATTR;
REDISMODULE_API const
RedisModuleString *(*RedisModule_GetKeyNameFromDigest)(RedisModuleDigest *dig)REDISMODULE_ATTR;
REDISMODULE_API const RedisModuleString *(*RedisModule_GetKeyNameFromDigest)(RedisModuleDigest *dig)
REDISMODULE_ATTR;
REDISMODULE_API RedisModuleDict *(*RedisModule_CreateDict)(RedisModuleCtx *ctx)REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_FreeDict)(RedisModuleCtx *ctx,
RedisModuleDict *d) REDISMODULE_ATTR;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_hnsw_parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <atomic>

// Helper macro to get the closest even number which is equal or lower than x.
#define FLOOR_EVEN(x) ((x) - ((x)&1))
#define FLOOR_EVEN(x) ((x) - ((x) & 1))

template <typename index_type_t>
class HNSWTestParallel : public ::testing::Test {
Expand Down

0 comments on commit f08c051

Please sign in to comment.