Skip to content
Merged
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
12 changes: 8 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,14 @@ configuration files.
libstdc++ implements those comparisons with `operator<=>`, but `<chrono>`
already includes `<compare>`, as the standard requires. Other wrong
suggestions IWYU makes here:
- Removing `ibv-core.h` from a header that names the verbs types only as
`struct ibv_pd *` and the like. Without a prior declaration, that
declares a new `struct` in the enclosing namespace (`hipObj::ibv_pd`,
not libibverbs' `::ibv_pd`), so keep the include.
- Replacing `ibv-core.h` with forward declarations of the verbs types
(`struct ibv_pd;` and the like) in a header that uses them only through
pointers, such as [`src/buffer.h`](src/buffer.h) and
[`src/common/ibv-wrapper.h`](src/common/ibv-wrapper.h). `ibv-core.h`
declares them in the global namespace, as libibverbs does. A copy of
the declaration only repeats it, and one inside `namespace hipObj`
declares a different type (`hipObj::ibv_pd`, not `::ibv_pd`), so keep
the include.
- Removing `<cstdint>` from `src/hipobj.cpp` because the public header
includes `<stdint.h>`. C++ code includes `<cstdint>` (see
[C++ code](#c-code)).
Expand Down
2 changes: 1 addition & 1 deletion cmake/HIPOBJGNUCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function(hipobj_get_gnu_warning_flags outvar compiler_version)
# Misc warnings
-Warith-conversion
-Wmismatched-tags
#-Wredundant-tags # TODO: Fix issues
-Wredundant-tags
${flags}
)
endif()
Expand Down
6 changes: 3 additions & 3 deletions examples/s3_curl_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ struct CurlEasyDeleter {
};

struct CurlSlistDeleter {
void operator()(struct curl_slist *list) const noexcept
void operator()(curl_slist *list) const noexcept
{
curl_slist_free_all(list);
}
};

using CurlEasyPtr = std::unique_ptr<CURL, CurlEasyDeleter>;
using CurlSlistPtr = std::unique_ptr<struct curl_slist, CurlSlistDeleter>;
using CurlSlistPtr = std::unique_ptr<curl_slist, CurlSlistDeleter>;

// curl_slist_append() returns the head of the list, which is a new node
// only when the list was empty, or NULL on failure without freeing the
// list.
bool
appendHeader(CurlSlistPtr &list, const char *header)
{
struct curl_slist *head = curl_slist_append(list.get(), header);
curl_slist *head = curl_slist_append(list.get(), header);
if (head == nullptr) {
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions src/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ namespace {
} // namespace

IbvMrPtr
registerDeviceMemory(const Verbs &verbs, const HipRuntime &runtime, struct ibv_pd *pd, void *addr,
size_t length, int access, const DmabufPolicy &policy)
registerDeviceMemory(const Verbs &verbs, const HipRuntime &runtime, ibv_pd *pd, void *addr, size_t length,
int access, const DmabufPolicy &policy)
{
/* Whether a given GPU can export a dma-buf and a given NIC can register
* it is answered by trying: both calls report their own failure and
Expand Down Expand Up @@ -180,7 +180,7 @@ BufferMap::insert(uintptr_t key, std::shared_ptr<const BufEntry> entry)
}

BufferMap::RegisterResult
BufferMap::registerBuffer(void *devPtr, size_t size, struct ibv_pd *pd)
BufferMap::registerBuffer(void *devPtr, size_t size, ibv_pd *pd)
{
if (size > MAX_MR_SIZE) {
return RegisterResult::Failed;
Expand Down Expand Up @@ -236,7 +236,7 @@ BufferMap::registerBuffer(void *devPtr, size_t size, struct ibv_pd *pd)
}

BufferMap::RegisterResult
BufferMap::registerHostBuffer(void *hostPtr, size_t size, struct ibv_pd *pd)
BufferMap::registerHostBuffer(void *hostPtr, size_t size, ibv_pd *pd)
{
if (size > MAX_MR_SIZE) {
return RegisterResult::Failed;
Expand Down
6 changes: 3 additions & 3 deletions src/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct DmabufPolicy {
* GPU memory. Otherwise, or when either step fails, it registers the
* memory as host memory, which fails for GPU memory. Null when nothing
* registers. */
IbvMrPtr registerDeviceMemory(const Verbs &verbs, const HipRuntime &runtime, struct ibv_pd *pd, void *addr,
IbvMrPtr registerDeviceMemory(const Verbs &verbs, const HipRuntime &runtime, ibv_pd *pd, void *addr,
size_t length, int access, const DmabufPolicy &policy);

/* Frees a host staging buffer through the runtime whose hostMalloc()
Expand Down Expand Up @@ -146,9 +146,9 @@ class BufferMap {
* holding the map's lock. When two threads register the same address
* at once, one gets Registered, and the other AlreadyRegistered, and
* its registration is released. */
[[nodiscard]] RegisterResult registerBuffer(void *devPtr, size_t size, struct ibv_pd *pd)
[[nodiscard]] RegisterResult registerBuffer(void *devPtr, size_t size, ibv_pd *pd)
HIPOBJ_REQUIRES(!mutex_);
[[nodiscard]] RegisterResult registerHostBuffer(void *hostPtr, size_t size, struct ibv_pd *pd)
[[nodiscard]] RegisterResult registerHostBuffer(void *hostPtr, size_t size, ibv_pd *pd)
HIPOBJ_REQUIRES(!mutex_);
/* Removes the entry, and releases its registration and any staging
* buffer without holding the map's lock */
Expand Down
Loading
Loading