[FFmpeg-devel] OpenCL: convert meaningless "device id" output to "device name"
Lenny Wang
lenny at multicorewareinc.com
Thu Sep 12 07:38:23 CEST 2013
Any chance to have this patch accepted?
I also want to point out that currently users can choose OpenCL
devices by using this option "-opencl_options device_idx=0". I have
done extensive tests on many Intel/AMD platforms, on Intel, the CPU
OpenCL device is usually device 0 and on AMD, device 0 is the GPU
device. With this patch, users can tell which device is actually
being used without confusion.
On Tue, Sep 10, 2013 at 3:08 AM, highgod0401 <highgod0401 at gmail.com> wrote:
>
>
>
>
>
> highgod0401
>
> From: Lenny Wang
> Date: 2013-09-10 15:57
> To: ffmpeg-devel
> Subject: [FFmpeg-devel] OpenCL: convert meaningless "device id" output to "device name"
> Greetings all,
>
> The current verbose output from ffmpeg-opencl is like this "[OPENCLUTILS @
> 00bf4060] Platform Name: NVIDIA Corporation, device id: 0x35f1518". The
> "device id" is formatted to a hexadecimal integer from *cl_device_id* type.
> In OpenCL world, the *cl_device_id* value is used to identify a specific
> OpenCL device, this value is dynamic and it gives no information about
> which device is being used. I argue that it should be changed to a
> meaningful device name. See patch attached.
>
> diff --git a/libavutil/opencl.c b/libavutil/opencl.c
> index 5887b50..e0b28c3 100644
> --- a/libavutil/opencl.c
> +++ b/libavutil/opencl.c
> @@ -516,9 +516,9 @@ static int init_opencl_env(OpenclContext *opencl_ctx, AVOpenCLExternalEnv *ext_o
> /*
> * Use available platform.
> */
> - av_log(opencl_ctx, AV_LOG_VERBOSE, "Platform Name: %s, device id: 0x%x\n",
> + av_log(opencl_ctx, AV_LOG_VERBOSE, "Platform Name: %s, Device Name: %s\n",
> opencl_ctx->device_list.platform_node[opencl_ctx->platform_idx]->platform_name,
> - (unsigned int)opencl_ctx->device_id);
> + device_node->device_name);
> cps[0] = CL_CONTEXT_PLATFORM;
> cps[1] = (cl_context_properties)opencl_ctx->platform_id;
> cps[2] = 0;
>
> Shouldn't the "Device Name" be written as "device name"?
>
> Looks good to me, it make the print information meaningful.
>
> Thanks
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list