GraphicsMagick 的 OpenCL 开发记录(二)

文章目录

  • 关于`AccelerateResizeImage()`的链接问题
  • 在`archlinux`上为`Intel`启用`OpenCL`
  • 调试`RunOpenCLBenchmark()`时的崩溃问题

<2022-02-25 Fri>

关于AccelerateResizeImage()的链接问题

因为增加了两个新文件accelerate-private.haccelerate.cAccelerateResizeImage()就位于其中,因为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);

经常遇到的是:resizedImage0SIGSEGV),DestroyImage(resizedImage);SIGABRT)。

commit:replace MagickCoreSignature with MagickSignature

你可能感兴趣的:(GraphicsMagick,的,OpenCL,开发,GraphicsMagick,OpenCL,linux,Makefile)