Skip to content
This repository was archived by the owner on Sep 27, 2021. It is now read-only.

Commit 534f164

Browse files
authored
Merge pull request #4 from JuliaGPU/sd/bool
Sd/bool
2 parents 52be350 + 89bc5a1 commit 534f164

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GPUArrays 0.2.0
55
StaticArrays
66
ColorTypes
77

8-
Transpiler 0.4.1
8+
Transpiler 0.4.2
99
Sugar 0.4.1
1010
Matcha 0.1.1
1111

test/runtests.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@ for dev in CLArrays.devices()
1414
@test Array(y) == muladd(a, 2f0, abs.(a))
1515
###########
1616
# issue #20
17-
1817
against_base(a-> abs.(a), CLArray{Float32}, (10, 10))
18+
19+
#### bools in kernel:
20+
end
21+
@testset "bools" begin
22+
A, B = rand(Bool, 10), rand(Bool, 10)
23+
Ag, Bg = CLArray(A), CLArray(B)
24+
res = A .& B
25+
resg = Ag .& Bg
26+
@test res == Array(resg)
27+
# this version needs to have a fix in GPUArrays, since it uses T.(array)
28+
# in copy to convert to array type, but that actually convert Array{Bool} to BitArray
29+
# against_base((a, b)-> a .& b, CLArray{Bool}, (10,), (10,))
1930
end
2031
end
2132
end
2233

23-
2434
# The above is equal to:
2535
# Typ = CuArray
2636
# GPUArrays.allowslow(false)

0 commit comments

Comments
 (0)