SWDEV-469825 - Modified the kernel argument readback to use a pointer to volatile

This change modifies the readback mechanism to use a pointer to volatile
instead of a volatile pointer. This ensures that the compiler does not
optimize away the read operation.

Change-Id: I79ff925d615aa8cc4f950e8ff4b7e608fcb179a4
Cette révision appartient à :
Ioannis Assiouras a révisé 2024-07-09 17:28:47 -04:00
1 Parent 7257f56c60
révision ea50d2c0c2
2 fichiers modifiés
+4 -3

Aucun fichier ne correspond à votre recherche

+2 -2
Voir le fichier
@@ -469,11 +469,11 @@ hipError_t GraphExec::CaptureAQLPackets() {
kernarg_graph_.back().kernarg_pool_addr_ != 0) {
address dev_ptr = kernarg_graph_.back().kernarg_pool_addr_ +
kernarg_graph_.back().kernarg_pool_size_;
auto kSentinel = *reinterpret_cast<volatile address>(dev_ptr - 1);
auto kSentinel = *reinterpret_cast<volatile unsigned char*>(dev_ptr - 1);
_mm_sfence();
*(dev_ptr - 1) = kSentinel;
_mm_mfence();
kSentinel = *reinterpret_cast<volatile address>(dev_ptr - 1);
kSentinel = *reinterpret_cast<volatile unsigned char*>(dev_ptr - 1);
}
}
}