From 46f09653820799fb7ee62fba378266f64983e7f4 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Mon, 10 Jun 2024 20:57:10 -0700 Subject: [PATCH] Bug in logging code --- Project.toml | 2 +- src/LuxDeviceUtils.jl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index cd57505..7d2f4ea 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LuxDeviceUtils" uuid = "34f89e08-e1d5-43b4-8944-0b49ac560553" authors = ["Avik Pal and contributors"] -version = "0.1.21" +version = "0.1.22" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/LuxDeviceUtils.jl b/src/LuxDeviceUtils.jl index fb2a20a..6e8390b 100644 --- a/src/LuxDeviceUtils.jl +++ b/src/LuxDeviceUtils.jl @@ -62,10 +62,11 @@ struct LuxMetalDevice <: AbstractLuxGPUDevice end struct LuxoneAPIDevice <: AbstractLuxGPUDevice end for dev in (LuxCPUDevice, LuxMetalDevice, LuxoneAPIDevice) + msg = "`device_id` is not applicable for `$dev`." @eval begin _with_device(::Type{$dev}, ::Nothing) = $dev() function _with_device(::Type{$dev}, device_id) - @warn "`device_id` is not applicable for `$dev`." maxlog=1 + @warn $(msg) maxlog=1 return $dev() end end