From 03a4e3d4020d6594c15455b5e2aee9a36e5821b5 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Thu, 8 Aug 2024 14:02:22 +0200 Subject: [PATCH] try integrate BFloat16 --- Project.toml | 1 + src/LLVM_intrinsics.jl | 3 ++- src/SIMD.jl | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index ef2ebd6..6669670 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ authors = ["Erik Schnetter ", "Kristoffer Carlsson "half", Float32 => "float", Float64 => "double", + BFloat16 => "bfloat", ) # Add the Ptr translations # Julia <=1.11 (LLVM <=16) passes `Ptr{T}` as `i64`, Julia >=1.12 (LLVM >=17) passes them as `T*`. diff --git a/src/SIMD.jl b/src/SIMD.jl index 1bf0a17..9cb5fb3 100644 --- a/src/SIMD.jl +++ b/src/SIMD.jl @@ -2,6 +2,8 @@ module SIMD using Base: @propagate_inbounds +using BFloat16s: BFloat16 + export Vec, vload, vloada, vloadnt, vloadx, vstore, vstorea, vstorent, vstorec, vgather, vgathera, vscatter, vscattera, shufflevector, vifelse, valloc, VecRange @@ -14,7 +16,7 @@ const BIntTypes = Union{IntTypes, Bool} const UIntTypes = Union{UInt8, UInt16, UInt32, UInt64} const IntegerTypes = Union{IntTypes, UIntTypes} const BIntegerTypes = Union{IntegerTypes, Bool} -const FloatingTypes = Union{Float16, Float32, Float64} +const FloatingTypes = Union{Float16, Float32, Float64, BFloat16} const ScalarTypes = Union{IntegerTypes, FloatingTypes} const VecTypes = Union{ScalarTypes, Ptr, Bool} include("LLVM_intrinsics.jl")