search for: upcast

Displaying 20 results from an estimated 44 matches for "upcast".

Did you mean: upcase
2020 May 13
2
[PATCH v3 1/4] dma-buf: add support for virtio exported objects
...9;t really review anything stand-alone - adding very specific ops to the generic interface is rather awkward, eventually everyone wants that and we end up in a mess. I think the best solution here would be if we create a struct virtio_dma_buf which subclasses dma-buf, add a (hopefully safe) runtime upcasting functions, and then a virtio_dma_buf_get_uuid() function. Just storing the uuid should be doable (assuming this doesn't change during the lifetime of the buffer), so no need for a callback. - for the runtime upcasting the usual approach is to check the ->ops pointer. Which means that woul...
2020 May 13
2
[PATCH v3 1/4] dma-buf: add support for virtio exported objects
...9;t really review anything stand-alone - adding very specific ops to the generic interface is rather awkward, eventually everyone wants that and we end up in a mess. I think the best solution here would be if we create a struct virtio_dma_buf which subclasses dma-buf, add a (hopefully safe) runtime upcasting functions, and then a virtio_dma_buf_get_uuid() function. Just storing the uuid should be doable (assuming this doesn't change during the lifetime of the buffer), so no need for a callback. - for the runtime upcasting the usual approach is to check the ->ops pointer. Which means that woul...
2010 Oct 23
2
[LLVMdev] Cast failure in SelectionDAGBuilder
...!48488 %construct = call %tart.core.Hashable @"tart.core.ValueRef[int32].construct(int32)"(%"tart.core.ValueRef[char]"* %ValueRef_new, i32 %value), !dbg !48488 store %"tart.core.ValueRef[char]"* null, %"tart.core.ValueRef[char]"** %gc_root, !dbg !48488 %upcast = getelementptr inbounds %"tart.core.ValueRef[char]"* %ValueRef_new, i32 0, i32 0, i32 0, !dbg !48488 ret %tart.core.Object* %upcast, !dbg !48488 } As you can see, the only call to llvm.gcroot() is in fact in the first block. Now, here's the weird part: If I turn on optimization,...
2015 Apr 18
2
[LLVMdev] Does LLVM optimize rudimentary i16 -> i32 conversions
...ut almost all of the time they are upgraded to i32 because my add operations only happen on i32. So to be representative to my language definition, I have a lots of Sext/Zext and Truncs pretty much every time I add or subtract. As soon as I pass through InstCombine things look much nicer, all the upcasts and downcasts go away, but my test cases are simple. Is InstCombine pretty good about finding most/all such cases? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150417/04cee200/attachment.html>
2020 Apr 03
4
[PATCH 40/44] drm/cirrus: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Signed-off-by: Daniel Vetter <daniel.vetter at intel.com> Cc: Dave Airlie <airlied at redhat.com> Cc: Gerd Hoffmann <kraxel at redhat.com> Cc: Daniel Vetter <daniel.vetter at ffwll....
2020 Apr 03
4
[PATCH 40/44] drm/cirrus: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Signed-off-by: Daniel Vetter <daniel.vetter at intel.com> Cc: Dave Airlie <airlied at redhat.com> Cc: Gerd Hoffmann <kraxel at redhat.com> Cc: Daniel Vetter <daniel.vetter at ffwll....
2012 Oct 05
0
[LLVMdev] TableGen: Requesting feedback for "TGContext"
...give > feedback on inaccuracies or suggested improvements for this document. These all look great, please apply. > One question regarding `classof()`s of the form: > static bool classof(const Foo *) { return true; } > Is the only purpose of this to optimize away "trivial" upcasts/isa<> > checks which are known statically? Yes. > If so, could we factor out this > case into Casting.h (using a trait like std::is_base_of<>)? That's a great idea, please do! :) -Chris
2012 Oct 05
2
[LLVMdev] TableGen: Requesting feedback for "TGContext"
...ed PDF is the rendered version of this document. Please give feedback on inaccuracies or suggested improvements for this document. One question regarding `classof()`s of the form: static bool classof(const Foo *) { return true; } Is the only purpose of this to optimize away "trivial" upcasts/isa<> checks which are known statically? If so, could we factor out this case into Casting.h (using a trait like std::is_base_of<>)? --Sean Silva On Thu, Oct 4, 2012 at 2:06 AM, Chris Lattner <sabre at nondot.org> wrote: > It won't cause a negative effect, go for it! Dy...
2008 Mar 02
2
[LLVMdev] Struct layout assumptions
...bclass B, each of which have two methods. One way to layout the vtable for B is to include the vtable for A as a sub-structure, i.e.: A.vtable = { A.method1 *, A.method2 * } B.vtable = { { A.method1 *, A.method2 * }, B.method1 *, B.method2 * } The advantage of this form is that when you upcast B to an A, the pointer to the B vtable can be upcast as well - i.e. its a valid pointer to a B vtable is also a valid pointer to an A vtable. However, when it comes to actually calling methods this form is somewhat cumbersome to work with. It means that each member in B can't simply record...
2012 Oct 05
1
[LLVMdev] TableGen: Requesting feedback for "TGContext"
...n page I think. > These all look great, please apply. Landed in r165290, r165291, r165292, r165293. >> One question regarding `classof()`s of the form: >> static bool classof(const Foo *) { return true; } >> Is the only purpose of this to optimize away "trivial" upcasts/isa<> >> checks which are known statically? > > Yes. > >> If so, could we factor out this >> case into Casting.h (using a trait like std::is_base_of<>)? > > That's a great idea, please do! :) Ok. We already have an is_base_of<> in Support/typ...
2019 Sep 17
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...ress(sgt->sgl); I agree with Gerd, this looks pretty horrible to me. The usual way we've done these kind of special dma-bufs is: - They all get allocated at the same place, through some library or whatever. - You add a dma_buf_is_virtio(dma_buf) function, or maybe something that also upcasts or returns NULL, which checks for dma_buf->ops. - Once you've upcasted at runtime by checking for ->ops, you can add whatever fancy interfaces you want. Including a real&proper interface to get at whatever underlying id you need to for real buffer sharing between virtio device...
2019 Oct 08
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...> > > The usual way we've done these kind of special dma-bufs is: > > > > - They all get allocated at the same place, through some library or > > whatever. > > > > - You add a dma_buf_is_virtio(dma_buf) function, or maybe something that > > also upcasts or returns NULL, which checks for dma_buf->ops. > > > > Thanks for a lot of valuable feedback and sorry for the late reply. > > While I agree that stuffing the resource ID in sg_dma_address() is > quite ugly (for example, the regular address arithmetic doesn't work),...
2019 Oct 08
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...pecial dma-bufs is: > > > > > > > > - They all get allocated at the same place, through some library or > > > > whatever. > > > > > > > > - You add a dma_buf_is_virtio(dma_buf) function, or maybe something that > > > > also upcasts or returns NULL, which checks for dma_buf->ops. > > > > > > > > > > Thanks for a lot of valuable feedback and sorry for the late reply. > > > > > > While I agree that stuffing the resource ID in sg_dma_address() is > > > quite ugly (for e...
2019 Oct 16
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...> > > > - They all get allocated at the same place, through some library or > > > > > > whatever. > > > > > > > > > > > > - You add a dma_buf_is_virtio(dma_buf) function, or maybe something that > > > > > > also upcasts or returns NULL, which checks for dma_buf->ops. > > > > > > > > > > > > > > > > Thanks for a lot of valuable feedback and sorry for the late reply. > > > > > > > > > > While I agree that stuffing the resource ID in sg...
2020 Feb 25
1
[PATCH 1/3] drm: Add separate state structure for legacy, non-KMS drivers
Hi Thomas, On Tuesday, 25 February 2020, Thomas Zimmermann <tzimmermann at suse.de> wrote: > Non-KMS drivers store state in struct drm_driver. This bloats the > structure for KMS drivers and prevents it from being declared with > 'static const' qualifiers. Moving the non-KMS state into a separate > data structure resolves this. > > Have you considered subclassing
2020 Apr 15
0
[PATCH 36/59] drm/cirrus: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Acked-by: Eric Anholt <eric at anholt.net> Acked-by: Sam Ravnborg <sam at ravnborg.org> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com> Cc: Dave Airlie <airlied at redhat....
2020 May 14
0
[PATCH v3 1/4] dma-buf: add support for virtio exported objects
...gt; > - adding very specific ops to the generic interface is rather awkward, > > eventually everyone wants that and we end up in a mess. I think the > > best solution here would be if we create a struct virtio_dma_buf which > > subclasses dma-buf, add a (hopefully safe) runtime upcasting > > functions, and then a virtio_dma_buf_get_uuid() function. Just storing > > the uuid should be doable (assuming this doesn't change during the > > lifetime of the buffer), so no need for a callback. > > So you would prefer a solution similar to the original versio...
2020 May 14
0
[PATCH v3 1/4] dma-buf: add support for virtio exported objects
Hi, > - for the runtime upcasting the usual approach is to check the ->ops > pointer. Which means that would need to be the same for all virtio > dma_bufs, which might get a bit awkward. But I'd really prefer we not > add allocator specific stuff like this to dma-buf. This is exactly the problem, it gets messy q...
2010 May 13
1
tune svm
Hello, I hope you can help me! I`m trying to tune svm parameters: cost and gamma for a landsat image classification, but I get an error and I can't understand it. I write this: > tune(svm, Class~., data = mdt01bis, ranges = list(gamma = 2^(-15:3), cost > = 2^(-5:15))) and R gives: Error en predict.svm(model, if (!is.null(validation.x)) validation.x else if (useFormula)
2020 Apr 06
0
[PATCH 40/44] drm/cirrus: Don't use drm_device->dev_private
Am 03.04.20 um 15:58 schrieb Daniel Vetter: > Upcasting using a container_of macro is more typesafe, faster and > easier for the compiler to optimize. > > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com> > Cc: Dave Airlie <airlied at redhat.com> > Cc: Gerd Hoffmann <kraxel at redhat.com> > Cc: Daniel Vett...