SWDEV-332969 - [ABI Break]remove hiparray from tests
- replace with hipArray_t Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Change-Id: Ie1dade58d868182309caf00bf65a86a8fed2cfa6
This commit is contained in:
committed by
Shadi Dashmiz
vanhempi
cc35feba07
commit
e161374c31
@@ -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() {
|
||||
|
||||
@@ -618,7 +618,7 @@ constexpr auto MemTypeUnified() {
|
||||
#endif
|
||||
}
|
||||
|
||||
using DrvPtrVariant = std::variant<hipPitchedPtr, hiparray>;
|
||||
using DrvPtrVariant = std::variant<hipPitchedPtr, hipArray_t>;
|
||||
|
||||
template <bool async = false>
|
||||
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<hiparray>(dst_ptr)) {
|
||||
parms.dstMemoryType = MemTypeArray();
|
||||
parms.dstArray = std::get<hiparray>(dst_ptr);
|
||||
if (std::holds_alternative<hipArray_t>(dst_ptr)) {
|
||||
parms.dstMemoryType = hipMemoryTypeArray;
|
||||
parms.dstArray = std::get<hipArray_t>(dst_ptr);
|
||||
} else {
|
||||
auto ptr = std::get<hipPitchedPtr>(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<hipDeviceptr_t>(ptr.ptr);
|
||||
break;
|
||||
case hipMemcpyDefault:
|
||||
parms.dstMemoryType = MemTypeUnified();
|
||||
parms.dstMemoryType = hipMemoryTypeUnified;
|
||||
parms.dstDevice = reinterpret_cast<hipDeviceptr_t>(ptr.ptr);
|
||||
break;
|
||||
default:
|
||||
@@ -652,25 +652,25 @@ hipError_t DrvMemcpy3DWrapper(DrvPtrVariant dst_ptr, hipPos dst_pos, DrvPtrVaria
|
||||
}
|
||||
}
|
||||
|
||||
if (std::holds_alternative<hiparray>(src_ptr)) {
|
||||
parms.srcMemoryType = MemTypeArray();
|
||||
parms.srcArray = std::get<hiparray>(src_ptr);
|
||||
if (std::holds_alternative<hipArray_t>(src_ptr)) {
|
||||
parms.srcMemoryType = hipMemoryTypeArray;
|
||||
parms.srcArray = std::get<hipArray_t>(src_ptr);
|
||||
} else {
|
||||
auto ptr = std::get<hipPitchedPtr>(src_ptr);
|
||||
parms.srcPitch = ptr.pitch;
|
||||
switch (kind) {
|
||||
case hipMemcpyDeviceToHost:
|
||||
case hipMemcpyDeviceToDevice:
|
||||
parms.srcMemoryType = MemTypeDevice();
|
||||
parms.srcMemoryType = hipMemoryTypeDevice;
|
||||
parms.srcDevice = reinterpret_cast<hipDeviceptr_t>(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<hipDeviceptr_t>(ptr.ptr);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -187,12 +187,12 @@ template <typename T> 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_;
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<hipArray*>(data);
|
||||
hipArray_t arrayPtr = static_cast<hipArray_t>(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<hipArray*>(data);
|
||||
hipArray_t arrayPtr = static_cast<hipArray_t>(data);
|
||||
REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed);
|
||||
REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed);
|
||||
free(data);
|
||||
|
||||
@@ -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<TestType>;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <typename T>
|
||||
void copyToArray(hiparray dst, const std::vector<T>& src, const size_t height) {
|
||||
void copyToArray(hipArray_t dst, const std::vector<T>& 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<hipArray*>(dst), 0, src.data(), sizeInBytes));
|
||||
HIP_CHECK(hipMemcpyHtoA(reinterpret_cast<hipArray_t>(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<T>& 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 <typename T>
|
||||
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<T>;
|
||||
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);
|
||||
|
||||
@@ -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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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);
|
||||
|
||||
@@ -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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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<T>::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);
|
||||
|
||||
@@ -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<hiparray> ptrs(numAllocs);
|
||||
std::vector<hipArray_t> 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<hiparray> cuArrayPtrs(numAllocs);
|
||||
std::vector<hipArray_t> cuArrayPtrs(numAllocs);
|
||||
|
||||
HIP_ARRAY_DESCRIPTOR cuDesc;
|
||||
cuDesc.Width = extent.width;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ template <typename T>
|
||||
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<T>::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<T>::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,
|
||||
|
||||
@@ -40,7 +40,7 @@ template <typename T>
|
||||
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<T>::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<T>::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,
|
||||
|
||||
@@ -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)};
|
||||
|
||||
|
||||
@@ -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)};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<char>();
|
||||
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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -77,7 +77,7 @@ static void runTestR(const int width)
|
||||
|
||||
hipChannelFormatDesc channelDesc = hipCreateChannelDesc<T>();
|
||||
|
||||
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<T>();
|
||||
|
||||
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<T>();
|
||||
|
||||
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));
|
||||
|
||||
@@ -84,7 +84,7 @@ static void runTestR(const int width, const int height)
|
||||
}
|
||||
|
||||
hipChannelFormatDesc channelDesc = hipCreateChannelDesc<T>();
|
||||
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<T>();
|
||||
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<T>();
|
||||
hipArray *hipArray = nullptr, *hipOutArray = nullptr;
|
||||
hipArray_t hipArray = nullptr, hipOutArray = nullptr;
|
||||
HIP_CHECK(hipMallocArray (&hipArray, &channelDesc, width, height,
|
||||
hipArraySurfaceLoadStore));
|
||||
|
||||
|
||||
@@ -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<T>();
|
||||
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<T>();
|
||||
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<T>();
|
||||
hipArray *hipArray = nullptr, *hipOutArray = nullptr;
|
||||
hipArray_t hipArray = nullptr, hipOutArray = nullptr;
|
||||
HIP_CHECK(hipMalloc3DArray(&hipArray, &channelDesc, make_hipExtent(width, height, depth),
|
||||
hipArraySurfaceLoadStore));
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ THE SOFTWARE.
|
||||
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#include <hip_test_common.hh>
|
||||
#include <hip_test_checkers.hh>
|
||||
|
||||
/**
|
||||
* @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<float, 2, hipReadModeElementType> 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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -65,7 +65,7 @@ static void runSimpleTexture3D_Check(int width, int height, int depth,
|
||||
|
||||
// Allocate array and copy image data
|
||||
hipChannelFormatDesc channelDesc = hipCreateChannelDesc<T>();
|
||||
hipArray *arr;
|
||||
hipArray_t arr;
|
||||
|
||||
HIP_CHECK(hipMalloc3DArray(&arr, &channelDesc,
|
||||
make_hipExtent(width, height, depth), hipArrayDefault));
|
||||
|
||||
@@ -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<hipArray*>(array_member), 0, host_data_, size));
|
||||
HIP_CHECK(hipMemcpyHtoA(reinterpret_cast<hipArray_t>(array_member), 0, host_data_, size));
|
||||
|
||||
memset(&res_desc, 0, sizeof(res_desc));
|
||||
res_desc.resType = HIP_RESOURCE_TYPE_ARRAY;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -55,7 +55,7 @@ static void runTest(const int width, const float offsetX = 0) {
|
||||
|
||||
hipChannelFormatDesc channelDesc = hipCreateChannelDesc<uchar4>();
|
||||
uchar4 *hipBuff = nullptr;
|
||||
hipArray *hipArray = nullptr;
|
||||
hipArray_t hipArray = nullptr;
|
||||
hipResourceDesc resDesc;
|
||||
memset(&resDesc, 0, sizeof(resDesc));
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -54,7 +54,7 @@ static void runTest(const int width, const int height, const float offsetX, cons
|
||||
}
|
||||
|
||||
hipChannelFormatDesc channelDesc = hipCreateChannelDesc<uchar4>();
|
||||
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));
|
||||
|
||||
@@ -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<float>();
|
||||
hipArray* arr;
|
||||
hipArray_t arr;
|
||||
|
||||
HIP_CHECK(
|
||||
hipMalloc3DArray(&arr, &channelDesc, make_hipExtent(width, height, depth), hipArrayDefault));
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user