OpenCL support - using metadata

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

OpenCL support - using metadata

gbenyei

Anton Lokhmotov wrote:

> Given that at least two companies have found metadata useful for

> representing OpenCL C features in LLVM-IR, I think the community needs to

> reconsider the use of metadata, perhaps introducing a 'sticky' variant of

> it? 

 

We at Intel are also using metadata for our implementation. This approach is very useful for a few reasons:

First, when compiling OpenCL C code to llvm, some important information about the kernel arguments is lost. i.e. typedefs are lost, structures are sometimes disassembled. We’re adding a string containing the interesting part original function signature. This can also be used for providing data about the kernel arguments, validating the arguments set by the user, etc…

Second, we use a global metadata node, which enumerates all the kernel functions. This can be used to quickly enumerate the kernels in a program, instead of passing the whole module.

Third, for each kernel we hold the kernel attributes in the same metadata: vector type hint, required workgroup size and workgroup size hint.

Last, we also hold in the metadata a list of the local variables defined in that kernel.

 

Thanks

  Guy

 

 

new_email_signature_guy2

 

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev