[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
@@ -71,12 +71,21 @@ int main() {
}
volatile int* data;
HIP_ASSERT(hipHostMalloc(&data, sizeof(int), hipHostMallocCoherent));
if (hipHostMalloc(&data, sizeof(int), hipHostMallocCoherent) != hipSuccess) {
warn("Memory allocation failed. Skip test. Is SVM atomic supported?")
passed();
return 0;
}
constexpr int init_data = 1000;
*data = init_data;
volatile int* flag;
HIP_ASSERT(hipHostMalloc(&flag, sizeof(int), hipHostMallocCoherent));
if (hipHostMalloc(&flag, sizeof(int), hipHostMallocCoherent) != hipSuccess) {
warn("Memory allocation failed. Skip test. Is SVM atomic supported?")
passed();
return 0;
}
*flag = 0;
// number of rounds per device