Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Commit 8259597

Browse files
committed
Initialization micro optimizations.
1 parent 95a35a7 commit 8259597

File tree

9 files changed

+11
-10
lines changed

9 files changed

+11
-10
lines changed

src/CuArrays.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function functional(show_reason::Bool=false)
3535
if configured[] === nothing
3636
_functional(show_reason)
3737
end
38-
configured[]
38+
configured[]::Bool
3939
end
4040

4141
const configure_lock = ReentrantLock()

src/blas/error.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ end
4848
end
4949

5050
function initialize_api()
51-
# make sure the calling thread has an active context
52-
CUDAnative.context()
51+
# make sure the callin
52+
g thread has an active context
53+
CUDAnative.initialize_context()
5354
end
5455

5556
macro check(ex)

src/dnn/error.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end
2121

2222
function initialize_api()
2323
# make sure the calling thread has an active context
24-
CUDAnative.context()
24+
CUDAnative.initialize_context()
2525
end
2626

2727
macro check(ex)

src/fft/error.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ end
6363

6464
function initialize_api()
6565
# make sure the calling thread has an active context
66-
CUDAnative.context()
66+
CUDAnative.initialize_context()
6767
end
6868

6969
macro check(ex)

src/memory.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ synchronized right before and after executing `ex` to exclude any external effec
280280
macro time(ex)
281281
quote
282282
# @time might surround an application, so be sure to initialize CUDA before that
283-
CUDAnative.context()
283+
CUDAnative.initialize_context()
284284

285285
# coarse synchronization to exclude effects from previously-executed code
286286
CUDAdrv.synchronize()

src/rand/error.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end
5555

5656
function initialize_api()
5757
# make sure the calling thread has an active context
58-
CUDAnative.context()
58+
CUDAnative.initialize_context()
5959
end
6060

6161
macro check(ex)

src/solver/error.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ end
4545

4646
function initialize_api()
4747
# make sure the calling thread has an active context
48-
CUDAnative.context()
48+
CUDAnative.initialize_context()
4949
end
5050

5151
macro check(ex)

src/sparse/error.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ end
2323

2424
function initialize_api()
2525
# make sure the calling thread has an active context
26-
CUDAnative.context()
26+
CUDAnative.initialize_context()
2727
end
2828

2929
macro check(ex)

src/tensor/error.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ end
5757

5858
function initialize_api()
5959
# make sure the calling thread has an active context
60-
CUDAnative.context()
60+
CUDAnative.initialize_context()
6161
end
6262

6363
macro check(ex)

0 commit comments

Comments
 (0)