MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / TEST_F

Function TEST_F

test/link/function_variants.cpp:25–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using FunctionVariants = spvtest::LinkerTest;
24
25TEST_F(FunctionVariants, Dot4) {
26 constexpr const char* const dot4_fp32 = R"(
27 OpCapability Kernel
28 OpCapability Addresses
29 OpCapability Int8
30 OpCapability Int64
31 OpCapability Linkage
32 %1 = OpExtInstImport "OpenCL.std"
33 OpMemoryModel Physical64 OpenCL
34 OpEntryPoint Kernel %2 "dot4" %3
35 OpExecutionMode %2 ContractionOff
36 OpSource OpenCL_C 102000
37 OpName %2 "dot4"
38 OpName %3 "__spirv_BuiltInGlobalInvocationId"
39 OpName %4 "entry"
40 %5 = OpTypeFloat 32
41 %6 = OpTypePointer CrossWorkgroup %5
42 %7 = OpTypeInt 8 0
43 %8 = OpTypePointer CrossWorkgroup %7
44 %9 = OpTypeVoid
45 %10 = OpTypeFunction %9 %6 %6 %8
46 %11 = OpTypeInt 64 0
47 %12 = OpTypeInt 32 0
48 %13 = OpTypeVector %11 3
49 %14 = OpTypePointer Input %13
50 %15 = OpTypeVector %5 4
51 %16 = OpConstant %11 30
52 %17 = OpConstant %11 32
53 %18 = OpConstant %12 2
54 %3 = OpVariable %14 Input
55 %2 = OpFunction %9 None %10
56 %19 = OpFunctionParameter %6
57 %20 = OpFunctionParameter %6
58 %21 = OpFunctionParameter %8
59 %4 = OpLabel
60 %22 = OpLoad %13 %3 Aligned 1
61 %23 = OpCompositeExtract %11 %22 0
62 %24 = OpUConvert %12 %23
63 %25 = OpShiftLeftLogical %12 %24 %18
64 %26 = OpSConvert %11 %25
65 %27 = OpExtInst %15 %1 vloadn %26 %19 4
66 %28 = OpExtInst %15 %1 vloadn %26 %20 4
67 %29 = OpDot %5 %27 %28
68 %30 = OpShiftLeftLogical %11 %23 %17
69 %31 = OpShiftRightArithmetic %11 %30 %16
70 %32 = OpInBoundsPtrAccessChain %8 %21 %31
71 %33 = OpBitcast %6 %32
72 OpStore %33 %29 Aligned 4
73 OpReturn
74 OpFunctionEnd
75 )";
76
77 constexpr const char* const dot4_fp16 = R"(
78 OpCapability Kernel
79 OpCapability Addresses
80 OpCapability Int8
81 OpCapability Int64
82 OpCapability Float16

Callers

nothing calls this directly

Calls 2

DisassembleFunction · 0.85
ValidateFunction · 0.50

Tested by

no test coverage detected