From eb2df034817d325b5d2849f4b32959c3d7549754 Mon Sep 17 00:00:00 2001
From: dinggeonly <562515212@qq.com>
Date: Fri, 28 May 2021 09:40:54 +0800
Subject: [PATCH] Add property [IsDisposed] to make it is possible to know
whether the object is disposed
---
ManagedCUDA/CudaContext.cs | 1 +
NVRTC/CudaRuntimeCompiler.cs | 3 +++
2 files changed, 4 insertions(+)
diff --git a/ManagedCUDA/CudaContext.cs b/ManagedCUDA/CudaContext.cs
index 59c492e..638ad4a 100644
--- a/ManagedCUDA/CudaContext.cs
+++ b/ManagedCUDA/CudaContext.cs
@@ -60,6 +60,7 @@ public enum DirectXVersion
protected int _deviceID;
///
protected bool disposed;
+ public bool IsDisposed { get { return disposed; } protected set { disposed = value; } }
private bool _contextOwner; //Indicates if this CudaContext instance created the wrapped cuda context and should be destroyed while disposing.
#region Constructors
diff --git a/NVRTC/CudaRuntimeCompiler.cs b/NVRTC/CudaRuntimeCompiler.cs
index 46443af..aa6a7e1 100644
--- a/NVRTC/CudaRuntimeCompiler.cs
+++ b/NVRTC/CudaRuntimeCompiler.cs
@@ -15,6 +15,9 @@ public class CudaRuntimeCompiler : IDisposable
{
nvrtcProgram _program;
bool disposed = false;
+
+ public bool IsDisposed { get { return disposed; } protected set { disposed = value; } }
+
nvrtcResult res;
#region Contructors
///