From 7b388ccf78b0ef06e38ca74e965da3e0aecddb66 Mon Sep 17 00:00:00 2001
From: Chris Maffeo <cmaffeo2@illinois.edu>
Date: Sat, 8 May 2021 09:09:39 -0500
Subject: [PATCH] Fixed host deletion of device-allocated pointer introduced in
commit 019a4049
---
src/ComputeForce.cu | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ComputeForce.cu b/src/ComputeForce.cu
index 727ee618..440b2580 100644
--- a/src/ComputeForce.cu
+++ b/src/ComputeForce.cu
@@ -258,6 +258,7 @@ ComputeForce::~ComputeForce() {
for (std::size_t g = 0; g < gpuman.gpus.size(); ++g) {
gpuman.use(g);
tablePot_addr[g][ind]->free_from_cuda(tablePot_addr[g][ind]);
+ tablePot_addr[g][ind] = NULL;
}
delete tablePot[ind];
}
@@ -375,7 +376,7 @@ bool ComputeForce::addTabulatedPotential(String fileName, int type0, int type1)
for (std::size_t i = 0; i < gpuman.gpus.size(); ++i) {
gpuman.use(i);
tablePot_addr[i][ind]->free_from_cuda(tablePot_addr[i][ind]);
- delete tablePot_addr[i][ind];
+ tablePot_addr[i][ind] = NULL;
}
gpuman.use(0);
delete tablePot[ind];
--
GitLab