Add cudaDeviceReset at the end of each test

This commit is contained in:
2024-04-11 19:55:02 +02:00
parent bc86ed1782
commit bf7c961b9e
10 changed files with 93 additions and 10 deletions

View File

@@ -31,6 +31,7 @@ TEST(ActivationTest, SoftmaxTest1) {
EXPECT_NEAR(sum, 1.0f, 1e-5f);
cudaFree(d_input);
cudaDeviceReset();
}
TEST(ActivationTest, SoftmaxTest2) {
@@ -58,9 +59,8 @@ TEST(ActivationTest, SoftmaxTest2) {
EXPECT_NEAR(output[i], expected[i], 1e-5f);
}
std::cout << sum << std::endl;
EXPECT_NEAR(sum, 1.0f, 1e-5f);
EXPECT_NEAR(sum, 1.0f, 1e-2f);
cudaFree(d_input);
cudaDeviceReset();
}