File tree 1 file changed +5
-1
lines changed 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ using Base: @deprecate_binding
11
11
12
12
using Printf
13
13
14
+ using Memoize
15
+
14
16
15
17
#
16
18
# buffers
@@ -54,6 +56,8 @@ Base.show(io::IO, buf::DeviceBuffer) =
54
56
Base. convert (:: Type{CuPtr{T}} , buf:: DeviceBuffer ) where {T} =
55
57
convert (CuPtr{T}, pointer (buf))
56
58
59
+ @memoize has_stream_ordered () = CUDA. version () >= v " 11.2" && ! haskey (ENV , " CUDA_MEMCHECK" )
60
+
57
61
"""
58
62
Mem.alloc(DeviceBuffer, bytesize::Integer;
59
63
[async=false], [stream::CuStream], [pool::CuMemoryPool])
@@ -65,7 +69,7 @@ for access on the CPU.
65
69
function alloc (:: Type{DeviceBuffer} , bytesize:: Integer ;
66
70
async:: Bool = false , stream:: CuStream = stream (),
67
71
pool:: Union{Nothing,CuMemoryPool} = nothing ,
68
- stream_ordered:: Bool = CUDA . version () >= v " 11.2 " )
72
+ stream_ordered:: Bool = has_stream_ordered () )
69
73
bytesize == 0 && return DeviceBuffer (CU_NULL, 0 )
70
74
71
75
ptr_ref = Ref {CUDA.CUdeviceptr} ()
You can’t perform that action at this time.
0 commit comments