From 26bb0dbe4a24e1e6b0cfcdd827951afd22b33bc7 Mon Sep 17 00:00:00 2001 From: Anton Smirnov Date: Sun, 19 Nov 2023 13:50:21 +0200 Subject: [PATCH] Account for Windows --- src/discovery/discovery.jl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/discovery/discovery.jl b/src/discovery/discovery.jl index 1d54873a8..892a8ae57 100644 --- a/src/discovery/discovery.jl +++ b/src/discovery/discovery.jl @@ -131,13 +131,17 @@ function __init__() artifact_field=:libhsa_runtime64, ext="so.1") # HIP. - global libhip = get_library("libamdhip64"; - rocm_paths, artifact_library=:HIP_jll) - # Detect HIP version, which will influence what device libraries to use. - hip_version = Base.thisminor(_hip_runtime_version()) + global libhip = get_library("libamdhip64"; rocm_paths, artifact_library=:HIP_jll) + + from_artifact = if isempty(libhip) + use_artifacts() + else + # Detect HIP version, which will influence what device libraries to use. + hip_version = Base.thisminor(_hip_runtime_version()) + hip_version > v"5.4" ? true : use_artifacts() + end # If ROCm 5.5+ - use artifact device libraries. - global libdevice_libs = get_device_libs( - hip_version > v"5.4" ? true : use_artifacts()) + global libdevice_libs = get_device_libs(from_artifact) # HIP-based libraries. global librocblas = get_library("librocblas";