Skip to content

Commit

Permalink
cuarrays dbg
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Nov 6, 2019
1 parent 84f5d9c commit 236986f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"

[compat]
julia = "1.0.0"
AutoGrad = "1.2.0"
CUDAapi = "1.2.0"
CUDAdrv = "4.0.1"
CUDAnative = "2.5.0"
CuArrays = "1.4.0"
DataStructures = "0.17.5"
FileIO = "1.0.7"
JLD2 = "0.1.3"
NNlib = "0.6.0"
SpecialFunctions = "0.8.0"
TimerOutputs = "0.5.0"
julia = "1.0"
AutoGrad = "1.2"
CUDAapi = "1.0"
CUDAdrv = "3.0, 4.0"
CUDAnative = "2.0"
CuArrays = "1.2"
DataStructures = "0.17"
FileIO = "1.0"
JLD2 = "0.1"
NNlib = "0.6"
SpecialFunctions = "0.8"
TimerOutputs = "0.5"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
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.ptr)) # ver >= 1.3.0
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 236986f

Please sign in to comment.