Unverified Commit a5156da5 authored by Pier Fiedorowicz's avatar Pier Fiedorowicz Committed by GitHub
Browse files

Fix GPU memory leak in context arrays (#4940)

* Fix GPU memory leak

* Undo CUDA change
parent bc809879
...@@ -42,7 +42,7 @@ HipArray::HipArray(HipContext& context, size_t size, int elementSize, const std: ...@@ -42,7 +42,7 @@ HipArray::HipArray(HipContext& context, size_t size, int elementSize, const std:
} }
HipArray::~HipArray() { HipArray::~HipArray() {
if (pointer != 0 && ownsMemory && context->getContextIsValid()) { if (pointer != 0 && ownsMemory) {
ContextSelector selector(*context); ContextSelector selector(*context);
hipError_t result = hipFree(pointer); hipError_t result = hipFree(pointer);
if (result != hipSuccess) { if (result != hipSuccess) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment