Skip to content

Commit 84d421a

Browse files
Fix code so that tests about JET pass
1 parent 90ca6b1 commit 84d421a

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

Project.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,30 @@ MLDataDevices = "7e8f7934-dd98-4c1a-8fe8-92b47a384d40"
99
Term = "22787eb5-b846-44ae-b979-8e399b8463ab"
1010
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
1111

12-
[weakdeps]
13-
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
14-
1512
[extensions]
1613
TerminalSystemMonitorCUDAExt = "CUDA"
1714

15+
[weakdeps]
16+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
17+
1818
[compat]
1919
Aqua = "0.8.9"
20+
CUDA = "5.5.2"
2021
Dates = "1"
2122
JET = "0.9.12"
2223
MLDataDevices = "1.5.3"
2324
ReTestItems = "1.29.0"
2425
Term = "2.0.6"
25-
Test = "1.11.0"
26+
Test = "1"
2627
UnicodePlots = "3.7.0"
2728
julia = "1.10"
2829

2930
[extras]
3031
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
32+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3133
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
3234
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
3335
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
34-
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3536

3637
[targets]
3738
test = ["Aqua", "JET", "ReTestItems", "Test", "CUDA"]

src/TerminalSystemMonitor.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ module TerminalSystemMonitor
33
using Dates: Dates, Day, DateTime, Second
44
using UnicodePlots
55
import Term # this is required by UnicodePlots.panel
6-
using MLDataDevices: MLDataDevices
6+
using MLDataDevices: MLDataDevices, CUDADevice
77

8-
function plot_gpu_utilization_rates end
9-
function plot_gpu_memory_utilization end
8+
# Define dummy method to avoid getting errors on testing using JET.jl
9+
function plot_gpu_utilization_rates(::Type{CUDADevice}, dummyargs=nothing)::Vector{Any}
10+
Any[]
11+
end
12+
13+
# Define dummy method to avoid getting errors on testing using JET.jl
14+
function plot_gpu_memory_utilization(::Type{CUDADevice}, dummyargs=nothing)::Vector{Any}
15+
Any[]
16+
end
1017

1118
idle_time(info::Sys.CPUinfo) = Int64(info.cpu_times!idle)
1219

@@ -144,8 +151,8 @@ function main(dummyargs...)
144151
getproperty(getproperty(Main, :CUDA), :functional)()
145152
cudaplts = []
146153
n = max(1, cols ÷ 50)
147-
plts1::Vector{Any} = plot_gpu_utilization_rates(MLDataDevices.CUDADevice)
148-
plts2::Vector{Any} = plot_gpu_memory_utilization(MLDataDevices.CUDADevice)
154+
plts1 = plot_gpu_utilization_rates(MLDataDevices.CUDADevice)::Vector{Any}
155+
plts2 = plot_gpu_memory_utilization(MLDataDevices.CUDADevice)::Vector{Any}
149156
for i in eachindex(plts1, plts2)
150157
push!(cudaplts, plts1[i])
151158
push!(cudaplts, plts2[i])

test/jet_tests.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
#=@testitem "JET" begin
1+
@testitem "JET" begin
22
using Test
33
using JET
4+
using CUDA
45
using TerminalSystemMonitor
56

67
@testset "JET" begin
7-
if VERSION ≥ v"1.10"
8-
JET.test_package(TerminalSystemMonitor; target_defined_modules=true)
9-
end
8+
JET.test_package(TerminalSystemMonitor; target_defined_modules = true)
109
end
1110
end
12-
=#

0 commit comments

Comments
 (0)