summaryrefslogtreecommitdiff
path: root/utests/utest_run.cpp
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2015-04-14 09:53:54 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-04-14 12:41:39 +0800
commit61df2f861c55a044d10a582799858fa441981173 (patch)
tree6353adbc700a2441ea3013bb735ca47a12a0347c /utests/utest_run.cpp
parent368ebd9a2fffadd4927e9c9309773d1afd22543f (diff)
downloadbeignet-61df2f861c55a044d10a582799858fa441981173.tar.gz
utests: don't continue to run any case when fail to initialize device.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'utests/utest_run.cpp')
-rw-r--r--utests/utest_run.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utests/utest_run.cpp b/utests/utest_run.cpp
index d797c098..3cc1b6cf 100644
--- a/utests/utest_run.cpp
+++ b/utests/utest_run.cpp
@@ -58,7 +58,10 @@ int main(int argc, char *argv[])
{
int c = 0;
- cl_ocl_init();
+ if (cl_ocl_init() != CL_SUCCESS) {
+ fprintf(stderr, "Failed to initialize cl device.\n");
+ goto clean;
+ }
c = getopt_long (argc, argv, shortopts, longopts, NULL);
@@ -124,6 +127,7 @@ int main(int argc, char *argv[])
}
} while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1);
+clean:
cl_ocl_destroy();
}