diff --git a/catch/include/hip_test_common.hh b/catch/include/hip_test_common.hh index e846462c10..9274bbf6db 100644 --- a/catch/include/hip_test_common.hh +++ b/catch/include/hip_test_common.hh @@ -129,7 +129,7 @@ THE SOFTWARE. #define CTX_DESTROY() HIPCHECK(hipCtxDestroy(context)); #define ARRAY_DESTROY(array) HIPCHECK(hipArrayDestroy(array)); #define HIP_TEX_REFERENCE hipTexRef -#define HIP_ARRAY hiparray +#define HIP_ARRAY hipArray_t static void initHipCtx(hipCtx_t* pcontext) { HIPCHECK(hipInit(0)); hipDevice_t device; @@ -141,7 +141,7 @@ static void initHipCtx(hipCtx_t* pcontext) { #define CTX_DESTROY() #define ARRAY_DESTROY(array) HIPCHECK(hipFreeArray(array)); #define HIP_TEX_REFERENCE textureReference* -#define HIP_ARRAY hipArray* +#define HIP_ARRAY hipArray_t #endif static inline bool IsGfx11() { diff --git a/catch/include/memcpy3d_tests_common.hh b/catch/include/memcpy3d_tests_common.hh index 27b7c495df..e5d8422a73 100644 --- a/catch/include/memcpy3d_tests_common.hh +++ b/catch/include/memcpy3d_tests_common.hh @@ -618,7 +618,7 @@ constexpr auto MemTypeUnified() { #endif } -using DrvPtrVariant = std::variant; +using DrvPtrVariant = std::variant; template hipError_t DrvMemcpy3DWrapper(DrvPtrVariant dst_ptr, hipPos dst_pos, DrvPtrVariant src_ptr, @@ -626,25 +626,25 @@ hipError_t DrvMemcpy3DWrapper(DrvPtrVariant dst_ptr, hipPos dst_pos, DrvPtrVaria hipStream_t stream = nullptr) { HIP_MEMCPY3D parms = {0}; - if (std::holds_alternative(dst_ptr)) { - parms.dstMemoryType = MemTypeArray(); - parms.dstArray = std::get(dst_ptr); + if (std::holds_alternative(dst_ptr)) { + parms.dstMemoryType = hipMemoryTypeArray; + parms.dstArray = std::get(dst_ptr); } else { auto ptr = std::get(dst_ptr); parms.dstPitch = ptr.pitch; switch (kind) { case hipMemcpyDeviceToHost: case hipMemcpyHostToHost: - parms.dstMemoryType = MemTypeHost(); + parms.dstMemoryType = hipMemoryTypeHost; parms.dstHost = ptr.ptr; break; case hipMemcpyDeviceToDevice: case hipMemcpyHostToDevice: - parms.dstMemoryType = MemTypeDevice(); + parms.dstMemoryType = hipMemoryTypeDevice; parms.dstDevice = reinterpret_cast(ptr.ptr); break; case hipMemcpyDefault: - parms.dstMemoryType = MemTypeUnified(); + parms.dstMemoryType = hipMemoryTypeUnified; parms.dstDevice = reinterpret_cast(ptr.ptr); break; default: @@ -652,25 +652,25 @@ hipError_t DrvMemcpy3DWrapper(DrvPtrVariant dst_ptr, hipPos dst_pos, DrvPtrVaria } } - if (std::holds_alternative(src_ptr)) { - parms.srcMemoryType = MemTypeArray(); - parms.srcArray = std::get(src_ptr); + if (std::holds_alternative(src_ptr)) { + parms.srcMemoryType = hipMemoryTypeArray; + parms.srcArray = std::get(src_ptr); } else { auto ptr = std::get(src_ptr); parms.srcPitch = ptr.pitch; switch (kind) { case hipMemcpyDeviceToHost: case hipMemcpyDeviceToDevice: - parms.srcMemoryType = MemTypeDevice(); + parms.srcMemoryType = hipMemoryTypeDevice; parms.srcDevice = reinterpret_cast(ptr.ptr); break; case hipMemcpyHostToDevice: case hipMemcpyHostToHost: - parms.srcMemoryType = MemTypeHost(); + parms.srcMemoryType = hipMemoryTypeHost; parms.srcHost = ptr.ptr; break; case hipMemcpyDefault: - parms.srcMemoryType = MemTypeUnified(); + parms.srcMemoryType = hipMemoryTypeUnified; parms.srcDevice = reinterpret_cast(ptr.ptr); break; default: diff --git a/catch/include/resource_guards.hh b/catch/include/resource_guards.hh index af4c285e2a..0f8697e121 100644 --- a/catch/include/resource_guards.hh +++ b/catch/include/resource_guards.hh @@ -187,12 +187,12 @@ template class DrvArrayAllocGuard { DrvArrayAllocGuard(const DrvArrayAllocGuard&) = delete; DrvArrayAllocGuard(DrvArrayAllocGuard&&) = delete; - hiparray ptr() const { return ptr_; } + hipArray_t ptr() const { return ptr_; } hipExtent extent() const { return extent_; } private: - hiparray ptr_ = nullptr; + hipArray_t ptr_ = nullptr; const hipExtent extent_; }; diff --git a/catch/multiproc/hipNoGpuTsts.cc b/catch/multiproc/hipNoGpuTsts.cc index ad4b9813f4..08f708eb0b 100644 --- a/catch/multiproc/hipNoGpuTsts.cc +++ b/catch/multiproc/hipNoGpuTsts.cc @@ -1223,7 +1223,7 @@ static bool NoGpuTst_hipMallocArray() { hipError_t err; hipChannelFormatDesc channelDesc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindFloat); - hipArray* hipArray; + hipArray_t hipArray; err = hipMallocArray(&hipArray, &channelDesc, 256, 256); if (err == hipErrorNoDevice) { passed = true; diff --git a/catch/unit/graph/hipGraphAddMemcpyNode.cc b/catch/unit/graph/hipGraphAddMemcpyNode.cc index 45e4077c66..6b8e34bed8 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNode.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNode.cc @@ -69,7 +69,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative") { CHECK_IMAGE_SUPPORT constexpr int width{10}, height{10}, depth{10}; - hipArray *devArray1; + hipArray_t devArray1; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparams; uint32_t size = width * height * depth * sizeof(int); @@ -162,7 +162,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative") { SECTION("Passing different element size for hipMemcpy3DParms::srcArray" "and hipMemcpy3DParms::dstArray") { myparams.srcArray = devArray1; - hipArray *devArray2; + hipArray_t devArray2; HIP_CHECK(hipMalloc3DArray(&devArray2, &channelDesc, make_hipExtent(width+1, height+1, depth+1), hipArrayDefault)); myparams.dstArray = devArray2; @@ -180,7 +180,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative") { static void validateMemcpyNode3DArray(bool peerAccess = false) { constexpr int width{10}, height{10}, depth{10}; - hipArray *devArray1, *devArray2; + hipArray_t devArray1, devArray2; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparams; uint32_t size = width * height * depth * sizeof(int); @@ -285,7 +285,7 @@ static void validateMemcpyNode2DArray(bool peerAccess = false) { int harray2D[YSIZE][XSIZE]{}; int harray2Dres[YSIZE][XSIZE]{}; constexpr int width{XSIZE}, height{YSIZE}; - hipArray *devArray1, *devArray2; + hipArray_t devArray1, devArray2; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparams; hipGraph_t graph; @@ -384,7 +384,7 @@ static void validateMemcpyNode1DArray(bool peerAccess = false) { int harray1D[XSIZE]{}; int harray1Dres[XSIZE]{}; constexpr int width{XSIZE}; - hipArray *devArray1, *devArray2; + hipArray_t devArray1, devArray2; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparams; hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphAddMemcpyNode1D.cc b/catch/unit/graph/hipGraphAddMemcpyNode1D.cc index 9ed4a9fbcd..40c8ef1847 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNode1D.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNode1D.cc @@ -49,7 +49,7 @@ static void validateMemcpyNode1DArray(bool peerAccess) { int harray1D[SIZE]{}; int harray1Dres[SIZE]{}; hipGraph_t graph; - hipArray *devArray1, *devArray2; + hipArray_t devArray1, devArray2; hipGraphNode_t memcpyH2D, memcpyD2H, memcpyD2D; constexpr int numBytes{SIZE * sizeof(int)}; hipStream_t streamForGraph; diff --git a/catch/unit/graph/hipGraphCloneComplx.cc b/catch/unit/graph/hipGraphCloneComplx.cc index 52589cd105..500fb86259 100644 --- a/catch/unit/graph/hipGraphCloneComplx.cc +++ b/catch/unit/graph/hipGraphCloneComplx.cc @@ -377,7 +377,7 @@ static void hipGraphClone_Test_hipGraphMemcpyNodeSetParams() { uint32_t size = width * height * depth * sizeof(int); hipGraphNode_t memcpyNodeH2D, memcpyNodeD2H, memcpyNodeD2D; hipMemcpy3DParms myparms, myparms1, myparms_updated; - hipArray *devArray, *devArray_2; + hipArray_t devArray, devArray_2; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; int *hData, *hDataTemp, *hOutputData; @@ -504,7 +504,7 @@ static void hipGraphClone_Test_hipGraphExecMemcpyNodeSetParams() { int harray1D[XSIZE]{}; int harray1Dres[XSIZE]{}; constexpr int width{XSIZE}; - hipArray *devArray1, *devArray2; + hipArray_t devArray1, devArray2; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparams; hipGraphNode_t memcpyNode1, memcpyNode2, memcpyNode3; @@ -574,7 +574,7 @@ static void hipGraphClone_Test_hipGraphExecMemcpyNodeSetParams() { nullptr, nullptr, 0)); int harray1Dupdate[XSIZE]{}; - hipArray *devArray3; + hipArray_t devArray3; HIP_CHECK(hipMalloc3DArray(&devArray3, &channelDesc, make_hipExtent(width, 0, 0), hipArrayDefault)); diff --git a/catch/unit/graph/hipGraphDebugDotPrint.cc b/catch/unit/graph/hipGraphDebugDotPrint.cc index 8cea4756e9..5e9444def4 100644 --- a/catch/unit/graph/hipGraphDebugDotPrint.cc +++ b/catch/unit/graph/hipGraphDebugDotPrint.cc @@ -182,7 +182,7 @@ static void hipGraphDebugDotPrint_Functional(const char* fName, // Add emcpyNode3D to graph & validate its DebugDotPrint descriptions constexpr int width{10}, height{10}, depth{10}; - hipArray *devArray1; + hipArray_t devArray1; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparams; uint32_t size = width * height * depth * sizeof(int); diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc index 9e180f5117..3fe07bae58 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc @@ -41,7 +41,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative") { CHECK_IMAGE_SUPPORT constexpr int width{10}, height{10}, depth{10}; - hipArray *devArray, *devArray2; + hipArray_t devArray, devArray2; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparms; hipError_t ret; @@ -160,7 +160,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Functional") { int harray1D[XSIZE]{}; int harray1Dres[XSIZE]{}; constexpr int width{XSIZE}; - hipArray *devArray1, *devArray2; + hipArray_t devArray1, devArray2; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparams; hipGraph_t graph; @@ -228,7 +228,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Functional") { HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); int harray1Dupdate[XSIZE]{}; - hipArray *devArray3; + hipArray_t devArray3; HIP_CHECK(hipMalloc3DArray(&devArray3, &channelDesc, make_hipExtent(width, 0, 0), hipArrayDefault)); diff --git a/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc b/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc index 17163f7ad4..34a9ff7d48 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc @@ -42,7 +42,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeGetParams_Negative") { CHECK_IMAGE_SUPPORT constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; - hipArray *devArray; + hipArray_t devArray; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparms; int* hData; @@ -150,7 +150,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeGetParams_Functional") { CHECK_IMAGE_SUPPORT constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; - hipArray *devArray; + hipArray_t devArray; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparms; int* hData; @@ -194,7 +194,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeGetParams_Functional") { SECTION("Set memcpy params and Get param and verify.") { hipMemcpy3DParms myparms1, m3DGetParams1; constexpr int width1{UPDATESIZE}, height1{UPDATESIZE}, depth1{UPDATESIZE}; - hipArray *devArray1; + hipArray_t devArray1; hipChannelFormatKind formatKind1 = hipChannelFormatKindSigned; int* hData1; uint32_t size1 = width1 * height1 * depth1 * sizeof(int); diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc index 01741dc034..2942729960 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc @@ -41,7 +41,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Negative") { CHECK_IMAGE_SUPPORT constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; - hipArray *devArray; + hipArray_t devArray; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparms; int* hData; @@ -99,7 +99,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Functional") { CHECK_IMAGE_SUPPORT constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; - hipArray *devArray; + hipArray_t devArray; hipChannelFormatKind formatKind = hipChannelFormatKindSigned; hipMemcpy3DParms myparms, myparms1; uint32_t size = width * height * depth * sizeof(int); diff --git a/catch/unit/memory/hipArray.cc b/catch/unit/memory/hipArray.cc index e3ca7ff902..2f9ce4056e 100644 --- a/catch/unit/memory/hipArray.cc +++ b/catch/unit/memory/hipArray.cc @@ -20,7 +20,7 @@ THE SOFTWARE. TEST_CASE("Unit_hipArray_Valid") { CHECK_IMAGE_SUPPORT - hipArray* array = nullptr; + hipArray_t array = nullptr; HIP_ARRAY_DESCRIPTOR desc; desc.Format = HIP_AD_FORMAT_FLOAT; desc.NumChannels = 1; @@ -34,20 +34,20 @@ TEST_CASE("Unit_hipArray_Invalid") { CHECK_IMAGE_SUPPORT void* data = malloc(sizeof(char)); - hipArray_t arrayPtr = static_cast(data); + hipArray_t arrayPtr = static_cast(data); REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed); free(data); } TEST_CASE("Unit_hipArray_Nullptr") { CHECK_IMAGE_SUPPORT - hipArray* array = nullptr; + hipArray_t array = nullptr; REQUIRE(hipFreeArray(array) == hipErrorInvalidValue); } TEST_CASE("Unit_hipArray_DoubleFree") { CHECK_IMAGE_SUPPORT - hipArray* array = nullptr; + hipArray_t array = nullptr; HIP_ARRAY_DESCRIPTOR desc; desc.Format = HIP_AD_FORMAT_FLOAT; desc.NumChannels = 1; @@ -60,7 +60,7 @@ TEST_CASE("Unit_hipArray_DoubleFree") { TEST_CASE("Unit_hipArray_TrippleDestroy") { CHECK_IMAGE_SUPPORT - hipArray* array = nullptr; + hipArray_t array = nullptr; HIP_ARRAY_DESCRIPTOR desc; desc.Format = HIP_AD_FORMAT_FLOAT; desc.NumChannels = 1; @@ -74,7 +74,7 @@ TEST_CASE("Unit_hipArray_TrippleDestroy") { TEST_CASE("Unit_hipArray_DoubleNullptr") { CHECK_IMAGE_SUPPORT - hipArray* array = nullptr; + hipArray_t array = nullptr; REQUIRE(hipFreeArray(array) == hipErrorInvalidValue); REQUIRE(hipFreeArray(array) == hipErrorInvalidValue); } @@ -82,7 +82,7 @@ TEST_CASE("Unit_hipArray_DoubleInvalid") { CHECK_IMAGE_SUPPORT void* data = malloc(sizeof(char)); - hipArray_t arrayPtr = static_cast(data); + hipArray_t arrayPtr = static_cast(data); REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed); REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed); free(data); diff --git a/catch/unit/memory/hipArray3DCreate.cc b/catch/unit/memory/hipArray3DCreate.cc index 6a747abc27..a5d3a4bcac 100644 --- a/catch/unit/memory/hipArray3DCreate.cc +++ b/catch/unit/memory/hipArray3DCreate.cc @@ -24,14 +24,14 @@ THE SOFTWARE. #include "hip_test_common.hh" namespace { -void checkArrayIsExpected(const hiparray array, const HIP_ARRAY3D_DESCRIPTOR& expected_desc) { +void checkArrayIsExpected(const hipArray_t array, const HIP_ARRAY3D_DESCRIPTOR& expected_desc) { // hipArray3DGetDescriptor doesn't currently exist (EXSWCPHIPT-87) #if HT_AMD std::ignore = array; std::ignore = expected_desc; #else CUDA_ARRAY3D_DESCRIPTOR queried_desc; - cuArray3DGetDescriptor(&queried_desc, array); + cuArray3DGetDescriptor(&queried_desc, (CUarray)array); REQUIRE(queried_desc.Width == expected_desc.Width); REQUIRE(queried_desc.Height == expected_desc.Height); @@ -43,7 +43,7 @@ void checkArrayIsExpected(const hiparray array, const HIP_ARRAY3D_DESCRIPTOR& ex } void testInvalidDescription(HIP_ARRAY3D_DESCRIPTOR desc) { - hiparray array; + hipArray_t array; HIP_CHECK_ERROR(hipArray3DCreate(&array, &desc), hipErrorInvalidValue); } } // namespace @@ -81,7 +81,7 @@ TEMPLATE_TEST_CASE("Unit_hipArray3DCreate_happy", "", char, uchar2, uint2, int4, CAPTURE(desc.Width, desc.Height, desc.Depth); - hiparray array; + hipArray_t array; HIP_CHECK(hipArray3DCreate(&array, &desc)); checkArrayIsExpected(array, desc); HIP_CHECK(hipArrayDestroy(array)); @@ -95,7 +95,7 @@ TEMPLATE_TEST_CASE("Unit_hipArray3DCreate_MaxTexture", "", int, uint4, short, us using vec_info = vector_info; DriverContext ctx; - hiparray array; + hipArray_t array; HIP_ARRAY3D_DESCRIPTOR desc{}; desc.Format = vec_info::format; desc.NumChannels = vec_info::size; @@ -224,7 +224,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_NullDescPtr") { CHECK_IMAGE_SUPPORT DriverContext ctx; - hiparray array; + hipArray_t array; HIP_CHECK_ERROR(hipArray3DCreate(&array, nullptr), hipErrorInvalidValue); } diff --git a/catch/unit/memory/hipArrayCreate.cc b/catch/unit/memory/hipArrayCreate.cc index 44cd53d597..2b3f2a81d4 100644 --- a/catch/unit/memory/hipArrayCreate.cc +++ b/catch/unit/memory/hipArrayCreate.cc @@ -106,36 +106,31 @@ TEST_CASE("Unit_hipArrayCreate_MultiThread") { // Tests ///////////////////////////////////////// #if HT_AMD -constexpr auto MemoryTypeHost = hipMemoryTypeHost; -constexpr auto MemoryTypeArray = hipMemoryTypeArray; constexpr auto NORMALIZED_COORDINATES = HIP_TRSF_NORMALIZED_COORDINATES; constexpr auto READ_AS_INTEGER = HIP_TRSF_READ_AS_INTEGER; #else -constexpr auto MemoryTypeHost = CU_MEMORYTYPE_HOST; -constexpr auto MemoryTypeArray = CU_MEMORYTYPE_ARRAY; // (EXSWCPHIPT-92) HIP equivalents not defined for CUDA backend. constexpr auto NORMALIZED_COORDINATES = CU_TRSF_NORMALIZED_COORDINATES; constexpr auto READ_AS_INTEGER = CU_TRSF_READ_AS_INTEGER; #endif -// Copy data from host to the hiparray, accounting 1D or 2D arrays +// Copy data from host to the hipArray_t, accounting 1D or 2D arrays template -void copyToArray(hiparray dst, const std::vector& src, const size_t height) { +void copyToArray(hipArray_t dst, const std::vector& src, const size_t height) { const auto sizeInBytes = src.size() * sizeof(T); if (height == 0) { // FIXME(EXSWCPHIPT-64) remove cast when API is fixed (will require major version change) - HIP_CHECK(hipMemcpyHtoA(reinterpret_cast(dst), 0, src.data(), sizeInBytes)); + HIP_CHECK(hipMemcpyHtoA(reinterpret_cast(dst), 0, src.data(), sizeInBytes)); } else { const auto pitch = sizeInBytes / height; hip_Memcpy2D copyParams{}; - copyParams.srcMemoryType = MemoryTypeHost; + copyParams.srcMemoryType = hipMemoryTypeHost; copyParams.srcXInBytes = 0; // x offset copyParams.srcY = 0; // y offset copyParams.srcHost = src.data(); copyParams.srcPitch = pitch; - - copyParams.dstMemoryType = MemoryTypeArray; + copyParams.dstMemoryType = hipMemoryTypeArray; copyParams.dstXInBytes = 0; // x offset copyParams.dstY = 0; // y offset copyParams.dstArray = dst; @@ -150,7 +145,7 @@ void copyToArray(hiparray dst, const std::vector& src, const size_t height) { // Test the allocated array by generating a texture from it then reading from that texture. // Textures are read-only, so write to the array then copy that into normal device memory. template -void testArrayAsTexture(hiparray array, const size_t width, const size_t height) { +void testArrayAsTexture(hipArray_t array, const size_t width, const size_t height) { using vec_info = vector_info; using scalar_type = typename vec_info::type; const auto h = height ? height : 1; @@ -216,7 +211,7 @@ TEMPLATE_TEST_CASE("Unit_hipArrayCreate_happy", "", uint, int, int4, ushort, sho desc.Height = GENERATE(0, 1024); // pointer to the array in device memory - hiparray array{}; + hipArray_t array{}; HIP_CHECK(hipArrayCreate(&array, &desc)); @@ -241,7 +236,7 @@ TEMPLATE_TEST_CASE("Unit_hipArrayCreate_maxTexture", "", uint, int, int4, ushort const Sizes sizes(hipArrayDefault); const size_t s = 64; - hiparray array{}; + hipArray_t array{}; SECTION("Happy") { SECTION("1D - Max") { desc.Width = sizes.max1D; @@ -299,7 +294,7 @@ TEST_CASE("Unit_hipArrayCreate_ZeroWidth") { desc.Height = GENERATE(0, 1024); // pointer to the array in device memory - hiparray array; + hipArray_t array; HIP_CHECK_ERROR(hipArrayCreate(&array, &desc), hipErrorInvalidValue); } @@ -318,7 +313,7 @@ TEST_CASE("Unit_hipArrayCreate_Nullptr") { HIP_CHECK_ERROR(hipArrayCreate(nullptr, &desc), hipErrorInvalidValue); } SECTION("Null Description") { - hiparray array; + hipArray_t array; HIP_CHECK_ERROR(hipArrayCreate(&array, nullptr), hipErrorInvalidValue); } } @@ -334,7 +329,7 @@ TEST_CASE("Unit_hipArrayCreate_BadNumberChannelElement") { desc.Width = 1024; desc.Height = GENERATE(0, 1024); - hiparray array; + hipArray_t array; INFO("Format: " << formatToString(desc.Format) << " NumChannels: " << desc.NumChannels << " Height: " << desc.Height) @@ -360,7 +355,7 @@ TEST_CASE("Unit_hipArrayCreate_BadChannelFormat") { desc.Width = 1024; desc.Height = GENERATE(0, 1024); - hiparray array; + hipArray_t array; INFO("Format: " << formatToString(desc.Format) << " Height: " << desc.Height) HIP_CHECK_ERROR(hipArrayCreate(&array, &desc), hipErrorInvalidValue); diff --git a/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc b/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc index 07273749fa..e556e52997 100644 --- a/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc +++ b/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc @@ -41,7 +41,7 @@ class DrvMemcpy3DAsync { int width, height, depth; unsigned int size; hipArray_Format formatKind; - hiparray arr, arr1; + hipArray_t arr, arr1; hipStream_t stream; size_t pitch_D, pitch_E; HIP_MEMCPY3D myparms; @@ -136,13 +136,8 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstArray = arr; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_ARRAY; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeArray; -#endif SECTION("Passing nullptr to Source Host") { myparms.srcHost = nullptr; @@ -154,11 +149,7 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstArray = nullptr; myparms.dstDevice = D_m; myparms.WidthInBytes = pitch_D; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3DAsync(&myparms, stream) != hipSuccess); } @@ -190,11 +181,7 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3DAsync(&myparms, stream) != hipSuccess); } @@ -204,11 +191,7 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3DAsync(&myparms, stream) != hipSuccess); } @@ -218,11 +201,7 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3DAsync(&myparms, stream) != hipSuccess); } @@ -232,22 +211,13 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3DAsync(&myparms, stream) != hipSuccess); } SECTION("src pitch greater than Max allowed pitch") { -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_DEVICE; - myparms.dstMemoryType = CU_MEMORYTYPE_HOST; -#else myparms.srcMemoryType = hipMemoryTypeDevice; myparms.dstMemoryType = hipMemoryTypeHost; -#endif myparms.srcDevice = D_m; myparms.srcHost = nullptr; myparms.srcPitch = MaxPitch; @@ -264,11 +234,7 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstArray = nullptr; myparms.dstPitch = MaxPitch+1; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3DAsync(&myparms, stream) != hipSuccess); } @@ -277,11 +243,7 @@ void DrvMemcpy3DAsync::NegativeTests() { myparms.dstArray = nullptr; myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3DAsync(&myparms, stream) != hipSuccess); } @@ -308,13 +270,8 @@ void DrvMemcpy3DAsync::Extent_Validation() { // Setting default data SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeDevice; -#endif myparms.srcHost = hData; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; @@ -372,13 +329,8 @@ void DrvMemcpy3DAsync::HostDevice_DrvMemcpy3DAsync } if (!skip_test) { SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeDevice; -#endif myparms.srcHost = hData; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; @@ -390,13 +342,8 @@ void DrvMemcpy3DAsync::HostDevice_DrvMemcpy3DAsync // Device to Device SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_DEVICE; - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.srcMemoryType = hipMemoryTypeDevice; myparms.dstMemoryType = hipMemoryTypeDevice; -#endif myparms.srcDevice = hipDeviceptr_t(D_m); myparms.srcPitch = pitch_D; myparms.srcHeight = height; @@ -410,13 +357,8 @@ void DrvMemcpy3DAsync::HostDevice_DrvMemcpy3DAsync // Device to host SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_DEVICE; - myparms.dstMemoryType = CU_MEMORYTYPE_HOST; -#else myparms.srcMemoryType = hipMemoryTypeDevice; myparms.dstMemoryType = hipMemoryTypeHost; -#endif myparms.srcDevice = hipDeviceptr_t(E_m); myparms.srcPitch = pitch_E; myparms.srcHeight = height; @@ -462,13 +404,8 @@ void DrvMemcpy3DAsync::HostArray_DrvMemcpy3DAsync } if (!skip_test) { SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_ARRAY; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeArray; -#endif myparms.srcHost = hData; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; @@ -477,13 +414,8 @@ void DrvMemcpy3DAsync::HostArray_DrvMemcpy3DAsync HIP_CHECK(hipStreamSynchronize(stream)); // Array to Array SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_ARRAY; - myparms.dstMemoryType = CU_MEMORYTYPE_ARRAY; -#else myparms.srcMemoryType = hipMemoryTypeArray; myparms.dstMemoryType = hipMemoryTypeArray; -#endif myparms.srcArray = arr; myparms.dstArray = arr1; HIP_CHECK(hipDrvMemcpy3DAsync(&myparms, stream)); @@ -492,13 +424,8 @@ void DrvMemcpy3DAsync::HostArray_DrvMemcpy3DAsync memset(hOutputData, 0, size); SetDefaultData(); // Device to host -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_ARRAY; - myparms.dstMemoryType = CU_MEMORYTYPE_HOST; -#else myparms.srcMemoryType = hipMemoryTypeArray; myparms.dstMemoryType = hipMemoryTypeHost; -#endif myparms.srcArray = arr1; myparms.dstHost = hOutputData; myparms.dstPitch = width * sizeof(T); diff --git a/catch/unit/memory/hipDrvMemcpy3D_old.cc b/catch/unit/memory/hipDrvMemcpy3D_old.cc index d8d6f75187..ef580d0315 100644 --- a/catch/unit/memory/hipDrvMemcpy3D_old.cc +++ b/catch/unit/memory/hipDrvMemcpy3D_old.cc @@ -41,7 +41,7 @@ class DrvMemcpy3D { int width, height, depth; unsigned int size; hipArray_Format formatKind; - hiparray arr, arr1; + hipArray_t arr, arr1; size_t pitch_D, pitch_E; HIP_MEMCPY3D myparms; hipDeviceptr_t D_m, E_m; @@ -134,13 +134,8 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstArray = arr; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_ARRAY; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeArray; -#endif SECTION("Passing nullptr to Source Host") { myparms.srcHost = nullptr; @@ -152,11 +147,7 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstArray = nullptr; myparms.dstDevice = D_m; myparms.WidthInBytes = pitch_D; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3D(&myparms) != hipSuccess); } @@ -188,11 +179,7 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3D(&myparms) != hipSuccess); } @@ -202,11 +189,7 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3D(&myparms) != hipSuccess); } @@ -216,11 +199,7 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3D(&myparms) != hipSuccess); } @@ -230,22 +209,13 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstDevice = hipDeviceptr_t(D_m); myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3D(&myparms) != hipSuccess); } SECTION("src pitch greater than Max allowed pitch") { -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_DEVICE; - myparms.dstMemoryType = CU_MEMORYTYPE_HOST; -#else myparms.srcMemoryType = hipMemoryTypeDevice; myparms.dstMemoryType = hipMemoryTypeHost; -#endif myparms.srcDevice = D_m; myparms.srcHost = nullptr; myparms.srcPitch = MaxPitch; @@ -262,11 +232,7 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstArray = nullptr; myparms.dstPitch = MaxPitch+1; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3D(&myparms) != hipSuccess); } @@ -275,11 +241,7 @@ void DrvMemcpy3D::NegativeTests() { myparms.dstArray = nullptr; myparms.dstPitch = pitch_D; myparms.dstHeight = height; -#if HT_NVIDIA - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.dstMemoryType = hipMemoryTypeDevice; -#endif REQUIRE(hipDrvMemcpy3D(&myparms) != hipSuccess); } @@ -306,13 +268,8 @@ void DrvMemcpy3D::Extent_Validation() { // Setting default data SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeDevice; -#endif myparms.srcHost = hData; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; @@ -366,13 +323,8 @@ void DrvMemcpy3D::HostDevice_DrvMemcpy3D(bool device_context_change) { } if (!skip_test) { SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeDevice; -#endif myparms.srcHost = hData; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; @@ -383,13 +335,8 @@ void DrvMemcpy3D::HostDevice_DrvMemcpy3D(bool device_context_change) { // Device to Device SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_DEVICE; - myparms.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else myparms.srcMemoryType = hipMemoryTypeDevice; myparms.dstMemoryType = hipMemoryTypeDevice; -#endif myparms.srcDevice = hipDeviceptr_t(D_m); myparms.srcPitch = pitch_D; myparms.srcHeight = height; @@ -402,13 +349,8 @@ void DrvMemcpy3D::HostDevice_DrvMemcpy3D(bool device_context_change) { // Device to host SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_DEVICE; - myparms.dstMemoryType = CU_MEMORYTYPE_HOST; -#else myparms.srcMemoryType = hipMemoryTypeDevice; myparms.dstMemoryType = hipMemoryTypeHost; -#endif myparms.srcDevice = hipDeviceptr_t(E_m); myparms.srcPitch = pitch_E; myparms.srcHeight = height; @@ -452,13 +394,8 @@ void DrvMemcpy3D::HostArray_DrvMemcpy3D(bool device_context_change) { } if (!skip_test) { SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_HOST; - myparms.dstMemoryType = CU_MEMORYTYPE_ARRAY; -#else myparms.srcMemoryType = hipMemoryTypeHost; myparms.dstMemoryType = hipMemoryTypeArray; -#endif myparms.srcHost = hData; myparms.srcPitch = width * sizeof(T); myparms.srcHeight = height; @@ -466,13 +403,8 @@ void DrvMemcpy3D::HostArray_DrvMemcpy3D(bool device_context_change) { HIP_CHECK(hipDrvMemcpy3D(&myparms)); // Array to Array SetDefaultData(); -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_ARRAY; - myparms.dstMemoryType = CU_MEMORYTYPE_ARRAY; -#else myparms.srcMemoryType = hipMemoryTypeArray; myparms.dstMemoryType = hipMemoryTypeArray; -#endif myparms.srcArray = arr; myparms.dstArray = arr1; HIP_CHECK(hipDrvMemcpy3D(&myparms)); @@ -480,13 +412,8 @@ void DrvMemcpy3D::HostArray_DrvMemcpy3D(bool device_context_change) { memset(hOutputData, 0, size); SetDefaultData(); // Device to host -#if HT_NVIDIA - myparms.srcMemoryType = CU_MEMORYTYPE_ARRAY; - myparms.dstMemoryType = CU_MEMORYTYPE_HOST; -#else myparms.srcMemoryType = hipMemoryTypeArray; myparms.dstMemoryType = hipMemoryTypeHost; -#endif myparms.srcArray = arr1; myparms.dstHost = hOutputData; myparms.dstPitch = width * sizeof(T); diff --git a/catch/unit/memory/hipFree.cc b/catch/unit/memory/hipFree.cc index 3914e12c38..a9e0876f9d 100644 --- a/catch/unit/memory/hipFree.cc +++ b/catch/unit/memory/hipFree.cc @@ -97,7 +97,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, flo HIP_CHECK(hipStreamQuery(nullptr)); } SECTION("ArrayDestroy") { - hiparray cuArrayPtr{}; + hipArray_t cuArrayPtr{}; HIP_ARRAY_DESCRIPTOR cuDesc; cuDesc.Width = width; @@ -232,7 +232,7 @@ TEST_CASE("Unit_hipFreeDoubleArrayDestroy") { size_t height = GENERATE(0, 32, 512, 1024); DriverContext ctx{}; - hiparray ArrayPtr{}; + hipArray_t ArrayPtr{}; HIP_ARRAY_DESCRIPTOR cuDesc; cuDesc.Width = width; cuDesc.Height = height; @@ -328,7 +328,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeMultiTArray", "", char, int, float2, float4) { SECTION("ArrayDestroy") { - std::vector ptrs(numAllocs); + std::vector ptrs(numAllocs); HIP_ARRAY_DESCRIPTOR cuDesc; cuDesc.Width = width; cuDesc.Height = height; @@ -401,7 +401,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeMultiTArray", "", char, int, float2, float4) { } } SECTION("ArrayDestroy") { - std::vector cuArrayPtrs(numAllocs); + std::vector cuArrayPtrs(numAllocs); HIP_ARRAY_DESCRIPTOR cuDesc; cuDesc.Width = extent.width; diff --git a/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc b/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc index 385ddad162..810babe8b7 100644 --- a/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc +++ b/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc @@ -47,7 +47,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Basic") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; hipStream_t stream; @@ -93,7 +93,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_ExtentValidation") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}, *valData{nullptr}; hipStream_t stream; @@ -174,7 +174,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_PinnedHostMemSameGpu") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; constexpr auto def_val{10}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *PinnMem{nullptr}; @@ -228,7 +228,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_multiDevicePinnedHostMem") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *E_h{nullptr}; hipStream_t stream; @@ -290,7 +290,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_multiDeviceContextChange") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; hipStream_t stream; @@ -333,7 +333,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Negative") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; hipStream_t stream; diff --git a/catch/unit/memory/hipMemcpy2DFromArray_old.cc b/catch/unit/memory/hipMemcpy2DFromArray_old.cc index 2186073a74..b87d87223c 100644 --- a/catch/unit/memory/hipMemcpy2DFromArray_old.cc +++ b/catch/unit/memory/hipMemcpy2DFromArray_old.cc @@ -44,7 +44,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_Basic") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; // Initialization of variables @@ -78,7 +78,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_ExtentValidation") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}, *valData{nullptr}; // Initialization of variables @@ -150,7 +150,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_PinnedMemSameGPU") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; constexpr auto def_val{10}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *PinnMem{nullptr}; @@ -201,7 +201,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_multiDevicePinnedMemPeerGpu") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *E_h{nullptr}; @@ -259,7 +259,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_multiDeviceContextChange") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; @@ -299,7 +299,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_Negative") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; diff --git a/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc b/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc index 15cc200f5b..f7184b19ed 100644 --- a/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc +++ b/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc @@ -47,7 +47,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Basic") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; hipStream_t stream; @@ -91,7 +91,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_ExtentValidation") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; hipStream_t stream; @@ -170,7 +170,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_PinnedHostMemSameGpu") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; constexpr auto def_val{10}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *PinnMem{nullptr}; @@ -227,7 +227,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_multiDevicePinnedHostMem") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *E_h{nullptr}; hipStream_t stream; @@ -291,7 +291,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_multiDeviceDeviceContextChange") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; hipStream_t stream; @@ -334,7 +334,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Negative") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; hipStream_t stream; diff --git a/catch/unit/memory/hipMemcpy2DToArray_old.cc b/catch/unit/memory/hipMemcpy2DToArray_old.cc index 25ac8cb332..5fe2dc2cbc 100644 --- a/catch/unit/memory/hipMemcpy2DToArray_old.cc +++ b/catch/unit/memory/hipMemcpy2DToArray_old.cc @@ -45,7 +45,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_Basic") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; // Initialization of variables @@ -78,7 +78,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_ExtentValidation") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; // Initialization of variables @@ -150,7 +150,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_PinnedMemSameGPU") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; constexpr auto def_val{10}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *PinnMem{nullptr}; @@ -202,7 +202,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_multiDevicePinnedMemPeerGpu") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *E_h{nullptr}; @@ -261,7 +261,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_multiDeviceDeviceContextChange") { HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); if (canAccessPeer) { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; @@ -300,7 +300,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_Negative") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d{nullptr}; + hipArray_t A_d{nullptr}; size_t width{sizeof(float)*NUM_W}; float *A_h{nullptr}, *hData{nullptr}; diff --git a/catch/unit/memory/hipMemcpy3DAsync_old.cc b/catch/unit/memory/hipMemcpy3DAsync_old.cc index cccbc3fc3f..154fdb643e 100644 --- a/catch/unit/memory/hipMemcpy3DAsync_old.cc +++ b/catch/unit/memory/hipMemcpy3DAsync_old.cc @@ -39,7 +39,7 @@ template class Memcpy3DAsync { int width, height, depth; unsigned int size; - hipArray *arr, *arr1; + hipArray_t arr, arr1; hipChannelFormatKind formatKind; hipMemcpy3DParms myparms; T* hData; @@ -229,7 +229,7 @@ void Memcpy3DAsync::D2D_DeviceMem_OnDiffDevice() { // Allocating Mem on GPU device 0 and trigger hipMemcpy3DAsync from GPU 1 HIP_CHECK(hipSetDevice(1)); HIP_CHECK(hipStreamCreate(&stream)); - hipArray *arr2; + hipArray_t arr2; hipChannelFormatDesc channelDesc1 = hipCreateChannelDesc(sizeof(T)*8, 0, 0, 0, formatKind); HIP_CHECK(hipMalloc3DArray(&arr2, &channelDesc1, @@ -439,7 +439,7 @@ void Memcpy3DAsync::NegativeTests() { } SECTION("Passing src array size > dst array size") { - hipArray *arr2; + hipArray_t arr2; hipChannelFormatDesc channelDesc1 = hipCreateChannelDesc(sizeof(T)*8, 0, 0, 0, formatKind); HIP_CHECK(hipMalloc3DArray(&arr2, &channelDesc1, diff --git a/catch/unit/memory/hipMemcpy3D_old.cc b/catch/unit/memory/hipMemcpy3D_old.cc index 2a640a774f..f26cd3a2a6 100644 --- a/catch/unit/memory/hipMemcpy3D_old.cc +++ b/catch/unit/memory/hipMemcpy3D_old.cc @@ -40,7 +40,7 @@ template class Memcpy3D { int width, height, depth; unsigned int size; - hipArray *arr, *arr1; + hipArray_t arr, arr1; hipChannelFormatKind formatKind; hipMemcpy3DParms myparms; T* hData; @@ -212,7 +212,7 @@ void Memcpy3D::D2D_DeviceMem_OnDiffDevice() { myparms.kind = hipMemcpyHostToDevice; #endif REQUIRE(hipMemcpy3D(&myparms) == hipSuccess); - hipArray *arr2; + hipArray_t arr2; hipChannelFormatDesc channelDesc1 = hipCreateChannelDesc(sizeof(T)*8, 0, 0, 0, formatKind); HIP_CHECK(hipMalloc3DArray(&arr2, &channelDesc1, @@ -422,7 +422,7 @@ void Memcpy3D::NegativeTests() { SECTION("Passing src array size > dst array size") { // Passing src array size greater than destination array size - hipArray *arr2; + hipArray_t arr2; hipChannelFormatDesc channelDesc1 = hipCreateChannelDesc(sizeof(T)*8, 0, 0, 0, formatKind); HIP_CHECK(hipMalloc3DArray(&arr2, &channelDesc1, diff --git a/catch/unit/memory/hipMemcpyAtoH_old.cc b/catch/unit/memory/hipMemcpyAtoH_old.cc index e2319ce567..fef5b37691 100644 --- a/catch/unit/memory/hipMemcpyAtoH_old.cc +++ b/catch/unit/memory/hipMemcpyAtoH_old.cc @@ -49,7 +49,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAtoH_Basic", "[hipMemcpyAtoH]", char, int, flo HIP_CHECK(hipSetDevice(0)); // 1 refers to pinned host memory scenario auto memtype_check = GENERATE(0, 1); - hipArray *A_d; + hipArray_t A_d; TestType *hData{nullptr}, *B_h{nullptr}; size_t width{NUM_W * sizeof(TestType)}; @@ -107,7 +107,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAtoH_multiDevice-PeerDeviceContext", "[hipMemc SUCCEED("Skipped the test as there is no peer access"); } else { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d; + hipArray_t A_d; TestType *hData{nullptr}, *B_h{nullptr}; size_t width{NUM_W * sizeof(TestType)}; @@ -148,7 +148,7 @@ TEST_CASE("Unit_hipMemcpyAtoH_Negative") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d; + hipArray_t A_d; float *hData{nullptr}, *B_h{nullptr}; size_t width{NUM_W * sizeof(float)}; @@ -191,7 +191,7 @@ TEST_CASE("Unit_hipMemcpyAtoH_SizeCheck") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d; + hipArray_t A_d; float *hData{nullptr}, *B_h{nullptr}, *def_data{nullptr}; size_t width{NUM_W * sizeof(float)}; diff --git a/catch/unit/memory/hipMemcpyHtoA_old.cc b/catch/unit/memory/hipMemcpyHtoA_old.cc index 5c87a4fb46..a25c55500f 100644 --- a/catch/unit/memory/hipMemcpyHtoA_old.cc +++ b/catch/unit/memory/hipMemcpyHtoA_old.cc @@ -48,7 +48,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyHtoA_Basic", "[hipMemcpyHtoA]", char, int, flo HIP_CHECK(hipSetDevice(0)); auto memtype_check = GENERATE(0, 1); - hipArray *A_d; + hipArray_t A_d; TestType *hData{nullptr}, *B_h{nullptr}; size_t width{NUM_W * sizeof(TestType)}; @@ -108,7 +108,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyHtoA_multiDevice-PeerDeviceContext", "[hipMemc SUCCEED("Skipped the test as there is no peer access"); } else { HIP_CHECK(hipSetDevice(0)); - hipArray *A_d; + hipArray_t A_d; TestType *hData{nullptr}, *B_h{nullptr}; size_t width{NUM_W * sizeof(TestType)}; @@ -153,7 +153,7 @@ TEST_CASE("Unit_hipMemcpyHtoA_Negative") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d; + hipArray_t A_d; float *hData{nullptr}, *B_h{nullptr}; size_t width{NUM_W * sizeof(float)}; @@ -196,7 +196,7 @@ TEST_CASE("Unit_hipMemcpyHtoA_SizeCheck") { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); - hipArray *A_d; + hipArray_t A_d; float *hData{nullptr}, *B_h{nullptr}, *def_data{nullptr}; size_t width{NUM_W * sizeof(float)}; diff --git a/catch/unit/memory/hipMemcpyParam2D.cc b/catch/unit/memory/hipMemcpyParam2D.cc index 06d1654f93..3a35a1a16e 100644 --- a/catch/unit/memory/hipMemcpyParam2D.cc +++ b/catch/unit/memory/hipMemcpyParam2D.cc @@ -75,19 +75,11 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2D_multiDevice-D2D", "[hipMemcpyParam2D]" // Device to Device hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.dstMemoryType = hipMemoryTypeDevice; -#endif desc.dstHost = E_d; desc.dstDevice = hipDeviceptr_t(E_d); desc.dstPitch = pitch_E; @@ -164,19 +156,11 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2D_multiDevice-H2D-D2H", "[hipMemcpyParam } else { // Host to Device hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_HOST; -#else desc.srcMemoryType = hipMemoryTypeHost; -#endif desc.srcHost = C_h; desc.srcDevice = hipDeviceptr_t(C_h); desc.srcPitch = width; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.dstMemoryType = hipMemoryTypeDevice; -#endif desc.dstHost = A_d; desc.dstDevice = hipDeviceptr_t(A_d); desc.dstPitch = pitch_A; @@ -186,19 +170,11 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2D_multiDevice-H2D-D2H", "[hipMemcpyParam // Device to Host memset(&desc, 0x0, sizeof(hip_Memcpy2D)); -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_HOST; -#else desc.dstMemoryType = hipMemoryTypeHost; -#endif desc.dstHost = A_h; desc.dstDevice = hipDeviceptr_t(A_h); desc.dstPitch = width; @@ -250,19 +226,11 @@ TEST_CASE("Unit_hipMemcpyParam2D_ExtentValidation") { // Device to Host hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_HOST; -#else desc.dstMemoryType = hipMemoryTypeHost; -#endif desc.dstHost = A_h; desc.dstDevice = hipDeviceptr_t(A_h); desc.dstPitch = width; @@ -320,19 +288,11 @@ TEST_CASE("Unit_hipMemcpyParam2D_Negative") { HIP_CHECK(hipMemset2D(A_d, pitch_A, memsetval, NUM_W, NUM_H)); hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_HOST; -#else desc.dstMemoryType = hipMemoryTypeHost; -#endif desc.dstHost = A_h; desc.dstDevice = hipDeviceptr_t(A_h); desc.dstPitch = width; @@ -346,19 +306,11 @@ TEST_CASE("Unit_hipMemcpyParam2D_Negative") { SECTION("Null Pointer to Destination Device Pointer") { memset(&desc, 0x0, sizeof(hip_Memcpy2D)); -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_HOST; -#else desc.srcMemoryType = hipMemoryTypeHost; -#endif desc.srcHost = A_h; desc.srcDevice = hipDeviceptr_t(A_h); desc.srcPitch = width; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.dstMemoryType = hipMemoryTypeDevice; -#endif desc.dstHost = A_d; desc.dstDevice = hipDeviceptr_t(nullptr); desc.dstPitch = pitch_A; diff --git a/catch/unit/memory/hipMemcpyParam2DAsync.cc b/catch/unit/memory/hipMemcpyParam2DAsync.cc index 1ad5767620..763ef9185d 100644 --- a/catch/unit/memory/hipMemcpyParam2DAsync.cc +++ b/catch/unit/memory/hipMemcpyParam2DAsync.cc @@ -82,19 +82,11 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-StreamOnDiffDevice", HIP_CHECK(hipStreamSynchronize(stream)); // Device to Device hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.dstMemoryType = hipMemoryTypeDevice; -#endif desc.dstHost = E_d; desc.dstDevice = hipDeviceptr_t(E_d); desc.dstPitch = pitch_E; @@ -170,19 +162,11 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-D2D", "[hipMemcpyPara // Device to Device hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.dstMemoryType = hipMemoryTypeDevice; -#endif desc.dstHost = E_d; desc.dstDevice = hipDeviceptr_t(E_d); desc.dstPitch = pitch_E; @@ -261,19 +245,11 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-H2D-D2H", "[hipMemcpy // Host to Device hip_Memcpy2D desc = {}; HIP_CHECK(hipStreamCreate(&stream)); -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_HOST; -#else desc.srcMemoryType = hipMemoryTypeHost; -#endif desc.srcHost = C_h; desc.srcDevice = hipDeviceptr_t(C_h); desc.srcPitch = width; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.dstMemoryType = hipMemoryTypeDevice; -#endif desc.dstHost = A_d; desc.dstDevice = hipDeviceptr_t(A_d); desc.dstPitch = pitch_A; @@ -284,19 +260,11 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-H2D-D2H", "[hipMemcpy // Device to Host memset(&desc, 0x0, sizeof(hip_Memcpy2D)); -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_HOST; -#else desc.dstMemoryType = hipMemoryTypeHost; -#endif desc.dstHost = A_h; desc.dstDevice = hipDeviceptr_t(A_h); desc.dstPitch = width; @@ -353,19 +321,11 @@ TEST_CASE("Unit_hipMemcpyParam2DAsync_ExtentValidation") { // Device to Host hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_HOST; -#else desc.dstMemoryType = hipMemoryTypeHost; -#endif desc.dstHost = A_h; desc.dstDevice = hipDeviceptr_t(A_h); desc.dstPitch = width; @@ -429,19 +389,11 @@ TEST_CASE("Unit_hipMemcpyParam2DAsync_Negative") { // Device to Host hip_Memcpy2D desc = {}; -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.srcMemoryType = hipMemoryTypeDevice; -#endif desc.srcHost = A_d; desc.srcDevice = hipDeviceptr_t(A_d); desc.srcPitch = pitch_A; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_HOST; -#else desc.dstMemoryType = hipMemoryTypeHost; -#endif desc.dstHost = A_h; desc.dstDevice = hipDeviceptr_t(A_h); desc.dstPitch = width; @@ -455,19 +407,11 @@ TEST_CASE("Unit_hipMemcpyParam2DAsync_Negative") { SECTION("Null Pointer to Destination Device Pointer") { memset(&desc, 0x0, sizeof(hip_Memcpy2D)); -#ifdef __HIP_PLATFORM_NVCC__ - desc.srcMemoryType = CU_MEMORYTYPE_HOST; -#else desc.srcMemoryType = hipMemoryTypeHost; -#endif desc.srcHost = A_h; desc.srcDevice = hipDeviceptr_t(A_h); desc.srcPitch = width; -#ifdef __HIP_PLATFORM_NVCC__ - desc.dstMemoryType = CU_MEMORYTYPE_DEVICE; -#else desc.dstMemoryType = hipMemoryTypeDevice; -#endif desc.dstHost = A_d; desc.dstDevice = hipDeviceptr_t(nullptr); desc.dstPitch = pitch_A; diff --git a/catch/unit/memory/hipPointerGetAttribute.cc b/catch/unit/memory/hipPointerGetAttribute.cc index 63de44ef8e..79bce060e5 100644 --- a/catch/unit/memory/hipPointerGetAttribute.cc +++ b/catch/unit/memory/hipPointerGetAttribute.cc @@ -80,7 +80,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_MemoryTypes") { } #if HT_AMD SECTION("Malloc Array Allocation") { - hipArray *B_d; + hipArray_t B_d; hipChannelFormatDesc desc = hipCreateChannelDesc(); HIP_CHECK(hipMallocArray(&B_d, &desc, NUM_W, NUM_H, hipArrayDefault)); HIP_CHECK(hipPointerGetAttribute(&datatype, @@ -96,7 +96,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_MemoryTypes") { SECTION("Malloc 3D Array Allocation") { int width = 10, height = 10, depth = 10; - hipArray *arr; + hipArray_t arr; hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(float)*8, 0, 0, 0, hipChannelFormatKindFloat); diff --git a/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc b/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc index ed7604363c..9590d6943f 100644 --- a/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc +++ b/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc @@ -580,7 +580,7 @@ void DefaultPT2_hipMemcpy2D(int Async) { void DefaultPT2_hipMemcpy2DToArray() { - hipArray *Dptr = nullptr; + hipArray_t Dptr = nullptr; float *Hptr = nullptr, *HRes = nullptr; DefltStrmPT::numH = 1024; DefltStrmPT::numW = 1024; @@ -611,7 +611,7 @@ void DefaultPT2_hipMemcpy2DToArray() { float DefaultPT2_hipMemcpy2DFromArray() { - hipArray *Dptr = nullptr; + hipArray_t Dptr = nullptr; float *Hptr_A = nullptr, *Hptr_B = nullptr; DefltStrmPT::numH = 1024; DefltStrmPT::numW = 1024; @@ -661,7 +661,7 @@ void DefaultPT2_hipMemcpy3D() { } hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(float)*8, 0, 0, 0, hipChannelFormatKindFloat); - hipArray *arr; + hipArray_t arr; HIP_CHECK(hipMalloc3DArray(&arr, &channelDesc, make_hipExtent(width, height, depth), hipArrayDefault)); diff --git a/catch/unit/surface/hipSurfaceObj1D.cc b/catch/unit/surface/hipSurfaceObj1D.cc index c3a3536ec5..701a99666d 100644 --- a/catch/unit/surface/hipSurfaceObj1D.cc +++ b/catch/unit/surface/hipSurfaceObj1D.cc @@ -77,7 +77,7 @@ static void runTestR(const int width) hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr; + hipArray_t hipArray = nullptr; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, 0, hipArraySurfaceLoadStore)); HIP_CHECK(hipMemcpyToArray(hipArray, 0, 0, hData, size, hipMemcpyHostToDevice)); @@ -128,7 +128,7 @@ static void runTestW(const int width) hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr; + hipArray_t hipArray = nullptr; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, 0, hipArraySurfaceLoadStore)); HIP_CHECK(hipMemcpyToArray(hipArray, 0, 0, hData, size, hipMemcpyHostToDevice)); @@ -188,7 +188,7 @@ static void runTestRW(const int width) hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr, *hipOutArray = nullptr; + hipArray_t hipArray = nullptr, hipOutArray = nullptr; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, 0, hipArraySurfaceLoadStore)); HIP_CHECK(hipMemcpyToArray(hipArray, 0, 0, hData, size, hipMemcpyHostToDevice)); diff --git a/catch/unit/surface/hipSurfaceObj2D.cc b/catch/unit/surface/hipSurfaceObj2D.cc index 2adbe041a7..1fdc0eee9e 100644 --- a/catch/unit/surface/hipSurfaceObj2D.cc +++ b/catch/unit/surface/hipSurfaceObj2D.cc @@ -84,7 +84,7 @@ static void runTestR(const int width, const int height) } hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr; + hipArray_t hipArray = nullptr; HIP_CHECK(hipMallocArray (&hipArray, &channelDesc, width, height, hipArraySurfaceLoadStore)); @@ -139,7 +139,7 @@ static void runTestW(const int width, const int height) memset(hData, 0, size); hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr; + hipArray_t hipArray = nullptr; HIP_CHECK(hipMallocArray (&hipArray, &channelDesc, width, height, hipArraySurfaceLoadStore)); @@ -218,7 +218,7 @@ static void runTestRW(const int width, const int height) #endif hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr, *hipOutArray = nullptr; + hipArray_t hipArray = nullptr, hipOutArray = nullptr; HIP_CHECK(hipMallocArray (&hipArray, &channelDesc, width, height, hipArraySurfaceLoadStore)); diff --git a/catch/unit/surface/hipSurfaceObj3D.cc b/catch/unit/surface/hipSurfaceObj3D.cc index 1c2e6c0963..7cc3889e6f 100644 --- a/catch/unit/surface/hipSurfaceObj3D.cc +++ b/catch/unit/surface/hipSurfaceObj3D.cc @@ -88,7 +88,7 @@ static void runTestR(const int width, const int height, const int depth) // Allocate array and copy image data hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr; + hipArray_t hipArray = nullptr; HIP_CHECK(hipMalloc3DArray(&hipArray, &channelDesc, make_hipExtent(width, height, depth), hipArraySurfaceLoadStore)); @@ -155,7 +155,7 @@ static void runTestW(const int width, const int height, const int depth) // Allocate array and copy image data hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr; + hipArray_t hipArray = nullptr; HIP_CHECK(hipMalloc3DArray(&hipArray, &channelDesc, make_hipExtent(width, height, depth), hipArraySurfaceLoadStore)); @@ -245,7 +245,7 @@ static void runTestRW(const int width, const int height, const int depth) // Allocate array and copy image data hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray = nullptr, *hipOutArray = nullptr; + hipArray_t hipArray = nullptr, hipOutArray = nullptr; HIP_CHECK(hipMalloc3DArray(&hipArray, &channelDesc, make_hipExtent(width, height, depth), hipArraySurfaceLoadStore)); diff --git a/catch/unit/texture/hipBindTextureToMipmappedArray.cc b/catch/unit/texture/hipBindTextureToMipmappedArray.cc index 9eafef9190..40f5370c38 100644 --- a/catch/unit/texture/hipBindTextureToMipmappedArray.cc +++ b/catch/unit/texture/hipBindTextureToMipmappedArray.cc @@ -19,6 +19,7 @@ THE SOFTWARE. #pragma clang diagnostic ignored "-Wunused-parameter" #include +#include /** * @addtogroup hipBindTextureToMipmappedArray hipBindTextureToMipmappedArray @@ -28,7 +29,7 @@ THE SOFTWARE. * hipMipmappedArray_const_t mipmappedArray, const hipChannelFormatDesc* desc)` - * Binds a mipmapped array to a texture. */ - +#if CUDA_VERSION < CUDA_12000 texture texRef; // MipMap is currently supported only on windows @@ -67,7 +68,7 @@ static void runMipMapTest(unsigned int width, unsigned int height, unsigned int make_hipExtent(orig_width, orig_height, 0), 2 * mipmap_level, hipArrayDefault)); - hipArray* hipArray = nullptr; + hipArray_t hipArray = nullptr; HIP_CHECK(hipGetMipmappedArrayLevel(&hipArray, mip_array_ptr, mipmap_level)); HIP_CHECK(hipMemcpy2DToArray(hipArray, 0, 0, hData, width * sizeof(float), width * sizeof(float), height, hipMemcpyHostToDevice)); @@ -207,3 +208,5 @@ TEST_CASE("Unit_hipTextureMipmapRef2D_Negative_Parameters") { SUCCEED("Mipmaps are Supported only on windows, skipping the test."); #endif } + +#endif diff --git a/catch/unit/texture/hipGetChanDesc.cc b/catch/unit/texture/hipGetChanDesc.cc index 2f781254a7..5d40bd8466 100644 --- a/catch/unit/texture/hipGetChanDesc.cc +++ b/catch/unit/texture/hipGetChanDesc.cc @@ -47,7 +47,7 @@ TEST_CASE("Unit_hipGetChannelDesc_CreateAndGet") { CHECK_IMAGE_SUPPORT; hipChannelFormatDesc chan_test, chan_desc; - hipArray* hip_array; + hipArray_t hip_array; chan_desc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindSigned); HIP_CHECK(hipMallocArray(&hip_array, &chan_desc, C, R, 0)); @@ -80,7 +80,7 @@ TEST_CASE("Unit_hipGetChannelDesc_Negative_Parameters") { CHECK_IMAGE_SUPPORT; hipChannelFormatDesc chan_test, chan_desc; - hipArray* hip_array; + hipArray_t hip_array; chan_desc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindSigned); HIP_CHECK(hipMallocArray(&hip_array, &chan_desc, C, R, 0)); diff --git a/catch/unit/texture/hipSimpleTexture2DLayered.cc b/catch/unit/texture/hipSimpleTexture2DLayered.cc index 3473aa6d95..c80a77787f 100644 --- a/catch/unit/texture/hipSimpleTexture2DLayered.cc +++ b/catch/unit/texture/hipSimpleTexture2DLayered.cc @@ -60,7 +60,7 @@ TEST_CASE("Unit_hipSimpleTexture2DLayered_Check") { // Allocate array and copy image data channelDesc = hipCreateChannelDesc(sizeof(T)*8, 0, 0, 0, hipChannelFormatKindFloat); - hipArray *arr; + hipArray_t arr; HIP_CHECK(hipMalloc3DArray(&arr, &channelDesc, make_hipExtent(width, height, num_layers), hipArrayLayered)); diff --git a/catch/unit/texture/hipSimpleTexture3D.cc b/catch/unit/texture/hipSimpleTexture3D.cc index 1b5940d6c9..4c397aec9f 100644 --- a/catch/unit/texture/hipSimpleTexture3D.cc +++ b/catch/unit/texture/hipSimpleTexture3D.cc @@ -65,7 +65,7 @@ static void runSimpleTexture3D_Check(int width, int height, int depth, // Allocate array and copy image data hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *arr; + hipArray_t arr; HIP_CHECK(hipMalloc3DArray(&arr, &channelDesc, make_hipExtent(width, height, depth), hipArrayDefault)); diff --git a/catch/unit/texture/hipTexObjectTests.cc b/catch/unit/texture/hipTexObjectTests.cc index f7285f93f8..fad0ef89c4 100644 --- a/catch/unit/texture/hipTexObjectTests.cc +++ b/catch/unit/texture/hipTexObjectTests.cc @@ -31,7 +31,7 @@ class TexObjectTestWrapper { HIP_TEXTURE_DESC tex_desc; HIP_RESOURCE_VIEW_DESC res_view_desc; HIP_ARRAY_DESCRIPTOR array_desc; - hiparray array_member; + hipArray_t array_member; size_t size; /* size in bytes*/ int width; /* width in elements */ @@ -54,7 +54,7 @@ class TexObjectTestWrapper { array_desc.Height = 0; HIP_CHECK(hipArrayCreate(&array_member, &array_desc)); - HIP_CHECK(hipMemcpyHtoA(reinterpret_cast(array_member), 0, host_data_, size)); + HIP_CHECK(hipMemcpyHtoA(reinterpret_cast(array_member), 0, host_data_, size)); memset(&res_desc, 0, sizeof(res_desc)); res_desc.resType = HIP_RESOURCE_TYPE_ARRAY; diff --git a/catch/unit/texture/hipTextureObj1DCheckModes.cc b/catch/unit/texture/hipTextureObj1DCheckModes.cc index 43e0405bc1..836f992c4e 100644 --- a/catch/unit/texture/hipTextureObj1DCheckModes.cc +++ b/catch/unit/texture/hipTextureObj1DCheckModes.cc @@ -50,7 +50,7 @@ static void runTest(const int width, const float offsetX) { hipChannelFormatDesc channelDesc = hipCreateChannelDesc( 32, 0, 0, 0, hipChannelFormatKindFloat); - hipArray *hipArray; + hipArray_t hipArray; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width)); HIP_CHECK(hipMemcpy2DToArray(hipArray, 0, 0, hData, width * sizeof(float), width * sizeof(float), 1, hipMemcpyHostToDevice)); diff --git a/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc b/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc index 499f51fd2f..9b5ffa560f 100644 --- a/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc +++ b/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc @@ -55,7 +55,7 @@ static void runTest(const int width, const float offsetX = 0) { hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); uchar4 *hipBuff = nullptr; - hipArray *hipArray = nullptr; + hipArray_t hipArray = nullptr; hipResourceDesc resDesc; memset(&resDesc, 0, sizeof(resDesc)); diff --git a/catch/unit/texture/hipTextureObj2D.cc b/catch/unit/texture/hipTextureObj2D.cc index 7592b87a22..387f10ed5d 100644 --- a/catch/unit/texture/hipTextureObj2D.cc +++ b/catch/unit/texture/hipTextureObj2D.cc @@ -75,7 +75,7 @@ TEST_CASE("Unit_hipTextureObj2D_Check") { hipChannelFormatDesc channelDesc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindFloat); - hipArray* hipArray; + hipArray_t hipArray; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, height)); HIP_CHECK(hipMemcpyToArray(hipArray, 0, 0, hData, size, hipMemcpyHostToDevice)); diff --git a/catch/unit/texture/hipTextureObj2DCheckModes.cc b/catch/unit/texture/hipTextureObj2DCheckModes.cc index 47f90ca04a..6047efe813 100644 --- a/catch/unit/texture/hipTextureObj2DCheckModes.cc +++ b/catch/unit/texture/hipTextureObj2DCheckModes.cc @@ -57,7 +57,7 @@ static void runTest(const int width, const int height, const float offsetX, cons hipChannelFormatDesc channelDesc = hipCreateChannelDesc( 32, 0, 0, 0, hipChannelFormatKindFloat); - hipArray *hipArray; + hipArray_t hipArray; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, height)); HIP_CHECK(hipMemcpy2DToArray(hipArray, 0, 0, hData, width * sizeof(float), width * sizeof(float), height, hipMemcpyHostToDevice)); diff --git a/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc b/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc index a641c4c057..5c16490177 100644 --- a/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc +++ b/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc @@ -54,7 +54,7 @@ static void runTest(const int width, const int height, const float offsetX, cons } hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray *hipArray; + hipArray_t hipArray; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, height)); HIP_CHECK(hipMemcpy2DToArray(hipArray, 0, 0, hData, width * sizeof(uchar4), width * sizeof(uchar4), height, hipMemcpyHostToDevice)); diff --git a/catch/unit/texture/hipTextureObj3DCheckModes.cc b/catch/unit/texture/hipTextureObj3DCheckModes.cc index 2d50317b58..5e0b53062b 100644 --- a/catch/unit/texture/hipTextureObj3DCheckModes.cc +++ b/catch/unit/texture/hipTextureObj3DCheckModes.cc @@ -68,7 +68,7 @@ static void runTest(const int width, const int height, const int depth, const fl // Allocate array and copy image data hipChannelFormatDesc channelDesc = hipCreateChannelDesc(); - hipArray* arr; + hipArray_t arr; HIP_CHECK( hipMalloc3DArray(&arr, &channelDesc, make_hipExtent(width, height, depth), hipArrayDefault)); diff --git a/catch/unit/texture/hipTextureObjectTests.cc b/catch/unit/texture/hipTextureObjectTests.cc index 1fefec4d14..944fc4f56b 100644 --- a/catch/unit/texture/hipTextureObjectTests.cc +++ b/catch/unit/texture/hipTextureObjectTests.cc @@ -31,7 +31,7 @@ class TextureObjectTestWrapper { hipTextureDesc tex_desc; hipChannelFormatDesc channel_desc; hipResourceViewDesc res_vew_desc; - hipArray* array_member; + hipArray_t array_member; size_t size; /* size in bytes*/ int width; /* width in elements */ diff --git a/catch/unit/texture/hipTextureRef2D.cc b/catch/unit/texture/hipTextureRef2D.cc index fec47f0a73..434a86a71f 100644 --- a/catch/unit/texture/hipTextureRef2D.cc +++ b/catch/unit/texture/hipTextureRef2D.cc @@ -53,7 +53,7 @@ TEST_CASE("Unit_hipTextureRef2D_Check") { hipChannelFormatDesc channelDesc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindFloat); - hipArray* hipArray; + hipArray_t hipArray; HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, height)); HIP_CHECK(hipMemcpyToArray(hipArray, 0, 0, hData, size, hipMemcpyHostToDevice));