[hip]Skip test when hipHostMallocCoherent is not supported by implementation (#1380)

[ROCm/clr commit: 313726a457]
This commit is contained in:
AlexBinXie
2019-09-16 04:31:43 -04:00
committed by Maneesh Gupta
parent 4436a38e65
commit cc921b35be
2 changed files with 23 additions and 10 deletions
@@ -176,15 +176,19 @@ int main() {
if (1) {
int* A = nullptr;
HIPCHECK(hipHostMalloc((void**)&A, sizeBytes, hipHostMallocCoherent));
const char* ptrType = "coherent";
CheckHostPointer(numElements, A, hipEventReleaseToDevice, SYNC_DEVICE, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToDevice, SYNC_STREAM, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToDevice, SYNC_EVENT, ptrType);
if (hipHostMalloc((void**)&A, sizeBytes, hipHostMallocCoherent) == hipSuccess) {
const char* ptrType = "coherent";
CheckHostPointer(numElements, A, hipEventReleaseToDevice, SYNC_DEVICE, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToDevice, SYNC_STREAM, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToDevice, SYNC_EVENT, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToSystem, SYNC_DEVICE, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToSystem, SYNC_STREAM, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToSystem, SYNC_EVENT, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToSystem, SYNC_DEVICE, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToSystem, SYNC_STREAM, ptrType);
CheckHostPointer(numElements, A, hipEventReleaseToSystem, SYNC_EVENT, ptrType);
}
else {
warn("Coherence memory allocation failed. Is SVM atomic supported?")
}
}