Remove hip-hcc codes: Part three

1.Rename include/hip/hcc_detail/ as include/hip/amd_detail/

2.Rename include/hip/nvcc_detail/ as include/hip/nvidia_detail/

3.Create __HIP_PLATFORM_AMD__ to replace __HIP_PLATFORM_HCC__

4.Create __HIP_PLATFORM_NVIDIA__ to replace __HIP_PLATFORM_NVCC__

After hcc_detail, nvcc_detail, __HIP_PLATFORM_HCC__ and __HIP_PLATFORM_NVCC__
have been removed from upstream, they will be removed from hip runtime.

Change-Id: I1ae457effd739d6c25bca203c1724b026be21fce


[ROCm/hip commit: c2adc70d4d]
This commit is contained in:
Tao Sang
2020-12-15 17:38:08 -05:00
committed by Tao Sang
parent 409a10d21f
commit c618b6aeff
159 changed files with 411 additions and 4485 deletions
@@ -136,7 +136,7 @@ int main(int argc, char* argv[]) {
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeCooperativeLaunch, props.cooperativeLaunch));
CHECK(test_hipDeviceGetAttribute(deviceId, hipDeviceAttributeCooperativeMultiDeviceLaunch, props.cooperativeMultiDeviceLaunch));
#ifndef __HIP_PLATFORM_NVCC__
#ifndef __HIP_PLATFORM_NVIDIA__
CHECK(test_hipDeviceGetHdpAddress(deviceId, hipDeviceAttributeHdpMemFlushCntl, props.hdpMemFlushCntl));
CHECK(test_hipDeviceGetHdpAddress(deviceId, hipDeviceAttributeHdpRegFlushCntl, props.hdpRegFlushCntl));
#endif
@@ -35,7 +35,7 @@ void NegativeTests(){
hipEvent_t start,end;
float tms = 1.0f;
HIPASSERT(hipEventElapsedTime(nullptr,start,end) == hipErrorInvalidValue);
#ifndef __HIP_PLATFORM_NVCC__
#ifndef __HIP_PLATFORM_NVIDIA__
// On NVCC platform API throws seg fault hence skipping
HIPASSERT(hipEventElapsedTime(&tms,nullptr,end) == hipErrorInvalidHandle);
HIPASSERT(hipEventElapsedTime(&tms,start,nullptr) == hipErrorInvalidHandle);
@@ -150,7 +150,7 @@ int main() {
int numElements = 1024 * 16;
size_t sizeBytes = numElements * sizeof(int);
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
{
// Stimulate error condition:
int* A = &numElements;
@@ -206,7 +206,7 @@ bool NegativeTestsMallocManaged(int NumDevices) {
IfTestPassed = false;
}
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
// The flag hipMemAttachHost is currently not supported therefore
// api should return "hipErrorInvalidValue" for now
err = hipMallocManaged(&A, 1024, hipMemAttachHost);
@@ -215,7 +215,7 @@ bool NegativeTestsMallocManaged(int NumDevices) {
hipGetErrorString(err));
IfTestPassed = false;
}
#endif // __HIP_PLATFORM_HCC__
#endif // __HIP_PLATFORM_AMD__
err = hipMallocManaged(NULL, 0, 0);
if (hipErrorInvalidValue != err) {
@@ -51,7 +51,7 @@ void runTest(int width,int height,int depth, hipChannelFormatKind formatKind)
myparms.srcPtr = make_hipPitchedPtr(hData, width * sizeof(T), width, height);
myparms.dstArray = arr;
myparms.extent = make_hipExtent(width , height, depth);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyHostToDevice;
#else
myparms.kind = hipMemcpyHostToDevice;
@@ -65,7 +65,7 @@ void runTest(int width,int height,int depth, hipChannelFormatKind formatKind)
myparms.srcArray = arr;
myparms.dstArray = arr1;
myparms.extent = make_hipExtent(width, height, depth);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToDevice;
#else
myparms.kind = hipMemcpyDeviceToDevice;
@@ -82,7 +82,7 @@ void runTest(int width,int height,int depth, hipChannelFormatKind formatKind)
myparms.dstPtr = make_hipPitchedPtr(hOutputData, width * sizeof(T), width, height);
myparms.srcArray = arr1;
myparms.extent = make_hipExtent(width, height, depth);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = cudaMemcpyDeviceToHost;
#else
myparms.kind = hipMemcpyDeviceToHost;
@@ -60,7 +60,7 @@ bool testhipMemset3D(int memsetval,int p_gpuDevice)
myparms.dstPtr = make_hipPitchedPtr(A_h, width , numW, numH);
myparms.srcPtr = devPitchedPtr;
myparms.extent = extent;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = hipMemcpyKindToCudaMemcpyKind(hipMemcpyDeviceToHost);
#else
myparms.kind = hipMemcpyDeviceToHost;
@@ -111,7 +111,7 @@ bool testhipMemset3DAsync(int memsetval,int p_gpuDevice)
myparms.dstPtr = make_hipPitchedPtr(A_h, width , numW, numH);
myparms.srcPtr = devPitchedPtr;
myparms.extent = extent;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
myparms.kind = hipMemcpyKindToCudaMemcpyKind(hipMemcpyDeviceToHost);
#else
myparms.kind = hipMemcpyDeviceToHost;
@@ -34,7 +34,7 @@ THE SOFTWARE.
#define USE_HCC_MEMTRACKER 0 /* Debug flag to show the memtracker periodically */
#if defined(__HIP_PLATFORM_HCC__) && !defined(__HIP_ROCclr__)
#if defined(__HIP_PLATFORM_AMD__) && !defined(__HIP_ROCclr__)
#include <hc_am.hpp>
#else
#define USE_HCC_MEMTRACKER 0
@@ -98,7 +98,7 @@ void testhipModuleLoadDataExUnloadStress() {
int main(int argc, char* argv[]) {
HipTest::parseStandardArguments(argc, argv, true);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipInit(0));
hipDevice_t device;
hipCtx_t context;
@@ -112,7 +112,7 @@ int main(int argc, char* argv[]) {
} else if (p_tests == 0x3) {
testhipModuleLoadDataExUnloadStress();
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
passed();
@@ -101,7 +101,7 @@ void createRandomFile(const char* filename) {
/**
* Internal Function
*/
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
void initHipCtx(hipCtx_t *pcontext) {
HIPCHECK(hipInit(0));
hipDevice_t device;
@@ -117,7 +117,7 @@ void initHipCtx(hipCtx_t *pcontext) {
bool testhipModuleLoadNeg10() {
bool TestPassed = false;
hipError_t ret;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -127,7 +127,7 @@ bool testhipModuleLoadNeg10() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -141,7 +141,7 @@ bool testhipModuleLoadNeg11() {
bool TestPassed = false;
hipError_t ret;
hipModule_t Module;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -151,7 +151,7 @@ bool testhipModuleLoadNeg11() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -168,7 +168,7 @@ bool testhipModuleLoadNeg12() {
std::fstream fs;
fs.open(FILENAME_EMPTY, std::ios::out);
fs.close();
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -178,7 +178,7 @@ bool testhipModuleLoadNeg12() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
remove(FILENAME_EMPTY);
@@ -195,7 +195,7 @@ bool testhipModuleLoadNeg13() {
hipModule_t Module;
// Create a binary file with random numbers
createRandomFile(FILENAME_RAND);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -205,7 +205,7 @@ bool testhipModuleLoadNeg13() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
remove(FILENAME_RAND);
@@ -220,7 +220,7 @@ bool testhipModuleLoadNeg14() {
bool TestPassed = false;
hipError_t ret;
hipModule_t Module;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -230,7 +230,7 @@ bool testhipModuleLoadNeg14() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -244,7 +244,7 @@ bool testhipModuleLoadNeg15() {
bool TestPassed = false;
hipError_t ret;
hipModule_t Module;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -253,7 +253,7 @@ bool testhipModuleLoadNeg15() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -267,7 +267,7 @@ bool testhipModuleLoadDataNeg20() {
bool TestPassed = false;
hipError_t ret;
auto buffer = load_file(CODEOBJ_FILE);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -277,7 +277,7 @@ bool testhipModuleLoadDataNeg20() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -291,7 +291,7 @@ bool testhipModuleLoadDataNeg21() {
bool TestPassed = false;
hipError_t ret;
hipModule_t Module;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -301,7 +301,7 @@ bool testhipModuleLoadDataNeg21() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -319,7 +319,7 @@ bool testhipModuleLoadDataNeg22() {
createRandomFile(FILENAME_RAND);
// Open the code object file and copy it in a buffer
auto buffer = load_file(FILENAME_RAND);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -329,7 +329,7 @@ bool testhipModuleLoadDataNeg22() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
remove(FILENAME_RAND);
@@ -344,7 +344,7 @@ bool testhipModuleLoadDataExNeg30() {
hipError_t ret;
// Open the code object file and copy it in a buffer
auto buffer = load_file(CODEOBJ_FILE);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -354,7 +354,7 @@ bool testhipModuleLoadDataExNeg30() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -368,7 +368,7 @@ bool testhipModuleLoadDataExNeg31() {
bool TestPassed = false;
hipError_t ret;
hipModule_t Module;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -378,7 +378,7 @@ bool testhipModuleLoadDataExNeg31() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -396,7 +396,7 @@ bool testhipModuleLoadDataExNeg32() {
createRandomFile(FILENAME_RAND);
// Open the code object file and copy it in a buffer
auto buffer = load_file(FILENAME_RAND);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -406,7 +406,7 @@ bool testhipModuleLoadDataExNeg32() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
remove(FILENAME_RAND);
@@ -421,7 +421,7 @@ bool testhipModuleGetFunctionNeg40() {
bool TestPassed = false;
hipError_t ret;
hipModule_t Module;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -433,7 +433,7 @@ bool testhipModuleGetFunctionNeg40() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -448,7 +448,7 @@ bool testhipModuleGetFunctionNeg41() {
hipError_t ret;
hipModule_t Module;
hipFunction_t Function;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -458,7 +458,7 @@ bool testhipModuleGetFunctionNeg41() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -473,7 +473,7 @@ bool testhipModuleGetFunctionNeg42() {
hipError_t ret;
hipModule_t Module;
hipFunction_t Function;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -485,7 +485,7 @@ bool testhipModuleGetFunctionNeg42() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -500,7 +500,7 @@ bool testhipModuleGetFunctionNeg43() {
hipError_t ret;
hipModule_t Module;
hipFunction_t Function;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -512,7 +512,7 @@ bool testhipModuleGetFunctionNeg43() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -527,7 +527,7 @@ bool testhipModuleGetFunctionNeg44() {
hipError_t ret;
hipModule_t Module;
hipFunction_t Function;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -539,7 +539,7 @@ bool testhipModuleGetFunctionNeg44() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -554,7 +554,7 @@ bool testhipModuleGetFunctionNeg45() {
hipError_t ret;
hipModule_t Module;
hipFunction_t Function;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -566,7 +566,7 @@ bool testhipModuleGetFunctionNeg45() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -581,7 +581,7 @@ bool testhipModuleGetGlobalNeg50() {
hipError_t ret;
hipModule_t Module;
size_t deviceGlobalSize;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -593,7 +593,7 @@ bool testhipModuleGetGlobalNeg50() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -608,7 +608,7 @@ bool testhipModuleGetGlobalNeg51() {
hipError_t ret;
hipModule_t Module;
hipDeviceptr_t deviceGlobal;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -620,7 +620,7 @@ bool testhipModuleGetGlobalNeg51() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -636,7 +636,7 @@ bool testhipModuleGetGlobalNeg52() {
hipModule_t Module;
hipDeviceptr_t deviceGlobal;
size_t deviceGlobalSize;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -648,7 +648,7 @@ bool testhipModuleGetGlobalNeg52() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -664,7 +664,7 @@ bool testhipModuleGetGlobalNeg53() {
hipModule_t Module;
hipDeviceptr_t deviceGlobal;
size_t deviceGlobalSize;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -676,7 +676,7 @@ bool testhipModuleGetGlobalNeg53() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -692,7 +692,7 @@ bool testhipModuleGetGlobalNeg54() {
hipModule_t Module;
hipDeviceptr_t deviceGlobal;
size_t deviceGlobalSize;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -704,7 +704,7 @@ bool testhipModuleGetGlobalNeg54() {
hipGetErrorString(ret), ret);
}
HIPCHECK(hipModuleUnload(Module));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -720,7 +720,7 @@ bool testhipModuleGetGlobalNeg55() {
hipModule_t Module;
hipDeviceptr_t deviceGlobal;
size_t deviceGlobalSize;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -732,7 +732,7 @@ bool testhipModuleGetGlobalNeg55() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -748,7 +748,7 @@ bool testhipModuleGetGlobalNeg56() {
hipModule_t Module;
hipDeviceptr_t deviceGlobal;
size_t deviceGlobalSize;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -758,7 +758,7 @@ bool testhipModuleGetGlobalNeg56() {
printf("Test Passed: Error Code Returned: '%s'(%d)\n",
hipGetErrorString(ret), ret);
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -773,7 +773,7 @@ bool testhipModuleLoadNeg60() {
bool TestPassed = true;
hipError_t ret;
hipModule_t Module;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
hipCtx_t context;
initHipCtx(&context);
#endif
@@ -793,7 +793,7 @@ bool testhipModuleLoadNeg60() {
} else {
TestPassed &= false;
}
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipCtxDestroy(context));
#endif
return TestPassed;
@@ -59,7 +59,7 @@ THE SOFTWARE.
#define GRIDDIMZ 1
#define BLOCKDIMZ 1
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
#define CTX_CREATE() \
hipCtx_t context;\
@@ -79,14 +79,14 @@ void initHipCtx(hipCtx_t *pcontext) {
HIPCHECK(hipCtxCreate(pcontext, 0, device));
}
#else // __HIP_PLATFORM_NVCC__
#else // __HIP_PLATFORM_NVIDIA__
#define CTX_CREATE()
#define CTX_DESTROY()
#define ARRAY_DESTROY(array) HIPCHECK(hipFreeArray(array));
#define HIP_TEX_REFERENCE textureReference*
#define HIP_ARRAY hipArray*
#endif // __HIP_PLATFORM_NVCC__
#endif // __HIP_PLATFORM_NVIDIA__
std::atomic<int> g_thTestPassed(1);
@@ -271,7 +271,7 @@ template <class T, class T1> void copyBuffer2Array(unsigned int width,
) {
hip_Memcpy2D copyParam;
memset(&copyParam, 0, sizeof(copyParam));
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
copyParam.dstMemoryType = CU_MEMORYTYPE_ARRAY;
copyParam.srcMemoryType = CU_MEMORYTYPE_HOST;
copyParam.dstArray = *array;
@@ -293,7 +293,7 @@ template <class T> void assignArray2TexRef(hipArray_Format format,
T array
) {
HIP_TEX_REFERENCE texref;
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
HIPCHECK(hipModuleGetTexRef(&texref, Module, texRefName));
HIPCHECK(hipTexRefSetAddressMode(texref, 0, CU_TR_ADDRESS_MODE_WRAP));
HIPCHECK(hipTexRefSetAddressMode(texref, 1, CU_TR_ADDRESS_MODE_WRAP));
@@ -351,7 +351,7 @@ template <class T> bool testTexType(hipArray_Format format,
HIPCHECK(hipModuleLoad(&Module, CODEOBJ_FILE));
HIP_ARRAY array;
allocInitArray(width, height, format, &array);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
// Copy from hData to array using hipMemcpyParam2D
copyBuffer2Array<T, HIP_ARRAY*>(width, height, hData, &array);
// Get tex reference from the loaded kernel file
@@ -438,7 +438,7 @@ template <class T> bool testTexMultStream(const std::vector<char>& buffer,
HIPCHECK(hipModuleLoadData(&Module, &buffer[0]));
HIP_ARRAY array;
allocInitArray(width, height, format, &array);
#ifdef __HIP_PLATFORM_NVCC__
#ifdef __HIP_PLATFORM_NVIDIA__
// Copy from hData to array using hipMemcpyParam2D
copyBuffer2Array<T, HIP_ARRAY*>(width, height, hData, &array);
// Get tex reference from the loaded kernel file
@@ -79,7 +79,7 @@ bool argValidation() {
TestPassed &= false;
}
#ifndef __HIP_PLATFORM_NVCC__
#ifndef __HIP_PLATFORM_NVIDIA__
// nvcc doesnt support kernelfunc(NULL) for api
ret = hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, NULL, 0, 0);
if (ret != hipErrorInvalidValue) {
@@ -37,7 +37,7 @@ THE SOFTWARE.
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -33,7 +33,7 @@
#include "hip/hip_runtime.h"
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -34,7 +34,7 @@
#include "hip/hip_runtime.h"
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -36,7 +36,7 @@ THE SOFTWARE.
#include "hip/hip_runtime.h"
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -34,7 +34,7 @@
#include "hip/hip_runtime.h"
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -32,7 +32,7 @@
#include "hip/hip_runtime.h"
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -31,7 +31,7 @@
#include <atomic>
#include "hip/hip_runtime.h"
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -29,7 +29,7 @@ THE SOFTWARE.
#include "hip/hip_runtime.h"
#include "test_common.h"
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif
@@ -30,7 +30,7 @@ using TestQueues = std::tuple<QueueHipRt<true>, QueueHipRt<false>>;
#define HIP_ASSERT(x) (assert((x)==hipSuccess))
#define HIP_ASSERT_IGNORE(x,ign) auto err=x; HIP_ASSERT(err==ign ? hipSuccess : err)
#ifdef __HIP_PLATFORM_HCC__
#ifdef __HIP_PLATFORM_AMD__
#define HIPRT_CB
#endif