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
15 changes: 15 additions & 0 deletions test_common/harness/typeWrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifndef _typeWrappers_h
#define _typeWrappers_h

#include <cstddef>
#if !defined(_WIN32)
#include <sys/mman.h>
#endif
Expand Down Expand Up @@ -183,6 +184,20 @@ class clSVMWrapper {
if (Ptr) clSVMFree(Ctx, Ptr);
}

bool operator==(const clSVMWrapper &other) const noexcept
{
return Ctx == other.Ctx && Ptr == other.Ptr;
}

bool operator!=(const clSVMWrapper &other) const noexcept
{
return !(*this == other);
}

bool operator==(std::nullptr_t) const noexcept { return Ptr == nullptr; }

bool operator!=(std::nullptr_t) const noexcept { return Ptr != nullptr; }

void *operator()() const { return Ptr; }
};

Expand Down
Loading