"ssh:/git@developer.sourcefind.cn:2222/one/spconv.git" did not exist on "583a6f00111a681eda3266866d4ddcf2a4f294f1"
Commit 3e43d52b authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed CUDA error when working with multiple contexts

parent 8fe2b5a5
...@@ -41,6 +41,7 @@ CudaArray::CudaArray(CudaContext& context, int size, int elementSize, const std: ...@@ -41,6 +41,7 @@ CudaArray::CudaArray(CudaContext& context, int size, int elementSize, const std:
CudaArray::~CudaArray() { CudaArray::~CudaArray() {
if (pointer != 0 && ownsMemory && context->getContextIsValid()) { if (pointer != 0 && ownsMemory && context->getContextIsValid()) {
context->setAsCurrent();
CUresult result = cuMemFree(pointer); CUresult result = cuMemFree(pointer);
if (result != CUDA_SUCCESS) { if (result != CUDA_SUCCESS) {
std::stringstream str; std::stringstream str;
......
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