This corrects some interesting choices that were present in the HIP

unit tests such as e.g. de-allocating memory allocated with new[] using
free. All of these were identified via cppcheck.


[ROCm/hip commit: a619ac6f92]
이 커밋은 다음에 포함됨:
Alex Voicu
2017-11-01 22:51:22 +00:00
부모 2979a99888
커밋 b8a81d2b75
7개의 변경된 파일278개의 추가작업 그리고 52개의 파일을 삭제
+8 -2
파일 보기
@@ -36,17 +36,23 @@ __global__ void Kern(hipLaunchParm lp, float *A)
int main()
{
float *A, *Ad;
float A[len];
float *Ad;
for(int i=0;i<len;i++)
{
A[i] = 1.0f;
}
Ad = (float*)mallocHip(size);
memcpyHipH2D(Ad, A, size);
hipLaunchKernel(HIP_KERNEL_NAME(Kern), dim3(len/1024), dim3(1024), 0, 0, A);
hipLaunchKernel(
HIP_KERNEL_NAME(Kern), dim3(len/1024), dim3(1024), 0, 0, Ad);
memcpyHipD2H(A, Ad, size);
for(int i=0;i<len;i++)
{
assert(A[i] == 2.0f);
}
hipFree(Ad);
}