Skip to content

Commit

Permalink
Minor update: deallocate device memory in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
LKedward committed Apr 14, 2020
1 parent 984cfc7 commit b32ef9d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/testPinnedMemory.f90
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ program testPinnedMemory
call fclTestAssertEqual(hostInt32_1,hostInt32_2,'hostInt32_1 == hostInt32_2 (1)')
call fclTestAssertEqual(hostChar_1,hostChar_2,'hostChar_1 == hostChar_2 (1)')

! --- Deallocate device memory ---
call fclFreeBuffer(deviceInt32_1)
call fclFreeBuffer(deviceInt32_2)
call fclFreeBuffer(deviceReal32_1)
call fclFreeBuffer(deviceReal32_2)
call fclFreeBuffer(deviceReal64_1)
call fclFreeBuffer(deviceReal64_2)
call fclFreeBuffer(deviceBuffer_1)
call fclFreeBuffer(deviceBuffer_2)

! --- Deallocate pinned memory ---
call fclFreeHost(hostReal32_1)
call fclFreeHost(hostReal32_2)
Expand Down
9 changes: 9 additions & 0 deletions test/testSubBuffers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ program testSubBuffers
call fclTestAssertEqual(hostInt32_1,hostInt32_2,'hostInt32_1 == hostInt32_2')
call fclTestAssertEqual(hostChar_1,hostChar_2,'hostChar_1 == hostChar_2')

call fclFreeBuffer(deviceInt32_1)
call fclFreeBuffer(deviceInt32_2)
call fclFreeBuffer(deviceReal32_1)
call fclFreeBuffer(deviceReal32_2)
call fclFreeBuffer(deviceReal64_1)
call fclFreeBuffer(deviceReal64_2)
call fclFreeBuffer(deviceBuffer_1)
call fclFreeBuffer(deviceBuffer_2)

call fclTestFinish()

end program testSubBuffers
Expand Down

0 comments on commit b32ef9d

Please sign in to comment.