I found that can add external library in the kernel, but need add path of library to cpp code. Can someone tell me, how to add clCreateProgramWithSource() in C++ with path of library?
Thats part of my code
std::ifstream sourceFile(name);
std::string sourceCode(
std::istreambuf_iterator<char>(sourceFile),
(std::istreambuf_iterator<char>()));
Program::Sources source(1, std::make_pair(sourceCode.c_str(), sourceCode.length() + 1));
// Make program of the source code in the context
Program program = Program(context, source);
// Build program for these specific devices
errcode = program.build(devices);
if (errcode != CL_SUCCESS)
{
cout << "There were error during build kernel code. Please, check program code. Errcode = " << errcode << "\n";
cout << "BUILD LOG: " + program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[0]) + "\n";
getchar();
return;
}
// Make kernel
Kernel kernel(program, "vector_add");