Skip to content

Commit

Permalink
Fixes for Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Aug 29, 2023
1 parent 4dcc147 commit 2cb9a1d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ function __init__()
end

# if we're not running under an external profiler, let CUPTI handle NVTX events
if !NVTX.isactive()
# XXX: JuliaGPU/NVTX.jl#37
if !NVTX.isactive() && !Sys.iswindows()
ENV["NVTX_INJECTION64_PATH"] = CUDA_Runtime.libcupti
NVTX.activate()
end
Expand Down
4 changes: 4 additions & 0 deletions test/core/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ let
@test occursin("cuCtxSynchronize", str)
end

if !Sys.iswindows()

# NVTX markers
let
str = sprint() do io
Expand All @@ -103,6 +105,8 @@ let
@test occursin("a range", str)
end

end

end
end

Expand Down
11 changes: 7 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ using Distributed
using Dates
import REPL
using Printf: @sprintf
using Base.Filesystem: path_separator

# parse some command-line arguments
function extract_flag!(args, flag, default=nothing; typ=typeof(default))
Expand Down Expand Up @@ -53,12 +54,12 @@ end
include("setup.jl") # make sure everything is precompiled

# choose tests
const tests = ["core/initialization"] # needs to run first
const tests = ["core$(path_separator)initialization"] # needs to run first
const test_runners = Dict()
## GPUArrays testsuite
for name in keys(TestSuite.tests)
push!(tests, "gpuarrays$(Base.Filesystem.path_separator)$name")
test_runners["gpuarrays$(Base.Filesystem.path_separator)$name"] = ()->TestSuite.tests[name](CuArray)
push!(tests, "gpuarrays$(path_separator)$name")
test_runners["gpuarrays$(path_separator)$name"] = ()->TestSuite.tests[name](CuArray)
end
## files in the test folder
for (rootpath, dirs, files) in walkdir(@__DIR__)
Expand Down Expand Up @@ -310,7 +311,9 @@ try

# tests that muck with the context should not be timed with CUDA events,
# since they won't be valid at the end of the test anymore.
time_source = in(test, ["core/initialization", "base/examples", "base/exceptions"]) ? :julia : :cuda
time_source = in(test, ["core$(path_separator)initialization",
"base$(path_separator)examples",
"base$(path_separator)exceptions"]) ? :julia : :cuda

# run the test
running_tests[test] = now()
Expand Down

0 comments on commit 2cb9a1d

Please sign in to comment.