Skip to content

Commit

Permalink
Debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Oct 10, 2023
1 parent ca97442 commit 07a1dec
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.7'
- '1.8'
- '1.9'
- '1.10.0-beta3'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
Expand Down
9 changes: 8 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ version = "0.4.2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
julia = "1.6"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "InteractiveUtils", "Pkg"]
28 changes: 22 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Test, BFloat16s, Printf, Random
using Test, BFloat16s, Printf, Random, InteractiveUtils

@info "Testing BFloat16s" BFloat16s.llvm_storage BFloat16s.llvm_arithmetic

Expand Down Expand Up @@ -30,11 +30,27 @@ end
end

@testset "abi" begin
f() = BFloat16(1)
@test f() == BFloat16(1)

g(x) = x+BFloat16(1)
@test g(BFloat16(2)) == BFloat16(3)
f() = BFloat16(1f0)
@test f() == BFloat16(1f0)

script = """
using Pkg, BFloat16s
Pkg.activate(; temp=true)
Pkg.add(name="LLVM", rev="tb/bfloat")
using LLVM
ctx = Context()
typ = LLVM.BFloatType()
display(typ)
val = ConstantFP(typ, BFloat16(1.0))
display(val)
"""
run(`$(Base.julia_cmd()) --project=$(Base.active_project()) -e $script`)

@code_llvm dump_module=true f()

g(x) = x+BFloat16(1f0)
@test g(BFloat16(2f0)) == BFloat16(3f0)
end

@testset "functions" begin
Expand Down

0 comments on commit 07a1dec

Please sign in to comment.