我对 opencl 中的 printf 有问题,这是我的代码的一部分:
clGetEventProfilingInfo(timing_event, CL_PROFILING_COMMAND_START,
sizeof(time_start), &time_start, NULL);
clGetEventProfilingInfo(timing_event, CL_PROFILING_COMMAND_END,sizeof(time_end),
&time_end, NULL);
total_time = time_end - time_start;
printf("\nAverage Time In Nanoseconds = %lu\n" , total_time );
我已经声明了这样的变量:
cl_event timing_event;
cl_ulong time_start, time_end;
cl_ulong total_time;
但是当我编译程序时 mingw32-gcc 会出现这个错误:
format %lu expects argument of type 'long unsigned int' but argument 2 has type 'cl_ulong'
[-Wformat]
并且 *.exe 不运行。那么有什么机构可以帮助我吗?我对这个错误感到很困惑!