diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index aa5555524..7babe7424 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -20,5 +20,7 @@ jobs: steps: - run: apt update && apt --yes --no-install-recommends install git - uses: actions/checkout@v6 - - run: | + - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - shell: bash + run: | git ls-files *.hpp *.h *.cpp *.c | xargs clang-format-21 --dry-run --Werror diff --git a/include/stdexec/__detail/__stop_token.hpp b/include/stdexec/__detail/__stop_token.hpp index 53ee71137..7f2e52218 100644 --- a/include/stdexec/__detail/__stop_token.hpp +++ b/include/stdexec/__detail/__stop_token.hpp @@ -82,7 +82,7 @@ STDEXEC_P2300_NAMESPACE_BEGIN() private: struct __callback_type { - constexpr explicit __callback_type(never_stop_token, STDEXEC::__ignore) noexcept { } + constexpr explicit __callback_type(never_stop_token, STDEXEC::__ignore) noexcept {} }; public: template diff --git a/test/nvexec/tracer_resource.h b/test/nvexec/tracer_resource.h index 210976c53..1e72f3ae5 100644 --- a/test/nvexec/tracer_resource.h +++ b/test/nvexec/tracer_resource.h @@ -1,51 +1,60 @@ #pragma once +#include #include #include -#include #include namespace nvdetail = nvexec::_strm; -namespace { +namespace +{ - struct tracer_resource : public std::pmr::memory_resource { - struct allocation_info_t { - void* ptr; + struct tracer_resource : public std::pmr::memory_resource + { + struct allocation_info_t + { + void* ptr; size_t bytes; size_t alignment; - bool operator==(const allocation_info_t& other) const noexcept { + bool operator==(allocation_info_t const & other) const noexcept + { return ptr == other.ptr && bytes == other.bytes && alignment == other.alignment; } }; std::vector allocations; - void* do_allocate(size_t bytes, size_t alignment) override { + void* do_allocate(size_t bytes, size_t alignment) override + { INFO("Allocate: " << bytes << " bytes, " << alignment << " alignment"); void* ptr = ::operator new[](bytes, std::align_val_t(alignment)); allocations.push_back(allocation_info_t{ptr, bytes, alignment}); return ptr; } - void do_deallocate(void* ptr, size_t bytes, size_t alignment) override { + void do_deallocate(void* ptr, size_t bytes, size_t alignment) override + { INFO("Deallocate: " << bytes << " bytes, " << alignment << " alignment"); - auto it = - std::find(allocations.begin(), allocations.end(), allocation_info_t{ptr, bytes, alignment}); + auto it = std::find(allocations.begin(), + allocations.end(), + allocation_info_t{ptr, bytes, alignment}); REQUIRE(it != allocations.end()); - if (it != allocations.end()) { + if (it != allocations.end()) + { allocations.erase(it); ::operator delete[](ptr, std::align_val_t(alignment)); } } - bool do_is_equal(const std::pmr::memory_resource& other) const noexcept override { + bool do_is_equal(std::pmr::memory_resource const & other) const noexcept override + { return this == &other; } }; -} // namespace \ No newline at end of file +} // namespace \ No newline at end of file