From 236986f6e30ec5f699d587b1a540083dbb25c0fe Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 6 Nov 2019 12:58:17 +0000 Subject: [PATCH] cuarrays dbg --- Project.toml | 24 ++++++++++++------------ src/cuarray.jl | 6 +++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Project.toml b/Project.toml index 96327055c..e9404ab11 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/cuarray.jl b/src/cuarray.jl index 18246c6c9..987b9f370 100644 --- a/src/cuarray.jl +++ b/src/cuarray.jl @@ -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