[cfe-dev] OpenCL & SPIR specific types - proposal and patch
Benyei, Guy
guy.benyei at intel.com
Sun Oct 21 07:00:18 PDT 2012
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; Villmow, Micah; 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/20121021/5e35d908/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/20121021/5e35d908/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/20121021/5e35d908/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/20121021/5e35d908/attachment-0001.html>
More information about the cfe-dev
mailing list