| 794 | } |
| 795 | |
| 796 | int 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 | |
| 822 | OpenclDevice::OpenclDevice() |
nothing calls this directly
no test coverage detected