Skip to content

Commit

Permalink
CuArrays-1.3.0 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Nov 5, 2019
1 parent 55c01f4 commit 596796e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Knet"
uuid = "1902f260-5fb4-5aff-8c31-6271790ab950"
authors = ["Deniz Yuret <[email protected]>"]
version = "1.3.0"
version = "1.3.1"

[deps]
AutoGrad = "6710c13c-97f1-543f-91c5-74e8f7d95b35"
Expand All @@ -26,7 +26,7 @@ TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
julia = "1.0.0"
AutoGrad = "1.1.6"
CUDAapi = "1.2.0"
CUDAdrv = "3.1.0"
CUDAdrv = "3.0, 4.0"
CUDAnative = "2.4.0"
CuArrays = "1.2.1"
DataStructures = "0.17.3"
Expand Down
6 changes: 5 additions & 1 deletion src/cuarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ end
# Testing the CuArrays allocator: set Knet.cuallocator()=true to use this
function KnetPtrCu(len::Int)
c = CuArray{UInt8}(undef, len)
p = convert(Cptr, convert(Int, c.buf.ptr))
if :buf in fieldnames(CuArray)
p = convert(Cptr, convert(Int, c.buf.ptr)) # ver <= 1.2.1
else
p = convert(Cptr, convert(Int, c.ptr)) # ver >= 1.3.0
end
kp = KnetPtr(p, len, gpu(), c)
finalizer(freeKnetPtrCu, kp)
end
Expand Down

0 comments on commit 596796e

Please sign in to comment.