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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git ls-files *.hpp *.h *.cpp *.c | xargs clang-format-21 --dry-run --Werror
git ls-files *.hpp *.h *.cpp *.c *.cuh *.cu | xargs clang-format-21 --dry-run --Werror

2 changes: 1 addition & 1 deletion include/stdexec/__detail/__stop_token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class>
Expand Down
35 changes: 22 additions & 13 deletions test/nvexec/tracer_resource.h
Original file line number Diff line number Diff line change
@@ -1,51 +1,60 @@
#pragma once

#include <memory_resource>
#include <new>
#include <vector>
#include <memory_resource>

#include <catch2/catch.hpp>

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<allocation_info_t> 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
} // namespace
Loading