MCPcopy Create free account
hub / github.com/creatale/node-dv / InitOpenclRunEnv_DeviceSelection

Method InitOpenclRunEnv_DeviceSelection

deps/tesseract/opencl/openclwrapper.cpp:796–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794}
795
796int OpenclDevice::InitOpenclRunEnv_DeviceSelection( int argc ) {
797//PERF_COUNT_START("InitOpenclRunEnv_DS")
798 if (!isInited) {
799 // after programs compiled, selects best device
800 ds_device bestDevice_DS = getDeviceSelection( );
801//PERF_COUNT_SUB("called getDeviceSelection()")
802 cl_device_id bestDevice = bestDevice_DS.oclDeviceID;
803 // overwrite global static GPUEnv with new device
804 if (selectedDeviceIsOpenCL() ) {
805 //printf("[DS] InitOpenclRunEnv_DS::Calling populateGPUEnvFromDevice() for selected device\n");
806 populateGPUEnvFromDevice( &gpuEnv, bestDevice );
807 gpuEnv.mnFileCount = 0; //argc;
808 gpuEnv.mnKernelCount = 0UL;
809//PERF_COUNT_SUB("populate gpuEnv")
810 CompileKernelFile(&gpuEnv, "");
811//PERF_COUNT_SUB("CompileKernelFile")
812 } else {
813 //printf("[DS] InitOpenclRunEnv_DS::Skipping populateGPUEnvFromDevice() b/c native cpu selected\n");
814 }
815 isInited = 1;
816 }
817//PERF_COUNT_END
818 return 0;
819}
820
821
822OpenclDevice::OpenclDevice()

Callers

nothing calls this directly

Calls 1

populateGPUEnvFromDeviceFunction · 0.85

Tested by

no test coverage detected