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
[ROCm/clr commit: adf6570955]
This commit is contained in:
@@ -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()
|
||||
|
||||
مرجع در شماره جدید
Block a user