diff options
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/cropscale.c | 6 | ||||
-rw-r--r-- | libhb/openclwrapper.c | 17 | ||||
-rw-r--r-- | libhb/work.c | 8 |
3 files changed, 20 insertions, 11 deletions
diff --git a/libhb/cropscale.c b/libhb/cropscale.c index c7d7d9948..66aec7f27 100644 --- a/libhb/cropscale.c +++ b/libhb/cropscale.c @@ -74,7 +74,7 @@ static int hb_crop_scale_init( hb_filter_object_t * filter, pv->use_decomb = init->job->use_decomb; pv->use_detelecine = init->job->use_detelecine; - if( pv->job->use_opencl ) + if( pv->job->use_opencl && pv->job->title->opencl_support) { pv->os = ( hb_oclscale_t * )malloc( sizeof( hb_oclscale_t ) ); memset( pv->os, 0, sizeof( hb_oclscale_t ) ); @@ -138,7 +138,7 @@ static void hb_crop_scale_close( hb_filter_object_t * filter ) } #ifdef USE_OPENCL - if( pv->job->use_opencl && pv->os ) + if( pv->job->use_opencl && pv->job->title->opencl_support && pv->os ) { CL_FREE( pv->os->bicubic_x_weights ); CL_FREE( pv->os->bicubic_y_weights ); @@ -191,7 +191,7 @@ static hb_buffer_t* crop_scale( hb_filter_private_t * pv, hb_buffer_t * in ) #ifdef USE_OPENCL // Use bicubic OpenCL scaling when selected and when downsampling < 4:1; - if ((pv->job->use_opencl) && (pv->width_out * 4 > pv->width_in) && (in->cl.buffer != NULL) && (out->cl.buffer != NULL)) + if ((pv->job->use_opencl && pv->job->title->opencl_support) && (pv->width_out * 4 > pv->width_in) && (in->cl.buffer != NULL) && (out->cl.buffer != NULL)) { hb_ocl_scale(in, out, pv->crop, pv->os); } diff --git a/libhb/openclwrapper.c b/libhb/openclwrapper.c index adc0f38b3..515297523 100644 --- a/libhb/openclwrapper.c +++ b/libhb/openclwrapper.c @@ -1181,6 +1181,8 @@ void hb_opencl_info_print() if (devices[i] != NULL) { char vendor[100], name[1024], version[1024]; + cl_device_type device_type; + char *device_type_name = "Unknown"; clGetDeviceInfo(devices[i], CL_DEVICE_VENDOR, sizeof(vendor), vendor, NULL); @@ -1188,9 +1190,24 @@ void hb_opencl_info_print() name, NULL); clGetDeviceInfo(devices[i], CL_DRIVER_VERSION, sizeof(version), version, NULL); + clGetDeviceInfo(devices[i], CL_DEVICE_TYPE, sizeof(device_type), + &device_type, NULL); + + if (device_type & CL_DEVICE_TYPE_GPU) + device_type_name = "GPU"; + else + if (device_type & CL_DEVICE_TYPE_CPU) + device_type_name = "CPU"; + else + if (device_type & CL_DEVICE_TYPE_ACCELERATOR) + device_type_name = "Accelerator"; + else + if (device_type & CL_DEVICE_TYPE_CUSTOM) + device_type_name = "Custom"; hb_log("GPU #%d: %s %s", i + 1, vendor, name); hb_log(" - driver version: %s", version); + hb_log(" - OpenCL device type: %s%s",device_type_name,device_type & CL_DEVICE_TYPE_DEFAULT ? "/Default" : ""); } } diff --git a/libhb/work.c b/libhb/work.c index bd5b66529..24f05282b 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -550,14 +550,6 @@ static void do_job(hb_job_t *job) hb_log( "starting job" ); - if (job->use_opencl || job->use_hwd) - { - hb_log("Using GPU: Yes."); - } - else - { - hb_log("Using GPU: No."); - } /* Look for the scanned subtitle in the existing subtitle list * select_subtitle implies that we did a scan. */ if( !job->indepth_scan && interjob->select_subtitle ) |