//TEST:SIMPLE(filecheck=CHECK): -target cuda -entry runPointEstimator // Test for issue #7905: CUDA Backend failure due to type mismatch // This test ensures that struct types in ParameterBlock operands are properly // legalized and don't create type mismatches in generated CUDA code. #define ZOMBIE_PROBLEM_DIMENSION 3 public interface IExample { // computes the distance to the boundary float compute(vector x); }; public struct Query where Example : IExample { // private AbsorbingBoundaryGeometricQueries absorbingBoundaryGeometricQueries; private Example query; private uint hasNonEmptyAbsorbingBoundary; public float compute(vector x) { return query.compute(x); } }; public struct EmptyExample : IExample { // computes the distance to the boundary public float compute(vector x) { internal static const float FLT_MAX = 3.402823466e+38F; return FLT_MAX; } }; typedef EmptyExample ExampleQuery; typedef Query QueryType; uniform ParameterBlock gQuery; uniform RWStructuredBuffer gInput; uniform RWStructuredBuffer gOutput; [shader("compute")] [numthreads(256, 1, 1)] void runPointEstimator(uint3 threadId: SV_DispatchThreadID, uniform uint n) { const uint idx = threadId.x; if (idx >= n) { return; } float res = gQuery.compute(gInput[idx]); gOutput[idx] = res; } // CHECK-NOT: Query_1