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

Commit

Permalink
Merge pull request #4 from JuliaGPU/sd/bool
Browse files Browse the repository at this point in the history
Sd/bool
  • Loading branch information
SimonDanisch authored Oct 2, 2017
2 parents 52be350 + 89bc5a1 commit 534f164
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GPUArrays 0.2.0
StaticArrays
ColorTypes

Transpiler 0.4.1
Transpiler 0.4.2
Sugar 0.4.1
Matcha 0.1.1

Expand Down
14 changes: 12 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ for dev in CLArrays.devices()
@test Array(y) == muladd(a, 2f0, abs.(a))
###########
# issue #20

against_base(a-> abs.(a), CLArray{Float32}, (10, 10))

#### bools in kernel:
end
@testset "bools" begin
A, B = rand(Bool, 10), rand(Bool, 10)
Ag, Bg = CLArray(A), CLArray(B)
res = A .& B
resg = Ag .& Bg
@test res == Array(resg)
# this version needs to have a fix in GPUArrays, since it uses T.(array)
# in copy to convert to array type, but that actually convert Array{Bool} to BitArray
# against_base((a, b)-> a .& b, CLArray{Bool}, (10,), (10,))
end
end
end


# The above is equal to:
# Typ = CuArray
# GPUArrays.allowslow(false)
Expand Down

0 comments on commit 534f164

Please sign in to comment.