Skip to content

Commit

Permalink
Merge pull request #102 from JuliaGPU/fbot/deps
Browse files Browse the repository at this point in the history
Fix deprecations
  • Loading branch information
maleadt authored Aug 15, 2017
2 parents 622dfa5 + bab6098 commit 4700f5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
10 changes: 3 additions & 7 deletions src/arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if !debugMemory
dev::Int
end
else
@compat type CudaArray{T,N} <: AbstractCudaArray{T,N}
type CudaArray{T,N} <: AbstractCudaArray{T,N}
ptr::CudaPtr{T}
dims::NTuple{N,Int}
dev::Int
Expand All @@ -49,7 +49,7 @@ if !debugMemory
dev::Int
end
else
@compat type CudaPitchedArray{T,N} <: AbstractCudaArray{T,N}
type CudaPitchedArray{T,N} <: AbstractCudaArray{T,N}
ptr::rt.cudaPitchedPtr
dims::NTuple{N,Int}
dev::Int
Expand Down Expand Up @@ -432,11 +432,7 @@ function HostArray{T}(::Type{T}, sz::Dims; flags::Integer=rt.cudaHostAllocDefaul
p = Ptr{Void}[C_NULL]
rt.cudaHostAlloc(p, prod(sz)*sizeof(T), flags)
ptr = p[1]
if VERSION < v"0.5.0-dev+4597"
data = pointer_to_array(unsafe_convert(Ptr{T}, ptr), sz, false)
else
data = unsafe_wrap(Array, unsafe_convert(Ptr{T}, ptr), sz, false)
end
data = unsafe_wrap(Array, unsafe_convert(Ptr{T}, ptr), sz, false)
ha = HostArray(ptr, data)
finalizer(ha, free)
cuda_ptrs[WeakRef(ptr)] = device()
Expand Down
6 changes: 1 addition & 5 deletions test/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ result = devices(dev->capability(dev)[1] >= 2, nmax=1) do devlist
# @test A[2,2] == 3 # asynchronous
device_synchronize()
@test A[2,2] == 7
if VERSION < v"0.5.0-dev+4597"
S = pointer_to_array(pointer(A)+48, (6,2), false) # a "SubArray"
else
S = unsafe_wrap(Array, pointer(A)+48, (6,2), false) # a "SubArray"
end
S = unsafe_wrap(Array, pointer(A)+48, (6,2), false) # a "SubArray"
B = rand(map(Int32, 1:15), 6, 2)
GB = CudaArray(B)
copy!(S, GB)
Expand Down

0 comments on commit 4700f5e

Please sign in to comment.