Skip to content

Commit a4d916f

Browse files
committed
Add VK_Workgroup_Zoo unit tests for subgroup Scan and Prefix ops
subgroupBallotExclusiveBitCount() subgroupExclusiveAdd() subgroupExclusiveMul()
1 parent 5be762a commit a4d916f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

util/test/demos/vk/vk_subgroup_zoo.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,19 @@ void main()
324324
data.w = subgroupShuffle(data.x, 2+id%3);
325325
}
326326
}
327+
else if(IsTest(12))
328+
{
329+
// Scan and Prefix functions : unit tests
330+
if (id >= 2 && id <= 20)
331+
{
332+
uvec4 bits = subgroupBallot(id > 4);
333+
data.x = subgroupBallotExclusiveBitCount(bits);
334+
bits = subgroupBallot(id > 10);
335+
data.y = subgroupBallotExclusiveBitCount(bits);
336+
data.z = subgroupExclusiveAdd(data.x);
337+
data.w = subgroupExclusiveMul(1 + data.y);
338+
}
339+
}
327340
SetOuput(data);
328341
}
329342

0 commit comments

Comments
 (0)