SWDEV-406233 - Add notes on hipMemoryType and PointerGetAttributes API for unsupported cuda enum

Change-Id: I1175c12a55c7cd306a5aed3f1a400ae7525f4cb5
This commit is contained in:
Julia Jiang
2023-07-11 16:42:21 -04:00
zatwierdzone przez Julia Jiang
rodzic d8ce5a0271
commit fffa5eab08
2 zmienionych plików z 16 dodań i 5 usunięć
+3 -2
Wyświetl plik
@@ -461,11 +461,12 @@ In this case, memory type translation for hipPointerGetAttributes needs to be ha
So in any HIP applications which use HIP APIs involving memory types, developers should use #ifdef in order to assign the correct enum values depending on Nvidia or AMD platform.
As an example, please see the code from the link,
github.com/ROCm-Developer-Tools/HIP/blob/develop/tests/catch/unit/memory/hipMemcpyParam2D.cc#L77-L96.
As an example, please see the code from the [link](github.com/ROCm-Developer-Tools/HIP/blob/develop/tests/catch/unit/memory/hipMemcpyParam2D.cc).
With the #ifdef condition, HIP APIs work as expected on both AMD and NVIDIA platforms.
Note, cudaMemoryType enum value cudaMemoryTypeUnregstered is not supported currently in hipMemoryType, due to HIP functionality backward compatibility.
## threadfence_system
Threadfence_system makes all device memory writes, all writes to mapped host memory, and all writes to peer memory visible to CPU and other GPU devices.
Some implementations can provide this behavior by flushing the GPU L2 cache.