diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2015-04-14 09:53:54 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-04-14 12:42:58 +0800 |
commit | 73a5d9b249f19123ccc4b5a77b5eac61c1ce5a60 (patch) | |
tree | a3de63d164edafe6e59795f58f26f8a51ab89e4f | |
parent | 0550850807160bcb7075c69d34177c324cd78343 (diff) | |
download | beignet-73a5d9b249f19123ccc4b5a77b5eac61c1ce5a60.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>
-rw-r--r-- | utests/utest_run.cpp | 6 |
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(); } |