diff --git a/samples/0_Intro/bit_extract/bit_extract.cpp b/samples/0_Intro/bit_extract/bit_extract.cpp index 3f7636bc08..c3db9c17f9 100644 --- a/samples/0_Intro/bit_extract/bit_extract.cpp +++ b/samples/0_Intro/bit_extract/bit_extract.cpp @@ -100,5 +100,11 @@ int main(int argc, char* argv[]) { checkHipErrors(hipErrorUnknown); } } + + checkHipErrors(hipFree(A_d)); + checkHipErrors(hipFree(C_d)); + free(A_h); + free(C_h); + printf("PASSED!\n"); } diff --git a/samples/0_Intro/square/square.cu b/samples/0_Intro/square/square.cu index eba054b353..cc1a21d61c 100644 --- a/samples/0_Intro/square/square.cu +++ b/samples/0_Intro/square/square.cu @@ -94,5 +94,10 @@ int main(int argc, char *argv[]) CHECK(cudaErrorUnknown); } } + + CHECK ( cudaFree(A_d)); + CHECK ( cudaFree(C_d)); + free(A_h); + free(C_h); printf ("PASSED!\n"); } diff --git a/samples/0_Intro/square/square.hipref.cpp b/samples/0_Intro/square/square.hipref.cpp index 80ff2a00bf..7efb81adf4 100644 --- a/samples/0_Intro/square/square.hipref.cpp +++ b/samples/0_Intro/square/square.hipref.cpp @@ -92,5 +92,11 @@ int main(int argc, char* argv[]) { CHECK(hipErrorUnknown); } } + + CHECK(hipFree(A_d)); + CHECK(hipFree(C_d)); + free(A_h); + free(C_h); + printf("PASSED!\n"); } diff --git a/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp b/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp index a5d3c11165..73ba757638 100644 --- a/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp +++ b/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp @@ -86,5 +86,9 @@ int main() { } else { std::cout << "success\n"; } + free(hInput); + free(hOutput); + checkHipErrors(hipFree(dInput)); + checkHipErrors(hipFree(dOutput)); return 0; } diff --git a/samples/2_Cookbook/16_assembly_to_executable/square.cpp b/samples/2_Cookbook/16_assembly_to_executable/square.cpp index 296be3cbbe..d64613fa05 100644 --- a/samples/2_Cookbook/16_assembly_to_executable/square.cpp +++ b/samples/2_Cookbook/16_assembly_to_executable/square.cpp @@ -84,5 +84,11 @@ int main(int argc, char *argv[]) checkHipErrors(hipErrorUnknown); } } + + checkHipErrors(hipFree(A_d)); + checkHipErrors(hipFree(C_d)); + free(A_h); + free(C_h); + printf ("PASSED!\n"); } diff --git a/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp b/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp index 96dbb54abb..d9c18f1c83 100644 --- a/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp +++ b/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp @@ -84,5 +84,9 @@ int main(int argc, char *argv[]) checkHipErrors(hipErrorUnknown); } } + checkHipErrors(hipFree(A_d)); + checkHipErrors(hipFree(C_d)); + free(A_h); + free(C_h); printf ("PASSED!\n"); } diff --git a/samples/2_Cookbook/18_cmake_hip_device/square.cpp b/samples/2_Cookbook/18_cmake_hip_device/square.cpp index 2e07069adf..7a0faa624b 100644 --- a/samples/2_Cookbook/18_cmake_hip_device/square.cpp +++ b/samples/2_Cookbook/18_cmake_hip_device/square.cpp @@ -85,5 +85,9 @@ int main(int argc, char *argv[]) checkHipErrors(hipErrorUnknown); } } + checkHipErrors(hipFree(A_d)); + checkHipErrors(hipFree(C_d)); + free(A_h); + free(C_h); printf ("PASSED!\n"); } diff --git a/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp b/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp index e2f1c0fd51..f834085e52 100644 --- a/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp +++ b/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp @@ -85,5 +85,9 @@ int main(int argc, char *argv[]) checkHipErrors(hipErrorUnknown); } } + checkHipErrors(hipFree(A_d)); + checkHipErrors(hipFree(C_d)); + free(A_h); + free(C_h); printf ("PASSED!\n"); } diff --git a/samples/2_Cookbook/22_cmake_hip_lang/square.hip b/samples/2_Cookbook/22_cmake_hip_lang/square.hip index c74de2698b..8092dbc12d 100644 --- a/samples/2_Cookbook/22_cmake_hip_lang/square.hip +++ b/samples/2_Cookbook/22_cmake_hip_lang/square.hip @@ -85,5 +85,9 @@ int main(int argc, char *argv[]) checkHipErrors(hipErrorUnknown); } } + checkHipErrors(hipFree(A_d)); + checkHipErrors(hipFree(C_d)); + free(A_h); + free(C_h); printf ("PASSED!\n"); }