forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support cl_bf16_conversions (KhronosGroup#1406)
OpenCL specification: KhronosGroup/OpenCL-Docs#762 SPIR-V: https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_bfloat16_conversion.asciidoc
- Loading branch information
1 parent
1538cf5
commit 9bdfc3e
Showing
12 changed files
with
468 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ersion/cl_bfloat16_conversions_extension/ConvertAsBFloat16Float_inval_scalar_signature.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: not --crash llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR | ||
|
||
; CHECK-ERROR: OpConvertAsBFloat16Float must be of float and take i16 | ||
|
||
; ModuleID = 'kernel.cl' | ||
source_filename = "kernel.cl" | ||
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-n8:16:32:64" | ||
target triple = "spir" | ||
|
||
; Function Attrs: convergent noinline norecurse nounwind optnone | ||
define dso_local spir_kernel void @f() { | ||
entry: | ||
%call = call spir_func double @_Z31intel_convert_as_bfloat16_floatt(i32 zeroext 0) | ||
ret void | ||
} | ||
|
||
; Function Attrs: convergent | ||
declare spir_func double @_Z31intel_convert_as_bfloat16_floatt(i32 zeroext) | ||
|
||
!opencl.ocl.version = !{!0} | ||
|
||
!0 = !{i32 2, i32 0} |
23 changes: 23 additions & 0 deletions
23
..._conversion/cl_bfloat16_conversions_extension/ConvertAsBFloat16Float_inval_vec_elem_ty.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: not --crash llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR | ||
|
||
; CHECK-ERROR: OpConvertAsBFloat16NFloatN must be of <N x float> and take <N x i16> | ||
|
||
; ModuleID = 'kernel.cl' | ||
source_filename = "kernel.cl" | ||
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-n8:16:32:64" | ||
target triple = "spir" | ||
|
||
; Function Attrs: convergent noinline norecurse nounwind optnone | ||
define dso_local spir_kernel void @f() { | ||
entry: | ||
%call = call spir_func <2 x double> @_Z33intel_convert_as_bfloat162_float2Dv2_t(<2 x i32> zeroinitializer) | ||
ret void | ||
} | ||
|
||
; ; Function Attrs: convergent | ||
declare spir_func <2 x double> @_Z33intel_convert_as_bfloat162_float2Dv2_t(<2 x i32>) | ||
|
||
!opencl.ocl.version = !{!0} | ||
|
||
!0 = !{i32 2, i32 0} |
23 changes: 23 additions & 0 deletions
23
...t16_conversion/cl_bfloat16_conversions_extension/ConvertAsBFloat16Float_inval_vec_size.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: not --crash llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR | ||
|
||
; CHECK-ERROR: ConvertAsBFloat162Float2 must be of <2 x float> and take <2 x i16> | ||
|
||
; ModuleID = 'kernel.cl' | ||
source_filename = "kernel.cl" | ||
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-n8:16:32:64" | ||
target triple = "spir" | ||
|
||
; Function Attrs: convergent noinline norecurse nounwind optnone | ||
define dso_local spir_kernel void @f() { | ||
entry: | ||
%call = call spir_func <8 x float> @_Z33intel_convert_as_bfloat162_float2Dv2_t(<4 x i16> zeroinitializer) | ||
ret void | ||
} | ||
|
||
; Function Attrs: convergent | ||
declare spir_func <8 x float> @_Z33intel_convert_as_bfloat162_float2Dv2_t(<4 x i16>) | ||
|
||
!opencl.ocl.version = !{!0} | ||
|
||
!0 = !{i32 2, i32 0} |
23 changes: 23 additions & 0 deletions
23
...rsion/cl_bfloat16_conversions_extension/ConvertBFloat16AsUshort_inval_scalar_signature.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: not --crash llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR | ||
|
||
; CHECK-ERROR: OpConvertBFloat16AsUShort must be of i16 and take float | ||
|
||
; ModuleID = 'kernel.cl' | ||
source_filename = "kernel.cl" | ||
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-n8:16:32:64" | ||
target triple = "spir" | ||
|
||
; Function Attrs: convergent noinline norecurse nounwind optnone | ||
define dso_local spir_kernel void @f() { | ||
entry: | ||
%call = call spir_func zeroext i16 @_Z32intel_convert_bfloat16_as_ushortf(double 0.000000e+00) | ||
ret void | ||
} | ||
|
||
; Function Attrs: convergent | ||
declare spir_func zeroext i16 @_Z32intel_convert_bfloat16_as_ushortf(double) | ||
|
||
!opencl.ocl.version = !{!0} | ||
|
||
!0 = !{i32 2, i32 0} |
23 changes: 23 additions & 0 deletions
23
...conversion/cl_bfloat16_conversions_extension/ConvertBFloat16AsUshort_inval_vec_elem_ty.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: not --crash llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR | ||
|
||
; CHECK-ERROR: OpConvertBFloat16NAsUShortN must be of <N x i16> and take <N x float> | ||
|
||
; ModuleID = 'kernel.cl' | ||
source_filename = "kernel.cl" | ||
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-n8:16:32:64" | ||
target triple = "spir" | ||
|
||
; Function Attrs: convergent noinline norecurse nounwind optnone | ||
define dso_local spir_kernel void @f() { | ||
entry: | ||
%call = call spir_func <2 x i32> @_Z34intel_convert_bfloat162_as_ushort2Dv2_f(<2 x double> zeroinitializer) | ||
ret void | ||
} | ||
|
||
; Function Attrs: convergent | ||
declare spir_func <2 x i32> @_Z34intel_convert_bfloat162_as_ushort2Dv2_f(<2 x double>) | ||
|
||
!opencl.ocl.version = !{!0} | ||
|
||
!0 = !{i32 2, i32 0} |
23 changes: 23 additions & 0 deletions
23
...16_conversion/cl_bfloat16_conversions_extension/ConvertBFloat16AsUshort_inval_vec_size.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llvm-as %s -o %t.bc | ||
; RUN: not --crash llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR | ||
|
||
; CHECK-ERROR: ConvertBFloat162AsUShort2 must be of <2 x i16> and take <2 x float> | ||
|
||
; ModuleID = 'kernel.cl' | ||
source_filename = "kernel.cl" | ||
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-n8:16:32:64" | ||
target triple = "spir" | ||
|
||
; Function Attrs: convergent noinline norecurse nounwind optnone | ||
define dso_local spir_kernel void @f() { | ||
entry: | ||
%call = call spir_func <8 x i16> @_Z34intel_convert_bfloat162_as_ushort2Dv2_f(<4 x float> zeroinitializer) | ||
ret void | ||
} | ||
|
||
; Function Attrs: convergent | ||
declare spir_func <8 x i16> @_Z34intel_convert_bfloat162_as_ushort2Dv2_f(<4 x float>) | ||
|
||
!opencl.ocl.version = !{!0} | ||
|
||
!0 = !{i32 2, i32 0} |
Oops, something went wrong.