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 #3 from JuliaGPU/sd/bool
Browse files Browse the repository at this point in the history
add shorthands
  • Loading branch information
SimonDanisch authored Oct 2, 2017
2 parents c89afec + 72c2000 commit 52be350
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ size(x::CLArray) = Int.(x.size)
pointer(x::CLArray) = x.ptr
context(p::CLArray) = context(pointer(p))

# Avoid conflict with OpenCL.cl
module Shorthands
using ..CLArrays
cl(x) = x
cl(x::CLArrays.CLArray) = x
cl(xs::AbstractArray) = isbits(xs) ? xs : CLArrays.CLArray(xs)
end

function (::Type{CLArray{T, N}})(size::NTuple{N, Integer}, ctx = global_context()) where {T, N}
# element type has different padding from cl type in julia
# for fixedsize arrays we use vload/vstore, so we can use it packed
Expand Down

0 comments on commit 52be350

Please sign in to comment.