Skip to content

Commit

Permalink
SWDEV-415029 - [ABI Break] Remove hcc symbols
Browse files Browse the repository at this point in the history
Change-Id: Ic0082d3960aadbb7bc559141b6e84bd29a75b5cf
  • Loading branch information
tomsang authored and zhang2amd committed Nov 22, 2023
1 parent 4cab582 commit dedfea6
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion catch/DoxyfileTests
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ PREDEFINED = TEMPLATE_TEST_CASE(x)=x() \
__linux__ \
HT_AMD \
HT_NVIDIA \
__HIP_PLATFORM_NVCC__ \
__HIP_PLATFORM_NVIDIA__ \
__GNUC__

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
Expand Down
4 changes: 2 additions & 2 deletions catch/include/hip_test_context.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ THE SOFTWARE.
#endif

// Platform check
#if defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)
#if defined(__HIP_PLATFORM_AMD__)
#define HT_AMD 1
#define HT_NVIDIA 0
#elif defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__)
#elif defined(__HIP_PLATFORM_NVIDIA__)
#define HT_AMD 0
#define HT_NVIDIA 1
#else
Expand Down
4 changes: 2 additions & 2 deletions catch/multiproc/hipDeviceComputeCapabilityMproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void getDeviceCount(int *pdevCnt) {
pipe(fd);

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
#else
unsetenv("ROCR_VISIBLE_DEVICES");
Expand Down Expand Up @@ -96,7 +96,7 @@ bool runMaskedDeviceTest(int actualNumGPUs) {
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
HIP_CHECK(hipInit(0));
Expand Down
4 changes: 2 additions & 2 deletions catch/multiproc/hipDeviceGetPCIBusIdMproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void getDeviceCount(int *pdevCnt) {
pipe(fd);

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
#else
unsetenv("ROCR_VISIBLE_DEVICES");
Expand Down Expand Up @@ -101,7 +101,7 @@ bool testWithMaskedDevices(int actualNumGPUs) {
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
HIP_CHECK(hipInit(0));
Expand Down
4 changes: 2 additions & 2 deletions catch/multiproc/hipDeviceTotalMemMproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void getDeviceCount(int *pdevCnt) {
pipe(fd);

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
#else
unsetenv("ROCR_VISIBLE_DEVICES");
Expand Down Expand Up @@ -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_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
HIP_CHECK(hipInit(0));
Expand Down
4 changes: 2 additions & 2 deletions catch/multiproc/hipGetDeviceAttributeMproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void getDeviceCount(int *pdevCnt) {
pipe(fd);

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
#else
unsetenv("ROCR_VISIBLE_DEVICES");
Expand Down Expand Up @@ -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_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
HIP_CHECK(hipInit(0));
Expand Down
2 changes: 1 addition & 1 deletion catch/multiproc/hipGetDeviceCountMproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TEST_CASE("Unit_hipGetDeviceCount_MaskedDevices") {
char visibleDeviceString[MAX_SIZE] = {};
snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE);

#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
#else
Expand Down
4 changes: 2 additions & 2 deletions catch/multiproc/hipGetDevicePropertiesMproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void getDeviceCount(int *pdevCnt) {
pipe(fd);

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
#else
unsetenv("ROCR_VISIBLE_DEVICES");
Expand Down Expand Up @@ -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_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
HIP_CHECK(hipInit(0));
Expand Down
14 changes: 7 additions & 7 deletions catch/multiproc/hipSetGetDeviceMproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void testInvalidDevice(int numDevices, bool useRocrEnv,

if (cPid == 0) { // child
hipError_t err;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
#else
if (true == useRocrEnv) {
Expand Down Expand Up @@ -190,7 +190,7 @@ static void testValidDevices(int numDevices, bool useRocrEnv, int *deviceList,
cPid = fork();

if (cPid == 0) {
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
unsetenv("CUDA_VISIBLE_DEVICES");
setenv("CUDA_VISIBLE_DEVICES", visibleDeviceString, 1);
#else
Expand Down Expand Up @@ -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_NVCC__
#ifndef __HIP_PLATFORM_NVIDIA__
SECTION("Test setting -1 to ROCR_VISIBLE_DEVICES") {
testInvalidDevice(numDevices, true, -1);
}
Expand Down Expand Up @@ -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_NVCC__
#ifndef __HIP_PLATFORM_NVIDIA__
SECTION("Test setting valid rocr visible device list") {
testValidDevices(numDevices, true, deviceList, numDevices);
}
Expand All @@ -472,15 +472,15 @@ TEST_CASE("Unit_hipSetDevice_SubsetOfAvailableDevices") {
deviceList[i] = deviceListLength-1-i;
}

#ifndef __HIP_PLATFORM_NVCC__
#ifndef __HIP_PLATFORM_NVIDIA__
testValidDevices(numDevices, true, deviceList,
deviceListLength);
#endif
testValidDevices(numDevices, false, deviceList,
deviceListLength);
}

#ifndef __HIP_PLATFORM_NVCC__
#ifndef __HIP_PLATFORM_NVIDIA__
/* Following tests apply only for AMD Platforms */

/**
Expand Down Expand Up @@ -565,6 +565,6 @@ TEST_CASE("Unit_hipSetDevice_RvdCvdDevicesList") {

testRvdCvd(numDevices, deviceList, count);
}
#endif // __HIP_PLATFORM_NVCC__
#endif // __HIP_PLATFORM_NVIDIA__

#endif // __linux__
4 changes: 2 additions & 2 deletions catch/unit/device/getDeviceCount_exe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int main(int argc, char** argv) {
}

// disable visible_devices env from shell
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
UNSETENV("CUDA_VISIBLE_DEVICES");
SETENV("CUDA_VISIBLE_DEVICES", argv[1]);
auto init_res = hipInit(0);
Expand All @@ -79,7 +79,7 @@ int main(int argc, char** argv) {
return -1;
}

#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
UNSETENV("CUDA_VISIBLE_DEVICES");
#else
UNSETENV("ROCR_VISIBLE_DEVICES");
Expand Down
34 changes: 17 additions & 17 deletions catch/unit/memory/hipMemcpy3DAsync_old.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void Memcpy3DAsync<T>::D2H_H2D_DeviceMem_OnDiffDevice() {
myparms.srcPtr = make_hipPitchedPtr(hData, width * sizeof(T),
width, height);
myparms.dstArray = arr;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyHostToDevice;
#else
myparms.kind = hipMemcpyHostToDevice;
Expand All @@ -166,7 +166,7 @@ void Memcpy3DAsync<T>::D2H_H2D_DeviceMem_OnDiffDevice() {
width * sizeof(T),
width, height);
myparms.srcArray = arr;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToHost;
#else
myparms.kind = hipMemcpyDeviceToHost;
Expand Down Expand Up @@ -218,7 +218,7 @@ void Memcpy3DAsync<T>::D2D_DeviceMem_OnDiffDevice() {
width * sizeof(T),
width, height);
myparms.dstArray = arr;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyHostToDevice;
#else
myparms.kind = hipMemcpyHostToDevice;
Expand All @@ -241,7 +241,7 @@ void Memcpy3DAsync<T>::D2D_DeviceMem_OnDiffDevice() {
// Device to Device
myparms.srcArray = arr;
myparms.dstArray = arr2;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
Expand All @@ -261,7 +261,7 @@ void Memcpy3DAsync<T>::D2D_DeviceMem_OnDiffDevice() {
width * sizeof(T),
width, height);
myparms.srcArray = arr2;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToHost;
#else
myparms.kind = hipMemcpyDeviceToHost;
Expand Down Expand Up @@ -294,7 +294,7 @@ void Memcpy3DAsync<T>::NegativeTests() {
myparms.srcPos = make_hipPos(0, 0, 0);
myparms.dstPos = make_hipPos(0, 0, 0);
myparms.extent = make_hipExtent(width , height, depth);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyHostToDevice;
#else
myparms.kind = hipMemcpyHostToDevice;
Expand Down Expand Up @@ -406,7 +406,7 @@ void Memcpy3DAsync<T>::NegativeTests() {
myparms.srcPos = make_hipPos(width+1, 0, 0);
myparms.srcArray = arr;
myparms.dstArray = arr1;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
Expand All @@ -418,7 +418,7 @@ void Memcpy3DAsync<T>::NegativeTests() {
myparms.srcPos = make_hipPos(0, height+1, 0);
myparms.srcArray = arr;
myparms.dstArray = arr1;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
Expand All @@ -430,7 +430,7 @@ void Memcpy3DAsync<T>::NegativeTests() {
myparms.srcPos = make_hipPos(0, 0, depth+1);
myparms.srcArray = arr;
myparms.dstArray = arr1;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
Expand All @@ -447,7 +447,7 @@ void Memcpy3DAsync<T>::NegativeTests() {
, 3), hipArrayDefault));
myparms.srcArray = arr;
myparms.dstArray = arr2;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
Expand Down Expand Up @@ -493,7 +493,7 @@ void Memcpy3DAsync<T>::D2D_SameDeviceMem_StreamDiffDevice() {
// Host to Device
myparms.srcPtr = make_hipPitchedPtr(hData, width * sizeof(T), width, height);
myparms.dstArray = arr;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyHostToDevice;
#else
myparms.kind = hipMemcpyHostToDevice;
Expand All @@ -506,7 +506,7 @@ void Memcpy3DAsync<T>::D2D_SameDeviceMem_StreamDiffDevice() {
SetDefaultData();
myparms.srcArray = arr;
myparms.dstArray = arr1;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
Expand All @@ -522,7 +522,7 @@ void Memcpy3DAsync<T>::D2D_SameDeviceMem_StreamDiffDevice() {
myparms.dstPtr = make_hipPitchedPtr(hOutputData,
width * sizeof(T), width, height);
myparms.srcArray = arr1;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToHost;
#else
myparms.kind = hipMemcpyDeviceToHost;
Expand Down Expand Up @@ -555,7 +555,7 @@ void Memcpy3DAsync<T>::Extent_Validation() {
myparms.dstPos = make_hipPos(0, 0, 0);
myparms.srcPtr = make_hipPitchedPtr(hData, width * sizeof(T), width, height);
myparms.dstArray = arr;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyHostToDevice;
#else
myparms.kind = hipMemcpyHostToDevice;
Expand Down Expand Up @@ -603,7 +603,7 @@ void Memcpy3DAsync<T>::simple_Memcpy3DAsync() {
// Host to Device
myparms.srcPtr = make_hipPitchedPtr(hData, width * sizeof(T), width, height);
myparms.dstArray = arr;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyHostToDevice;
#else
myparms.kind = hipMemcpyHostToDevice;
Expand All @@ -622,7 +622,7 @@ void Memcpy3DAsync<T>::simple_Memcpy3DAsync() {
SetDefaultData();
myparms.srcArray = arr;
myparms.dstArray = arr1;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
Expand All @@ -638,7 +638,7 @@ void Memcpy3DAsync<T>::simple_Memcpy3DAsync() {
myparms.dstPtr = make_hipPitchedPtr(hOutputData,
width * sizeof(T), width, height);
myparms.srcArray = arr1;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToHost;
#else
myparms.kind = hipMemcpyDeviceToHost;
Expand Down
Loading

0 comments on commit dedfea6

Please sign in to comment.