Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"danielpinto8zz6.c-cpp-compile-run",
"usernamehw.errorlens"
]
}
}
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,4 @@
}
}
]
}
}
12 changes: 6 additions & 6 deletions atom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,20 @@ option(ATOM_BUILD_UNIFIED_LIBRARY "Build a unified Atom library containing all m
if(ATOM_BUILD_UNIFIED_LIBRARY)
# Get all targets that are atom modules
get_property(ATOM_MODULE_TARGETS GLOBAL PROPERTY ATOM_MODULE_TARGETS)

if(ATOM_MODULE_TARGETS)
message(STATUS "Creating unified Atom library with modules: ${ATOM_MODULE_TARGETS}")

# Create unified target
add_library(atom-unified INTERFACE)

# Link all module targets
target_link_libraries(atom-unified INTERFACE ${ATOM_MODULE_TARGETS})

# Create an alias 'atom' that points to 'atom-unified'
# This allows examples and other components to link against 'atom'
add_library(atom ALIAS atom-unified)

# Install unified target
install(TARGETS atom-unified
EXPORT atom-unified-targets
Expand All @@ -305,4 +305,4 @@ if(ATOM_BUILD_UNIFIED_LIBRARY)
endif()
endif()

message(STATUS "Atom modules configuration completed successfully")
message(STATUS "Atom modules configuration completed successfully")
2 changes: 1 addition & 1 deletion atom/algorithm/algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,4 +694,4 @@ void BoyerMoore::computeGoodSuffixShift() noexcept {
spdlog::info("Good suffix shift table computed.");
}

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,4 @@ auto BloomFilter<N, ElementType, HashFunction>::elementCount() const noexcept

} // namespace atom::algorithm

#endif
#endif
2 changes: 1 addition & 1 deletion atom/algorithm/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,4 +644,4 @@ auto decodeBase32(std::string_view encoded_sv) noexcept
}
}

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,4 @@ void parallelExecute(std::span<T> data, size_t threadCount,

} // namespace atom::algorithm

#endif
#endif
2 changes: 1 addition & 1 deletion atom/algorithm/bignumber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,4 +607,4 @@ void BigNumber::validate() const {
}
}

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/bignumber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,4 @@ constexpr auto BigNumber::at(size_t index) const -> uint8_t {

} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_BIGNUMBER_HPP
#endif // ATOM_ALGORITHM_BIGNUMBER_HPP
2 changes: 1 addition & 1 deletion atom/algorithm/blowfish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,4 +533,4 @@ template void Blowfish::decrypt_data<char>(std::span<char>, usize&);
template void Blowfish::decrypt_data<unsigned char>(std::span<unsigned char>,
usize&);

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/blowfish.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ class Blowfish {

} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_BLOWFISH_HPP
#endif // ATOM_ALGORITHM_BLOWFISH_HPP
6 changes: 3 additions & 3 deletions atom/algorithm/convolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ __kernel void convolve2D(__global const float* input,
for (int j = -halfKernelCols; j <= halfKernelCols; ++j) {
int x = clamp(row + i, 0, inputRows - 1);
int y = clamp(col + j, 0, inputCols - 1);

int kernelIdx = (i + halfKernelRows) * kernelCols + (j + halfKernelCols);
int inputIdx = x * inputCols + y;

sum += input[inputIdx] * kernel[kernelIdx];
}
}
Expand Down Expand Up @@ -1257,4 +1257,4 @@ auto applyGaussianFilter(const std::vector<std::vector<f64>>& image,

#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif
2 changes: 1 addition & 1 deletion atom/algorithm/flood.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ usize FloodFill::processBlock(
return filled_count;
}

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/flood.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,4 +694,4 @@ usize FloodFill::fillParallel(

} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_FLOOD_GPP
#endif // ATOM_ALGORITHM_FLOOD_GPP
2 changes: 1 addition & 1 deletion atom/algorithm/fnmatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,4 @@ atom::algorithm::filter<std::vector<std::string>, std::vector<std::string>>(
const std::vector<std::string>&, const std::vector<std::string>&, int,
bool);

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/fnmatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ template <StringLike Pattern>

} // namespace atom::algorithm

#endif // ATOM_SYSTEM_FNMATCH_HPP
#endif // ATOM_SYSTEM_FNMATCH_HPP
2 changes: 1 addition & 1 deletion atom/algorithm/fraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,4 +450,4 @@ auto makeFraction(double value, int max_denominator) -> Fraction {
return Fraction(sign * h2, k2);
}

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/fraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,4 +451,4 @@ class Fraction {

} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_FRACTION_HPP
#endif // ATOM_ALGORITHM_FRACTION_HPP
2 changes: 1 addition & 1 deletion atom/algorithm/huffman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,4 @@ std::vector<unsigned char> decompressParallel(

} // namespace huffman_optimized

#endif // ATOM_ALGORITHM_HUFFMAN_HPP
#endif // ATOM_ALGORITHM_HUFFMAN_HPP
2 changes: 1 addition & 1 deletion atom/algorithm/matrix_compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,4 +603,4 @@ void performanceTest(i32 rows, i32 cols, bool runParallel) {
}
#endif

} // namespace atom::algorithm
} // namespace atom::algorithm
18 changes: 9 additions & 9 deletions atom/algorithm/mhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,26 @@ namespace {
// Using template string to simplify OpenCL kernel code
constexpr const char *minhashKernelSource = R"CLC(
__kernel void minhash_kernel(
__global const size_t* hashes,
__global size_t* signature,
__global const size_t* a_values,
__global const size_t* b_values,
const size_t p,
const size_t num_hashes,
__global const size_t* hashes,
__global size_t* signature,
__global const size_t* a_values,
__global const size_t* b_values,
const size_t p,
const size_t num_hashes,
const size_t num_elements
) {
int gid = get_global_id(0);
if (gid < num_hashes) {
size_t min_hash = SIZE_MAX;
size_t a = a_values[gid];
size_t b = b_values[gid];

// Batch processing to leverage locality
for (size_t i = 0; i < num_elements; ++i) {
size_t h = (a * hashes[i] + b) % p;
min_hash = (h < min_hash) ? h : min_hash;
}

signature[gid] = min_hash;
}
}
Expand Down Expand Up @@ -628,4 +628,4 @@ auto keccak256(std::span<const u8> input) -> std::array<u8, K_HASH_SIZE> {

thread_local std::vector<usize> tls_buffer_{};

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/pathfinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,4 +652,4 @@ std::vector<Point> PathFinder::funnelAlgorithm(const std::vector<Point>& path,
return result;
}

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/pathfinding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,4 +523,4 @@ struct hash<atom::algorithm::Point> {
(hash<atom::algorithm::i32>()(p.y) << 1);
}
};
} // namespace std
} // namespace std
2 changes: 1 addition & 1 deletion atom/algorithm/perlin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,4 @@ class PerlinNoise {
};
} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_PERLIN_HPP
#endif // ATOM_ALGORITHM_PERLIN_HPP
2 changes: 1 addition & 1 deletion atom/algorithm/sha1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,4 @@ auto computeHashesInParallel(const Containers&... containers)
return results;
}

} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/sha1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,4 @@ template <ByteContainer... Containers>

} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_SHA1_HPP
#endif // ATOM_ALGORITHM_SHA1_HPP
2 changes: 1 addition & 1 deletion atom/algorithm/snowflake.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,4 +668,4 @@ class Snowflake {

} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_SNOWFLAKE_HPP
#endif // ATOM_ALGORITHM_SNOWFLAKE_HPP
2 changes: 1 addition & 1 deletion atom/algorithm/tea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,4 @@ template auto toUint32Vector<std::vector<u8>>(const std::vector<u8>& data)

template auto toByteArray<std::vector<u32>>(const std::vector<u32>& data)
-> std::vector<u8>;
} // namespace atom::algorithm
} // namespace atom::algorithm
2 changes: 1 addition & 1 deletion atom/algorithm/tea.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,4 @@ auto toByteArray(const Container &data) -> std::vector<u8> {

} // namespace atom::algorithm

#endif
#endif
2 changes: 1 addition & 1 deletion atom/algorithm/weight.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1147,4 +1147,4 @@ class WeightSelector {

} // namespace atom::algorithm

#endif // ATOM_ALGORITHM_WEIGHT_HPP
#endif // ATOM_ALGORITHM_WEIGHT_HPP
28 changes: 14 additions & 14 deletions atom/algorithm/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,46 @@ add_requires("openssl", "tbb", "loguru")
target("atom-algorithm")
-- Set target kind
set_kind("static")

-- Add source files (automatically collect .cpp files)
add_files("*.cpp")
-- Add header files (automatically collect .hpp files)

-- Add header files (automatically collect .hpp files)
add_headerfiles("*.hpp")

-- Add include directories
add_includedirs(".", {public = true})

-- Add packages
add_packages("openssl", "tbb", "loguru")

-- Add system libraries
add_syslinks("pthread")

-- Add dependencies (assuming they are other xmake targets or libraries)
for _, dep in ipairs(atom_algorithm_depends) do
add_deps(dep)
end

-- Set properties
set_targetdir("$(buildir)/lib")
set_objectdir("$(buildir)/obj")

-- Enable position independent code for static library
add_cxflags("-fPIC", {tools = {"gcc", "clang"}})
add_cflags("-fPIC", {tools = {"gcc", "clang"}})

-- Set version info
set_version("1.0.0")

-- Add compile features
set_policy("build.optimization.lto", true)

-- Installation rules
after_build(function (target)
-- Custom post-build actions if needed
end)

-- Install target
on_install(function (target)
local installdir = target:installdir() or "$(prefix)"
Expand All @@ -80,7 +80,7 @@ if has_config("enable-deps-check") then
-- Convert atom-error to ATOM_BUILD_ERROR format
local dep_var = dep:upper():gsub("ATOM%-", "ATOM_BUILD_")
if not has_config(dep_var:lower()) then
print("Warning: Module atom-algorithm depends on " .. dep ..
print("Warning: Module atom-algorithm depends on " .. dep ..
", but that module is not enabled for building")
end
end
Expand Down
2 changes: 1 addition & 1 deletion atom/async/async.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1541,4 +1541,4 @@ size_t AsyncWorkerManager<ResultType>::pruneCompletedWorkers() noexcept {
}
}
} // namespace atom::async
#endif
#endif
2 changes: 1 addition & 1 deletion atom/async/async_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,4 @@ void AsyncExecutor::statsLoop(std::stop_token stoken) {
}
}

} // namespace atom::async
} // namespace atom::async
2 changes: 1 addition & 1 deletion atom/async/eventstack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ void EventStack<T>::transformEvents(Func&& transformFunc) {
Parallel::for_each(events_.begin(), events_.end(),
std::forward<Func>(transformFunc));
*/

}
#endif
} catch (const std::exception& e) {
Expand Down
Loading