From 9ec6b91686b651d959fd9ffbec283845bd725dd6 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:37:03 -0600 Subject: Feature/initialize list side branch (#6058) * SP004: implement initialize list translation to ctor - We synthesize a member-wise constructor for each struct follow the rules described in SP004. - Add logic to translate the initialize list to constructor invoke - Add cuda-host decoration for the synthesized constructor - Remove the default constructor when we have a valid member init constructor - Disable -zero-initialize option, will re-implement it in followup (#6109). - Fix the overload lookup issue When creating invoke expression for ctor, we need to call ResolveInvoke() to find us the best candidates, however the existing lookup logic could find us the base constructor for child struct, we should eliminate this case by providing the LookupOptions::IgnoreInheritance to lookup, this requires us to create a subcontext on SemanticsVisitor to indicate that we only want to use this option on looking the constructor. - Do not implicit initialize a struct that doesn't have explicit default constructor. Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- tests/cpu-program/gfx-smoke.slang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/cpu-program') diff --git a/tests/cpu-program/gfx-smoke.slang b/tests/cpu-program/gfx-smoke.slang index 41c87ca19..3ed04877e 100644 --- a/tests/cpu-program/gfx-smoke.slang +++ b/tests/cpu-program/gfx-smoke.slang @@ -14,7 +14,7 @@ export __extern_cpp int main() return -1; } - gfx.CommandQueueDesc queueDesc = {}; + gfx.CommandQueueDesc queueDesc = {gfx::QueueType::Graphics}; queueDesc.type = gfx.QueueType.Graphics; Optional queue; device.value.createCommandQueue(&queueDesc, queue); @@ -42,12 +42,12 @@ export __extern_cpp int main() device.value.createProgram2(&programDesc, program, diagBlob); Optional pipeline; - gfx.ComputePipelineStateDesc pipelineDesc = {}; + gfx.ComputePipelineStateDesc pipelineDesc; pipelineDesc.program = NativeRef(program.value); device.value.createComputePipelineState(&pipelineDesc, pipeline); Optional transientHeap; - gfx.TransientResourceHeapDesc transientHeapDesc = {}; + gfx.TransientResourceHeapDesc transientHeapDesc; transientHeapDesc.constantBufferDescriptorCount = 64; transientHeapDesc.constantBufferSize = 1024; transientHeapDesc.srvDescriptorCount = 1024; @@ -67,7 +67,7 @@ export __extern_cpp int main() device.value.createBufferResource(&bufferDesc, nullptr, buffer); Optional bufferView; - gfx.ResourceViewDesc viewDesc = {}; + gfx.ResourceViewDesc viewDesc; viewDesc.type = gfx.ResourceViewType.UnorderedAccess; device.value.createBufferView(buffer.value, none, &viewDesc, bufferView); -- cgit v1.2.3