Fix av::copy in dialects to use capture-by-value

Change-Id: Ibce1488a1326f66b92b4d5b351230666b691ed31


[ROCm/hip-tests commit: cb539b227c]
이 커밋은 다음에 포함됨:
Ben Sander
2016-09-01 14:00:46 -05:00
부모 3ced85b97a
커밋 43eb8bc993
2개의 변경된 파일7개의 추가작업 그리고 9개의 파일을 삭제
+5 -2
파일 보기
@@ -27,22 +27,25 @@ int main(int argc, char *argv[])
hipMalloc(&B_d, sizeBytes);
hipMalloc(&C_d, sizeBytes);
// Initialize host data
// Initialize host memory
for (int i=0; i<sizeElements; i++) {
A_h[i] = 1.618f * i;
B_h[i] = 3.142f * i;
}
// H2D Copy
hipMemcpy(A_d, A_h, sizeBytes, hipMemcpyHostToDevice);
hipMemcpy(B_d, B_h, sizeBytes, hipMemcpyHostToDevice);
// Launch kernel onto default accelerator:
// Launch kernel onto default accelerator
int blockSize = 256; // pick arbitrary block size
int blocks = (sizeElements+blockSize-1)/blockSize; // round up to launch enough blocks
hipLaunchKernel(vadd_hip, dim3(blocks), dim3(blockSize), 0, 0, A_d, B_d, C_d, sizeElements);
// D2H Copy
hipMemcpy(C_h, C_d, sizeBytes, hipMemcpyDeviceToHost);
// Verify
for (int i=0; i<sizeElements; i++) {
float ref= 1.618f * i + 3.142f * i;
if (C_h[i] != ref) {