[Beignet] [PATCH] only release cmrt device when it is already created
Guo Yejun
yejun.guo at intel.com
Wed Apr 27 23:48:23 UTC 2016
this patch fixed the issue at https://bugs.freedesktop.org/show_bug.cgi?id=95136
Signed-off-by: Guo Yejun <yejun.guo at intel.com>
---
src/cl_api.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cl_api.c b/src/cl_api.c
index 3902592..881ea6d 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -279,7 +279,8 @@ cl_int
clReleaseDevice(cl_device_id device)
{
#ifdef HAS_CMRT
- cmrt_destroy_device(device);
+ if (device->cmrt_device != NULL)
+ cmrt_destroy_device(device);
#endif
// XXX stub for C++ Bindings
--
1.9.1
More information about the Beignet
mailing list