Skip to content

Commit

Permalink
Fixes for Windows. (#2065)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Aug 30, 2023
1 parent e4eecb7 commit 0cb5659
Show file tree
Hide file tree
Showing 3 changed files with 14 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
5 changes: 5 additions & 0 deletions test/core/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ let
@test occursin("cuCtxSynchronize", str)
end

# JuliaGPU/NVTX.jl#37
if !Sys.iswindows()

# NVTX markers
let
str = sprint() do io
Expand All @@ -103,6 +106,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 0cb5659

Please sign in to comment.