Skip to content

Commit 40cceec

Browse files
sarnexvmustya
authored andcommitted
[Backport to 16] Support the spirv.BufferSurfaceINTEL target extension type (KhronosGroup#1995)
This target extension type is created here: https://github.com/intel/vc-intrinsics/blob/master/GenXIntrinsics/lib/GenXIntrinsics/GenXSPIRVWriterAdaptor.cpp#L245 As with other target extension types, reverse translation is not yet supported. Signed-off-by: Sarnie, Nick <[email protected]> Co-authored-by: Victor Mustya <[email protected]> (cherry picked from commit 60746d5) (cherry picked from commit ac6aa17dc92885d9ecbe65fb7d0fb6f75ace2b9e)
1 parent 1d8c9b1 commit 40cceec

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/SPIRV/SPIRVInternal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ const static char PipeStorage[] = "PipeStorage";
318318
const static char ConstantPipeStorage[] = "ConstantPipeStorage";
319319
const static char VmeImageINTEL[] = "VmeImageINTEL";
320320
const static char JointMatrixINTEL[] = "JointMatrixINTEL";
321+
const static char BufferSurfaceINTEL[] = "BufferSurfaceINTEL";
321322
const static char CooperativeMatrixKHR[] = "CooperativeMatrixKHR";
322323
} // namespace kSPIRVTypeName
323324

@@ -976,6 +977,7 @@ template <> inline void SPIRVMap<std::string, Op, SPIRVOpaqueType>::init() {
976977
_SPIRV_OP(AvcRefResultINTEL)
977978
_SPIRV_OP(AvcSicResultINTEL)
978979
_SPIRV_OP(VmeImageINTEL)
980+
_SPIRV_OP(BufferSurfaceINTEL)
979981
_SPIRV_OP(CooperativeMatrixKHR)
980982
#undef _SPIRV_OP
981983
add("JointMatrixINTEL", internal::OpTypeJointMatrixINTEL);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
; Check translation of the buffer surface target extension type
2+
;
3+
; RUN: llvm-as %s -o %t.bc
4+
; RUN: llvm-spirv -spirv-ext=+SPV_INTEL_vector_compute %t.bc -spirv-text -o %t.spv.txt
5+
; RUN: FileCheck < %t.spv.txt %s --check-prefix=CHECK-SPIRV
6+
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
7+
target triple = "spir-unknown-unknown"
8+
9+
; CHECK-SPIRV: Capability VectorComputeINTEL
10+
; CHECK-SPIRV: Extension "SPV_INTEL_vector_compute"
11+
; CHECK-SPIRV: Name [[#FuncName:]] "foo"
12+
; CHECK-SPIRV: Name [[#ParamName:]] "a"
13+
; CHECK-SPIRV: TypeVoid [[#VoidT:]]
14+
; CHECK-SPIRV: TypeBufferSurfaceINTEL [[#BufferID:]]
15+
; CHECK-SPIRV: Function [[#VoidT]] [[#FuncID:]]
16+
; CHECK-SPIRV-NEXT: FunctionParameter [[#BufferID]] [[#ParamName]]
17+
18+
define spir_kernel void @foo(target("spirv.BufferSurfaceINTEL", 0) %a) #0 {
19+
entry:
20+
ret void
21+
}
22+
23+
attributes #0 = { noinline norecurse nounwind readnone "VCFunction"}

0 commit comments

Comments
 (0)