Commit f617c0d4 authored by Alexander Alekhin's avatar Alexander Alekhin

ocl: fix for get string info from OpenCL

parent c5afaa4e
...@@ -97,13 +97,14 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string ...@@ -97,13 +97,14 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string
if (err != CL_SUCCESS) if (err != CL_SUCCESS)
return err; return err;
param.resize(required); param.clear();
if (required > 0) if (required > 0)
{ {
err = f(obj, name, required, &param.at(0), NULL); std::vector<char> buf(required + 1, char(0));
err = f(obj, name, required, &buf[0], NULL);
if (err != CL_SUCCESS) if (err != CL_SUCCESS)
return err; return err;
param.resize(required - 1); // last symbol is '\0' param = &buf[0];
} }
return CL_SUCCESS; return CL_SUCCESS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment