[PATCH] D61488: [OpenCL] Make global ctor init function a kernel

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 05:01:34 PDT 2019


Anastasia created this revision.
Anastasia added reviewers: kpet, rjmccall.
Herald added subscribers: ebevhan, yaxunl.

We need to be able to enqueue internal function that initializes global constructors on the host side. Therefore it has to be converted to a kernel.

Note, supporting destruction would need some more work. However, it seems global destruction has little meaning without any dynamic resource allocation on the device and program scope variables are destroyed by the runtime when program is released.


https://reviews.llvm.org/D61488

Files:
  lib/CodeGen/CGDeclCXX.cpp
  lib/CodeGen/CodeGenFunction.cpp
  lib/CodeGen/CodeGenModule.cpp
  lib/CodeGen/CodeGenModule.h
  test/CodeGenOpenCLCXX/global_init.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61488.197956.patch
Type: text/x-patch
Size: 20337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190503/652df133/attachment-0001.bin>


More information about the cfe-commits mailing list