<2022-02-25 Fri>
关于AccelerateResizeImage()
的链接问题
因为增加了两个新文件accelerate-private.h
和accelerate.c
,AccelerateResizeImage()
就位于其中,因为magick/Makefile.am
中没有增加这两个文件,所以在autoreconf
时生成的Makefile.in
就不知道新增了两个文件,因此在configure
时生成的Makefile
中就不会编译AccelerateResizeImage()
函数,因此出现的链接问题。
$ rm configure
$ autoreconf
configure.ac:119: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see:
configure.ac:119: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
<2022-03-02 Wed>
在archlinux
上为Intel
启用OpenCL
% lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G1 (Ice Lake) (rev 07)
% clinfo
Number of platforms 0
% sudo pacman -S intel-compute-runtime
调试RunOpenCLBenchmark()
时的崩溃问题
发现直接运行gm display
没有崩溃问题,调试时却经常发生,有时SIGABRT
,有时SIGSEGV
,猜测可能是同步问题:
/*
We need this to get a proper performance benchmark, the operations
are executed asynchronous.
*/
if (is_cpu == MagickFalse)
{
CacheInfo
*cache_info;
MagickCLCacheInfo
cl_info;
cache_info=(CacheInfo *) resizedImage->cache;
cl_info=GetCacheInfoOpenCL(cache_info);
if (cl_info != (MagickCLCacheInfo) NULL)
openCL_library->clWaitForEvents(cl_info->event_count,
cl_info->events);
}
if (i > 0)
StopAccelerateTimer(&timer);
if (bluredImage != (Image *) NULL)
DestroyImage(bluredImage);
if (unsharpedImage != (Image *) NULL)
DestroyImage(unsharpedImage);
if (resizedImage != (Image *) NULL)
DestroyImage(resizedImage);
经常遇到的是:resizedImage
为0
(SIGSEGV
),DestroyImage(resizedImage);
(SIGABRT
)。