Skip to content

Commit b014e8d

Browse files
maleadtchristiangnrd
authored andcommitted
Simplify logic to work around hang.
1 parent 3c1e9e8 commit b014e8d

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/compiler/execution.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,13 @@ end
277277
throw(ArgumentError("Number of threads in group ($(threads.width * threads.height * threads.depth)) should not exceed $(kernel.pipeline.maxTotalThreadsPerThreadgroup)"))
278278

279279
cmdbuf = if kernel.loggingEnabled
280+
# TODO: make this a dynamic error, i.e., from the kernel (JuliaGPU/Metal.jl#433)
280281
if macos_version() < v"15"
281-
@error "Logging is only supported on macOS 15 or higher"
282+
error("Logging is only supported on macOS 15 or higher")
282283
end
283284

284285
if MTLCaptureManager().isCapturing
285-
@error "Logging is not supported while GPU frame capturing"
286+
error("Logging is not supported while GPU frame capturing")
286287
end
287288

288289
log_state_descriptor = MTLLogStateDescriptor()

src/device/intrinsics/output.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ macro mtlprintf(fmt::String, args...)
4848
fmt_val = Val(Symbol(fmt))
4949

5050
quote
51-
if metal_version() < sv"3.2"
52-
@print_and_throw "@mtlprintf requires Metal 3.2 (macOS 15) or higher"
53-
else
54-
_mtlprintf($fmt_val, $(map(arg -> :(promote_c_argument($arg)), esc.(args))...))
55-
end
51+
_mtlprintf($fmt_val, $(map(arg -> :(promote_c_argument($arg)), esc.(args))...))
5652
end
5753
end
5854

test/output.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ if Metal.macos_version() < v"15"
44

55
@warn "Skipping output tests in macOS 14 and below"
66

7+
function kernel()
8+
@mtlprint("Hello, World\n")
9+
return
10+
end
11+
@test_throws "Logging is only supported on macOS 15 or higher" @metal kernel()
12+
713
else
814

915
@testset "formatted output" begin

0 commit comments

Comments
 (0)