How do I set "TESSERACT_OPENCL_DEVICE" in a c++ program

55 views
Skip to first unread message

r014...@gmail.com

unread,
Oct 19, 2020, 5:16:41 AM10/19/20
to tesseract-ocr
I install a Tesseract with OpenCL, but my computer always automatically choose the origin CPU like:

[DS] Profile read from file (tesseract_opencl_profile_devices.dat).
[DS] Device[1] 1:GeForce GTX 1070 score is 0.371834
[DS] Device[2] 0:(null) score is 0.312181
[DS] Selected Device[2]: "(null)" (Native)

I want to evaluate how the GPU works but I don't know to force my program to chose the GPU.

It says that set the environment variable "TESSERACT_OPENCL_DEVICE" can do this.
However, When I write this in my c++ program it seems nothing happened

tessact.SetVariable(""TESSERACT_OPENCL_DEVICE"", "1");

how do I set the "TESSERACT_OPENCL_DEVICE"' variable in my program?
Reply all
Reply to author
Forward
0 new messages