mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Add hash function for AUB dump handle
Change-Id: I3f53f187a31ca47e7cf2717f328c216469171f90
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "runtime/gmm_helper/resource_info.h"
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
#include "runtime/helpers/hash.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/helpers/string.h"
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
@@ -737,7 +738,7 @@ void AUBCommandStreamReceiverHw<GfxFamily>::activateAubSubCapture(const MultiDis
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint32_t AUBCommandStreamReceiverHw<GfxFamily>::getDumpHandle() {
|
||||
return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(this));
|
||||
return hashPtrToU32(this);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -104,4 +104,13 @@ class Hash {
|
||||
protected:
|
||||
uint32_t a, hi, lo;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
uint32_t hashPtrToU32(const T *src) {
|
||||
auto asInt = reinterpret_cast<uintptr_t>(src);
|
||||
constexpr auto m = sizeof(uintptr_t) / 8;
|
||||
asInt = asInt ^ ((asInt & ~(m - 1)) >> (m * 32));
|
||||
|
||||
return static_cast<uint32_t>(asInt);
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
Reference in New Issue
Block a user