From adf6570955125d0433a961fd4df73ea7fabf1480 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 25 Jul 2018 17:38:16 -0400
Subject: [PATCH] P4 to Git Change 1585460 by jatang@jatang-opencl-hsa-stg5 on
2018/07/25 17:25:24
SWDEV-1 - Also catch clGetPlatformIDs error, so clinfo won't get a page fault when no platform is found.
Instead clinfo now shows:
ERROR: clGetPlatformIDs(-1001)
Affected files ...
... //depot/stg/opencl/drivers/opencl/tools/clinfo/clinfo.cpp#5 edit
---
opencl/tools/clinfo/clinfo.cpp | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/opencl/tools/clinfo/clinfo.cpp b/opencl/tools/clinfo/clinfo.cpp
index 4d49c8db89..888c1f1187 100644
--- a/opencl/tools/clinfo/clinfo.cpp
+++ b/opencl/tools/clinfo/clinfo.cpp
@@ -120,17 +120,6 @@ jurisdiction and venue of these courts.
bool verbose = false;
-inline
-void
-checkErr(cl_int err, const char * name)
-{
- if (err != CL_SUCCESS) {
- std::cerr << "ERROR: " << name << " (" << err << ")" << std::endl;
- exit(1);
- }
-}
-
-
int
main(int argc, char** argv)
{
@@ -152,13 +141,10 @@ main(int argc, char** argv)
// Platform info
std::vector platforms;
- err = cl::Platform::get(&platforms);
-
- checkErr(
- platforms.size() == 0 ? -1 : err,
- "cl::Platform::get()");
try {
+ err = cl::Platform::get(&platforms);
+
// Iteratate over platforms
std::cout << "Number of platforms:\t\t\t\t "
<< platforms.size()