diff --git a/samples/0_Intro/hcc_dialects/vadd_hc_am.cpp b/samples/0_Intro/hcc_dialects/vadd_hc_am.cpp index 3685e688cd..53a137f74c 100644 --- a/samples/0_Intro/hcc_dialects/vadd_hc_am.cpp +++ b/samples/0_Intro/hcc_dialects/vadd_hc_am.cpp @@ -41,17 +41,12 @@ int main(int argc, char *argv[]) // Launch kernel onto AV. // Because the kernel PFE and the copies are submitted to same AV, they will execute in order // and we don't need additional synchronization to ensure the copies complete before the PFE begins. -#if 1 hc::completion_future cf= hc::parallel_for_each(av, hc::extent<1> (sizeElements), - [&] (hc::index<1> idx) [[hc]] { + [=] (hc::index<1> idx) [[hc]] { int i = idx[0]; - //C_d[i] = A_d[i] + B_d[i]; - C_d[0] = A_d[1] + B_d[2]; + C_d[i] = A_d[i] + B_d[i]; }); - cf.wait(); -#endif - // This copy is in same AV as the kernel and thus will wait for the kernel to finish before executing. diff --git a/samples/0_Intro/hcc_dialects/vadd_hip.cpp b/samples/0_Intro/hcc_dialects/vadd_hip.cpp index 9d223ba276..9684bef140 100644 --- a/samples/0_Intro/hcc_dialects/vadd_hip.cpp +++ b/samples/0_Intro/hcc_dialects/vadd_hip.cpp @@ -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