Merge branch 'master' into reorder
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/ocl.c b/ocl.c
index d963fc1..7e16f60 100644
--- a/ocl.c
+++ b/ocl.c
@@ -465,6 +465,12 @@ build:
return NULL;
}
+ clRetainProgram(clState->program);
+ if (status != CL_SUCCESS) {
+ applog(LOG_ERR, "Error: Retaining Program (clRetainProgram)");
+ return NULL;
+ }
+
/* create a cl program executable for all the devices specified */
char *CompilerOptions = calloc(1, 256);
@@ -588,6 +594,12 @@ build:
applog(LOG_ERR, "Error: Loading Binary into cl_program (clCreateProgramWithBinary)");
return NULL;
}
+
+ clRetainProgram(clState->program);
+ if (status != CL_SUCCESS) {
+ applog(LOG_ERR, "Error: Retaining Program (clRetainProgram)");
+ return NULL;
+ }
}
free(source);
@@ -627,6 +639,12 @@ built:
applog(LOG_INFO, "%s", log);
return NULL;
}
+
+ clRetainProgram(clState->program);
+ if (status != CL_SUCCESS) {
+ applog(LOG_ERR, "Error: Retaining Program (clRetainProgram)");
+ return NULL;
+ }
}
/* get a kernel object handle for a kernel with the given name */