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
This commit is contained in:
foreman
2018-07-25 17:38:16 -04:00
parent 83f8573a66
commit adf6570955
+2 -16
View File
@@ -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<cl::Platform> 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()