Merge pull request #639 from ROCm-Developer-Tools/skudchad-hip

Check for hipEnvVar at the same level if directed_tests location fails

[ROCm/clr commit: 4d0d1fb3f4]
This commit is contained in:
Maneesh Gupta
2018-09-16 18:31:37 +05:30
committed by GitHub
melakukan e0a77ca23b
2 mengubah file dengan 11 tambahan dan 4 penghapusan
@@ -38,7 +38,10 @@ int getDeviceNumber() {
string str; string str;
std::this_thread::sleep_for(std::chrono::milliseconds(10)); std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (!(in = popen("./directed_tests/hipEnvVar -c", "r"))) { if (!(in = popen("./directed_tests/hipEnvVar -c", "r"))) {
return 1; // Check at same level
if (!(in = popen("./hipEnvVar -c", "r"))) {
return 1;
}
} }
while (fgets(buff, 512, in) != NULL) { while (fgets(buff, 512, in) != NULL) {
cout << buff; cout << buff;
@@ -54,7 +57,11 @@ void getDevicePCIBusNumRemote(int deviceID, char* pciBusID) {
str += std::to_string(deviceID); str += std::to_string(deviceID);
std::this_thread::sleep_for(std::chrono::milliseconds(10)); std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (!(in = popen(str.c_str(), "r"))) { if (!(in = popen(str.c_str(), "r"))) {
exit(1); // Check at same level
if (!(in = popen("./hipEnvVar -d ", "r"))) {
exit(1);
}
} }
while (fgets(pciBusID, 100, in) != NULL) { while (fgets(pciBusID, 100, in) != NULL) {
cout << pciBusID; cout << pciBusID;
@@ -170,8 +170,8 @@ void runTests(int64_t numElements) {
// for (int waitStart=0; waitStart<2; waitStart++) { // for (int waitStart=0; waitStart<2; waitStart++) {
for (int waitStart = 1; waitStart >= 0; waitStart--) { for (int waitStart = 1; waitStart >= 0; waitStart--) {
unsigned W = waitStart ? 0x1000 : 0; unsigned W = waitStart ? 0x1000 : 0;
test(W | 0x01, C_d, C_h, numElements, 0, waitStart, syncNone); test(W | 0x01, C_d, C_h, numElements, 0, 0, syncNone);
test(W | 0x02, C_d, C_h, numElements, stream, waitStart, syncNone); test(W | 0x02, C_d, C_h, numElements, stream, 0, syncNone);
test(W | 0x04, C_d, C_h, numElements, 0, waitStart, syncStream); test(W | 0x04, C_d, C_h, numElements, 0, waitStart, syncStream);
test(W | 0x08, C_d, C_h, numElements, stream, waitStart, syncStream); test(W | 0x08, C_d, C_h, numElements, stream, waitStart, syncStream);
test(W | 0x10, C_d, C_h, numElements, 0, waitStart, syncStopEvent); test(W | 0x10, C_d, C_h, numElements, 0, waitStart, syncStopEvent);