[cfe-dev] OpenCL & SPIR specific types - proposal and patch
Benyei, Guy
guy.benyei at intel.com
Wed Oct 24 16:36:41 PDT 2012
Hi all,
Please review this patch - I think I've fixed every controversial part of the original patch. The sampler type is now represented as i32, but it becomes a clang builtin type to enable efficient restriction checking. Also fixed every remark I've got for the different versions of the patch.
Thanks
[email_signature_guy_new2]
From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of Benyei, Guy
Sent: Sunday, October 21, 2012 16:00
To: Tanya Lattner
Cc: Richard Smith; cfe-dev at cs.uiuc.edu; Anton.Lokhmotov at arm.com
Subject: Re: [cfe-dev] OpenCL & SPIR specific types - proposal and patch
Tanya,
I've fixed the width/alignment and the debug info remarks, and also removed the sampler initialization function for now.
The main idea in passing through the OpenCLRuntime for initializing samplers is enabling the initialization of non-integer vendor specific samplers later on. It's not required for the current implementation, but it will be needed later on to support other representations of the sampler type, like in SPIR.
I prefer to leave sampler_t implemented with an i32 representation rather than removing it - the built-in types are needed for clean restriction checking.
Thanks
Guy
[email_signature_guy_new2]
From: Tanya Lattner [mailto:lattner at apple.com]
Sent: Saturday, October 20, 2012 07:45
To: Benyei, Guy
Cc: Richard Smith; cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>; Villmow, Micah; Anton.Lokhmotov at arm.com<mailto:Anton.Lokhmotov at arm.com>
Subject: Re: [cfe-dev] OpenCL & SPIR specific types - proposal and patch
Guy,
+ case BuiltinType::OCLSampler:
+ case BuiltinType::OCLEvent:
+ case BuiltinType::OCLImage1d:
+ case BuiltinType::OCLImage1dArray:
+ case BuiltinType::OCLImage1dBuffer:
+ case BuiltinType::OCLImage2d:
+ case BuiltinType::OCLImage2dArray:
+ case BuiltinType::OCLImage3d:
+ // Currently these types are pointers to opaque types.
+ Width = Target->getPointerWidth(0);
+ Align = Target->getPointerAlign(0);
+ break;
}
Is wrong if sampler is i32 I think.
Also, probably wrong:
+ case BuiltinType::OCLSampler:
+ return getOrCreateStructPtrType("opencl_sampler_t", OCLSamplerDITy);
Why do this?
+ } else if (type->isSamplerT()) {
+ CGM.getOpenCLRuntime().initializeOpenCLSampler(this, lvalue.getAddress(), EmitScalarExpr(init));
}
I also don't understand why you need to go through the OpenCLRuntime for this.
+ if (D->getType()->isSamplerT()) {
+ getOpenCLRuntime().initializeOpenCLSampler(NULL, GV, Init);
+ } else {
+ GV->setInitializer(Init);
+ }
I would rather just see sampler ripped out for now. I have no issues with the images/event code.
-Tanya
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121024/0f7cacd2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 24800 bytes
Desc: image001.png
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121024/0f7cacd2/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opencl_types6.patch
Type: application/octet-stream
Size: 36646 bytes
Desc: opencl_types6.patch
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121024/0f7cacd2/attachment.obj>
-------------- next part --------------
---------------------------------------------------------------------
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121024/0f7cacd2/attachment-0001.html>
More information about the cfe-dev
mailing list