[dtest] Disable few tests on NVCC platform

Few of the tests are being validated in nvcc platform.  Till then
these tests are disabled.

SWDEV-238517 for enhancing hip unit tests

Change-Id: I1acbfe90c6ea39f3de676e98f0e3c33cbac97888


[ROCm/hip commit: 5bf2a70382]
Этот коммит содержится в:
mkumarmi
2020-09-01 16:11:49 +05:30
коммит произвёл Mohan Kumar Mithur
родитель ec47e5a7d4
Коммит 7f4fd6e62e
16 изменённых файлов: 188 добавлений и 188 удалений
+173 -173
Просмотреть файл
@@ -1,173 +1,173 @@
/*
* Copyright (c) 2015-present Advanced Micro Devices, Inc. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/*
* Test to compare
* 1.pciBusID from hipDeviceGetPCIBusId and hipDeviceGetAttribute **
* 2.{pciDomainID, pciBusID, pciDeviceID} values hipDeviceGetPCIBusId vs lspci **
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11
* TEST_NAMED: %t hipDeviceGetPCIBusId-vs-hipDeviceGetAttribute --tests 0x1
* TEST_NAMED: %t hipDeviceGetPCIBusId-vs-lspci --tests 0x2 EXCLUDE_HIP_PLATFORM nvcc
* HIT_END
*/
#include "test_common.h"
#define MAX_DEVICE_LENGTH 20
static bool getPciBusId(int deviceCount, char hipDeviceList[][MAX_DEVICE_LENGTH]) {
for (int i = 0; i < deviceCount; i++) {
HIPCHECK(hipDeviceGetPCIBusId(hipDeviceList[i], MAX_DEVICE_LENGTH, i));
}
return true;
}
bool comparePciBusIDWithHipDeviceGetAttribute() {
bool testResult = true;
int deviceCount = 0;
HIPCHECK(hipGetDeviceCount(&deviceCount));
HIPASSERT(deviceCount != 0);
printf("No.of gpus in the system: %d\n", deviceCount);
char hipDeviceList[deviceCount][MAX_DEVICE_LENGTH];
char pciDeviceList[deviceCount][MAX_DEVICE_LENGTH];
getPciBusId(deviceCount, hipDeviceList);
for (int i = 0; i < deviceCount; i++) {
int pciBusID = -1;
int pciDeviceID = -1;
int pciDomainID = -1;
int tempPciBusId = -1;
sscanf(hipDeviceList[i], "%04x:%02x:%02x", &pciDomainID, &pciBusID,
&pciDeviceID);
HIPCHECK(hipDeviceGetAttribute(&tempPciBusId, hipDeviceAttributePciBusId, i));
if (pciBusID != tempPciBusId) {
testResult = false;
printf("pciBusID from hipDeviceGetPCIBusId mismatched to that from "
"hipDeviceGetAttribute for gpu %d\n", i);
}
}
printf("pciBusID output of both hipDeviceGetPCIBusId and"
" hipDeviceGetAttribute matched for all gpus\n");
return testResult;
}
bool compareHipDeviceGetPCIBusIdWithLspci() {
FILE *fpipe;
bool testResult = false;
{
// Check if lspci is installed, if not, don't proceed
char const *cmd = "lspci --version";
char *lspciCheck;
char temp[20];
fpipe = popen(cmd, "r");
if (fpipe == nullptr) {
printf("Unable to create command file\n");
return testResult;
}
lspciCheck = fgets(temp, 20, fpipe);
pclose(fpipe);
if (!lspciCheck) {
printf("lspci not found. Skipping the test\n");
return true;
}
}
int deviceCount = 0;
HIPCHECK(hipGetDeviceCount(&deviceCount));
HIPASSERT(deviceCount != 0);
printf("No.of gpus in the system: %d\n", deviceCount);
char hipDeviceList[deviceCount][MAX_DEVICE_LENGTH];
char pciDeviceList[deviceCount][MAX_DEVICE_LENGTH];
getPciBusId(deviceCount, hipDeviceList);
// Get lspci device list and compare with hip device list
#if defined(__CUDA_ARCH__)
char const *command = "lspci -D | grep controller | grep NVIDIA | "
"cut -d ' ' -f 1";
#else
char const *command = "lspci -D | grep controller | grep AMD/ATI | "
"cut -d ' ' -f 1";
#endif
fpipe = popen(command, "r");
if (fpipe == nullptr) {
printf("Unable to create command file\n");
return testResult;
}
int index = 0;
int deviceMatchCount = 0;
while (fgets(pciDeviceList[index], sizeof(pciDeviceList[index]), fpipe)) {
bool bMatchFound = false;
for (int deviceNo = 0; deviceNo < deviceCount; deviceNo++) {
if (!strncmp(pciDeviceList[index], hipDeviceList[deviceNo], 10)) {
deviceMatchCount++;
bMatchFound = true;
}
}
if (bMatchFound == false) {
printf("PCI device: %s is not reported by HIP\n", pciDeviceList[index]);
}
index++;
}
pclose(fpipe);
if (deviceMatchCount == deviceCount) {
printf("hip and lspci output for {pciDomainID, pciBusID, pciDeviceID} "
"matched for all gpus\n");
testResult = true;
} else {
printf("Mismatch in number GPUs reported by HIP with lscpi\n");
}
return testResult;
}
int main(int argc, char* argv[]) {
bool testResult = true;
HipTest::parseStandardArguments(argc, argv, true);
if (p_tests & 0x1) {
testResult &= comparePciBusIDWithHipDeviceGetAttribute();
}
if (p_tests & 0x2) {
#ifdef __unix__
testResult &= compareHipDeviceGetPCIBusIdWithLspci();
#else
printf("Detected non-linux OS. Skipping the test\n");
#endif
}
if (testResult) {
passed();
} else {
failed("one or more tests failed\n");
}
}
/*
* Copyright (c) 2015-present Advanced Micro Devices, Inc. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/*
* Test to compare
* 1.pciBusID from hipDeviceGetPCIBusId and hipDeviceGetAttribute **
* 2.{pciDomainID, pciBusID, pciDeviceID} values hipDeviceGetPCIBusId vs lspci **
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST_NAMED: %t hipDeviceGetPCIBusId-vs-hipDeviceGetAttribute --tests 0x1
* TEST_NAMED: %t hipDeviceGetPCIBusId-vs-lspci --tests 0x2 EXCLUDE_HIP_PLATFORM nvcc
* HIT_END
*/
#include "test_common.h"
#define MAX_DEVICE_LENGTH 20
static bool getPciBusId(int deviceCount, char hipDeviceList[][MAX_DEVICE_LENGTH]) {
for (int i = 0; i < deviceCount; i++) {
HIPCHECK(hipDeviceGetPCIBusId(hipDeviceList[i], MAX_DEVICE_LENGTH, i));
}
return true;
}
bool comparePciBusIDWithHipDeviceGetAttribute() {
bool testResult = true;
int deviceCount = 0;
HIPCHECK(hipGetDeviceCount(&deviceCount));
HIPASSERT(deviceCount != 0);
printf("No.of gpus in the system: %d\n", deviceCount);
char hipDeviceList[deviceCount][MAX_DEVICE_LENGTH];
char pciDeviceList[deviceCount][MAX_DEVICE_LENGTH];
getPciBusId(deviceCount, hipDeviceList);
for (int i = 0; i < deviceCount; i++) {
int pciBusID = -1;
int pciDeviceID = -1;
int pciDomainID = -1;
int tempPciBusId = -1;
sscanf(hipDeviceList[i], "%04x:%02x:%02x", &pciDomainID, &pciBusID,
&pciDeviceID);
HIPCHECK(hipDeviceGetAttribute(&tempPciBusId, hipDeviceAttributePciBusId, i));
if (pciBusID != tempPciBusId) {
testResult = false;
printf("pciBusID from hipDeviceGetPCIBusId mismatched to that from "
"hipDeviceGetAttribute for gpu %d\n", i);
}
}
printf("pciBusID output of both hipDeviceGetPCIBusId and"
" hipDeviceGetAttribute matched for all gpus\n");
return testResult;
}
bool compareHipDeviceGetPCIBusIdWithLspci() {
FILE *fpipe;
bool testResult = false;
{
// Check if lspci is installed, if not, don't proceed
char const *cmd = "lspci --version";
char *lspciCheck;
char temp[20];
fpipe = popen(cmd, "r");
if (fpipe == nullptr) {
printf("Unable to create command file\n");
return testResult;
}
lspciCheck = fgets(temp, 20, fpipe);
pclose(fpipe);
if (!lspciCheck) {
printf("lspci not found. Skipping the test\n");
return true;
}
}
int deviceCount = 0;
HIPCHECK(hipGetDeviceCount(&deviceCount));
HIPASSERT(deviceCount != 0);
printf("No.of gpus in the system: %d\n", deviceCount);
char hipDeviceList[deviceCount][MAX_DEVICE_LENGTH];
char pciDeviceList[deviceCount][MAX_DEVICE_LENGTH];
getPciBusId(deviceCount, hipDeviceList);
// Get lspci device list and compare with hip device list
#if defined(__CUDA_ARCH__)
char const *command = "lspci -D | grep controller | grep NVIDIA | "
"cut -d ' ' -f 1";
#else
char const *command = "lspci -D | grep controller | grep AMD/ATI | "
"cut -d ' ' -f 1";
#endif
fpipe = popen(command, "r");
if (fpipe == nullptr) {
printf("Unable to create command file\n");
return testResult;
}
int index = 0;
int deviceMatchCount = 0;
while (fgets(pciDeviceList[index], sizeof(pciDeviceList[index]), fpipe)) {
bool bMatchFound = false;
for (int deviceNo = 0; deviceNo < deviceCount; deviceNo++) {
if (!strncmp(pciDeviceList[index], hipDeviceList[deviceNo], 10)) {
deviceMatchCount++;
bMatchFound = true;
}
}
if (bMatchFound == false) {
printf("PCI device: %s is not reported by HIP\n", pciDeviceList[index]);
}
index++;
}
pclose(fpipe);
if (deviceMatchCount == deviceCount) {
printf("hip and lspci output for {pciDomainID, pciBusID, pciDeviceID} "
"matched for all gpus\n");
testResult = true;
} else {
printf("Mismatch in number GPUs reported by HIP with lscpi\n");
}
return testResult;
}
int main(int argc, char* argv[]) {
bool testResult = true;
HipTest::parseStandardArguments(argc, argv, true);
if (p_tests & 0x1) {
testResult &= comparePciBusIDWithHipDeviceGetAttribute();
}
if (p_tests & 0x2) {
#ifdef __unix__
testResult &= compareHipDeviceGetPCIBusIdWithLspci();
#else
printf("Detected non-linux OS. Skipping the test\n");
#endif
}
if (testResult) {
passed();
} else {
failed("one or more tests failed\n");
}
}
+1 -1
Просмотреть файл
@@ -25,7 +25,7 @@
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST_NAMED: %t hipSetGetDevice-invalidDevice
* TEST_NAMED: %t hipSetGetDevice-allValidDevice
* TEST_NAMED: %t hipSetGetDevice-validDev1 --computeDevCnt 1
+1 -1
Просмотреть файл
@@ -24,7 +24,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp
* BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -24,7 +24,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -20,7 +20,7 @@
// Test for hipMemset2D functionality for different width and height values
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST_NAMED: %t hipMemset2D-basic
* TEST_NAMED: %t hipMemset2D-dim1 --width2D 10 --height2D 10 --memsetWidth 4 --memsetHeight 4
* TEST_NAMED: %t hipMemset2D-dim2 --width2D 100 --height2D 100 --memsetWidth 20 --memsetHeight 40
+1 -1
Просмотреть файл
@@ -21,7 +21,7 @@
// and also launch hipMemcpyAsync() api on the same stream. This test case is simulate the scenario
// reported in SWDEV-181598.
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -21,7 +21,7 @@
// and also launch hipMemcpyAsync() api. This test case is simulate the scenario
// reported in SWDEV-181598.
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -18,7 +18,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -18,7 +18,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM rocclr
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM rocclr nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -18,7 +18,7 @@ THE SOFTWARE.
*/
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -21,7 +21,7 @@
// kernel. Verify that all the kernels queued are executed before the callback.
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -21,7 +21,7 @@
// when hipStreamAddCallback() is called back to back multiple calls
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -22,7 +22,7 @@
// by hipStreamAddCallback() api.
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -22,7 +22,7 @@
// finish. Ideally Host thread should not wait for callback to finish.
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -18,7 +18,7 @@
* */
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/
+1 -1
Просмотреть файл
@@ -19,7 +19,7 @@ THE SOFTWARE.
/* HIT_START
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11
* BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvcc
* TEST: %t
* HIT_END
*/