SWDEV-425967, SWDEV-425968 - Revert "SWDEV-415029 - [ABI Break] Remove hcc symbols"
This reverts commit 403afae98f.
Reason for revert: This causes build failure in hipBLASLt & hipSPARSELt
Change-Id: Ifb1ee519971c6183eb53634d6d8901a9e94cc9cc
This commit is contained in:
@@ -42,7 +42,7 @@ static void getDeviceCount(int *pdevCnt) {
|
||||
pipe(fd);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
#else
|
||||
unsetenv("ROCR_VISIBLE_DEVICES");
|
||||
@@ -96,7 +96,7 @@ bool runMaskedDeviceTest(int actualNumGPUs) {
|
||||
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
HIP_CHECK(hipInit(0));
|
||||
|
||||
@@ -46,7 +46,7 @@ void getDeviceCount(int *pdevCnt) {
|
||||
pipe(fd);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
#else
|
||||
unsetenv("ROCR_VISIBLE_DEVICES");
|
||||
@@ -101,7 +101,7 @@ bool testWithMaskedDevices(int actualNumGPUs) {
|
||||
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
HIP_CHECK(hipInit(0));
|
||||
|
||||
@@ -42,7 +42,7 @@ static void getDeviceCount(int *pdevCnt) {
|
||||
pipe(fd);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
#else
|
||||
unsetenv("ROCR_VISIBLE_DEVICES");
|
||||
@@ -98,7 +98,7 @@ static bool getTotalMemoryOfMaskedDevices(int actualNumGPUs) {
|
||||
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
HIP_CHECK(hipInit(0));
|
||||
|
||||
@@ -45,7 +45,7 @@ static void getDeviceCount(int *pdevCnt) {
|
||||
pipe(fd);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
#else
|
||||
unsetenv("ROCR_VISIBLE_DEVICES");
|
||||
@@ -101,7 +101,7 @@ static bool validateGetAttributeOfMaskedDevices(int actualNumGPUs) {
|
||||
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
HIP_CHECK(hipInit(0));
|
||||
|
||||
@@ -38,7 +38,7 @@ TEST_CASE("Unit_hipGetDeviceCount_MaskedDevices") {
|
||||
char visibleDeviceString[MAX_SIZE] = {};
|
||||
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);
|
||||
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
#else
|
||||
|
||||
@@ -44,7 +44,7 @@ static void getDeviceCount(int *pdevCnt) {
|
||||
pipe(fd);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
#else
|
||||
unsetenv("ROCR_VISIBLE_DEVICES");
|
||||
@@ -101,7 +101,7 @@ static bool validateGetPropsOfMaskedDevices(int actualNumGPUs) {
|
||||
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);
|
||||
|
||||
// disable visible_devices env from shell
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
HIP_CHECK(hipInit(0));
|
||||
|
||||
@@ -101,7 +101,7 @@ static void testInvalidDevice(int numDevices, bool useRocrEnv,
|
||||
|
||||
if (cPid == 0) { // child
|
||||
hipError_t err;
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
#else
|
||||
if (true == useRocrEnv) {
|
||||
@@ -190,7 +190,7 @@ static void testValidDevices(int numDevices, bool useRocrEnv, int *deviceList,
|
||||
cPid = fork();
|
||||
|
||||
if (cPid == 0) {
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
#ifdef __HIP_PLATFORM_NVCC__
|
||||
unsetenv("CUDA_VISIBLE_DEVICES");
|
||||
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
|
||||
#else
|
||||
@@ -420,7 +420,7 @@ TEST_CASE("Unit_hipSetDevice_InvalidVisibleDeviceList") {
|
||||
SECTION("Test setting invalid device to HIP_VISIBLE_DEVICES") {
|
||||
testInvalidDevice(numDevices, false, numDevices);
|
||||
}
|
||||
#ifndef __HIP_PLATFORM_NVIDIA__
|
||||
#ifndef __HIP_PLATFORM_NVCC__
|
||||
SECTION("Test setting -1 to ROCR_VISIBLE_DEVICES") {
|
||||
testInvalidDevice(numDevices, true, -1);
|
||||
}
|
||||
@@ -449,7 +449,7 @@ TEST_CASE("Unit_hipSetDevice_ValidVisibleDeviceList") {
|
||||
SECTION("Test setting valid hip visible device list") {
|
||||
testValidDevices(numDevices, false, deviceList, numDevices);
|
||||
}
|
||||
#ifndef __HIP_PLATFORM_NVIDIA__
|
||||
#ifndef __HIP_PLATFORM_NVCC__
|
||||
SECTION("Test setting valid rocr visible device list") {
|
||||
testValidDevices(numDevices, true, deviceList, numDevices);
|
||||
}
|
||||
@@ -472,7 +472,7 @@ TEST_CASE("Unit_hipSetDevice_SubsetOfAvailableDevices") {
|
||||
deviceList[i] = deviceListLength-1-i;
|
||||
}
|
||||
|
||||
#ifndef __HIP_PLATFORM_NVIDIA__
|
||||
#ifndef __HIP_PLATFORM_NVCC__
|
||||
testValidDevices(numDevices, true, deviceList,
|
||||
deviceListLength);
|
||||
#endif
|
||||
@@ -480,7 +480,7 @@ TEST_CASE("Unit_hipSetDevice_SubsetOfAvailableDevices") {
|
||||
deviceListLength);
|
||||
}
|
||||
|
||||
#ifndef __HIP_PLATFORM_NVIDIA__
|
||||
#ifndef __HIP_PLATFORM_NVCC__
|
||||
/* Following tests apply only for AMD Platforms */
|
||||
|
||||
/**
|
||||
@@ -565,6 +565,6 @@ TEST_CASE("Unit_hipSetDevice_RvdCvdDevicesList") {
|
||||
|
||||
testRvdCvd(numDevices, deviceList, count);
|
||||
}
|
||||
#endif // __HIP_PLATFORM_NVIDIA__
|
||||
#endif // __HIP_PLATFORM_NVCC__
|
||||
|
||||
#endif // __linux__
|
||||
|
||||
Reference in New Issue
Block a user