SWDEV-441603 - Add hipDrvMemcpy2DUnaligned test

Change-Id: I44b65867cabeb369fda8a82984fe3f694499942c
이 커밋은 다음에 포함됨:
Marko Arandjelovic가 2024-08-01 17:44:26 -04:00를 커밋했습니다
1 부모 5d042c80fa
커밋 639a9c2996
3 파일이 변경됨
+190 -83

검색과 일치하는 파일 없음

+9 -3
파일 보기
@@ -165,12 +165,18 @@ template <typename T> class LinearAllocGuardMultiDim {
const hipExtent extent_;
};
template <typename T> class LinearAllocGuard2D : public LinearAllocGuardMultiDim<T> {
template <typename T, bool unaligned = false>
class LinearAllocGuard2D : public LinearAllocGuardMultiDim<T> {
public:
LinearAllocGuard2D(const size_t width_logical, const size_t height)
: LinearAllocGuardMultiDim<T>{make_hipExtent(width_logical * sizeof(T), height, 1)} {
HIP_CHECK(hipMallocPitch(&this->pitched_ptr_.ptr, &this->pitched_ptr_.pitch,
this->extent_.width, this->extent_.height));
if (unaligned) {
this->pitched_ptr_.pitch = width_logical * sizeof(T);
HIP_CHECK(hipMalloc(&this->pitched_ptr_.ptr, this->pitched_ptr_.pitch * height));
} else {
HIP_CHECK(hipMallocPitch(&this->pitched_ptr_.ptr, &this->pitched_ptr_.pitch,
this->extent_.width, this->extent_.height));
}
}
LinearAllocGuard2D(const LinearAllocGuard2D&) = delete;