From 69450a2be7575aa4f984b9ae2824da0e5634c9f0 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 5 Jul 2023 13:23:14 -0400 Subject: Initial sizeof/alignof implementation. (#2954) * Initial sizeof implementation. * Small macro improvement. * Fix some typos. * Refactor NaturalSize. Add more sizeof tests. * Use _makeParseExpr to add sizeof support. * Add size-of.slang diagnostic result. * Fix typo in folding with macro change. * Add a sizeof test of This. * Some more NaturalSize coverage. * Simple alignof support. * Testing for alignof. * Added 8 bit enum to check enums values are correctly sized. * Add alignof to completion. * Lower sizeof/alignof to IR. sizeof/alignof IR pass. Tests for simple generic scenarios. * Make append handle invalid properly. Improve comments. --------- Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com> --- tests/compute/tagged-union.slang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/compute') diff --git a/tests/compute/tagged-union.slang b/tests/compute/tagged-union.slang index 91f0cd101..e8c210288 100644 --- a/tests/compute/tagged-union.slang +++ b/tests/compute/tagged-union.slang @@ -10,7 +10,7 @@ // and without code changes. // We are going to define a dummy interface just for testing -// purposes, that can be used to see which implmentation +// purposes, that can be used to see which implementation // got invoked at runtime. // interface IFrobnicator @@ -18,7 +18,7 @@ interface IFrobnicator int frobnicate(int value); } -// Now we will define two different implemetnations that +// Now we will define two different implementations that // "frobnicate" values differently. The first will just // add to the value from a member variable. // @@ -87,7 +87,7 @@ void computeMain // since it was the second option in our `__TaggedUnion`. // // In the Vulkan case the size of both `A` and `B` is 16 bytes -// (because they round up structure sizes to their alignement) +// (because they round up structure sizes to their alignment) // and so the tag value will be the fifth 32-bit value. // We will thus set up the same data buffer to look like an `A` // value to Vulkan! -- cgit v1.2.3