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

Dieser Commit ist enthalten in:
AlexBinXie verfasst und Maneesh Gupta committed 2019-09-16 08:31:43 +00:00
1 Ursprung ceb734b917
Commit 5ed1f3e2c8
2 Dateien geändert
+23 -10

Keine Dateien entsprechen Ihrer Suche

+11 -2
Datei anzeigen
@@ -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