Git Product home page Git Product logo

Comments (1)

maleadt avatar maleadt commented on July 19, 2024

Please try

diff --git a/src/discovery.jl b/src/discovery.jl
index 7ece7d6..2fa3af4 100644
--- a/src/discovery.jl
+++ b/src/discovery.jl
@@ -349,25 +350,24 @@ function find_host_compiler(toolkit_version=nothing)
         end
 
         # check compiler compatibility
+        msvc_path, msvc_ver = nothing, nothing
         if toolkit_version !== nothing
-            found_compatible_compiler = false
-            for ver in sort(collect(keys(msvc_list)), rev=true) # search the higest version first
+            for ver in sort(collect(keys(msvc_list)), rev=true) # search the highest version first
                 if parse(Int, string(ver.major,ver.minor)) in cuda_msvc_db[toolkit_version]
-                    host_compiler, host_version = msvc_list[ver], ver
-                    found_compatible_compiler = true
+                    msvc_path, msvc_ver = msvc_list[ver], ver
                     break
                 end
             end
-            if !found_compatible_compiler
-                error("Visual Studio C++ compiler $msvc_ver is not compatible with CUDA $toolkit_version")
+            if msvc_ver == nothing
+                error("None of the available Visual Studio C++ compilers ($(join(keys(msvc_list), ", "))) is compatible with CUDA $toolkit_version")
             end
-            return host_compiler, host_version
         else
-            # take the first found host, which will be the higest version found
+            # take the first found host, which will be the highest version found
             host_pair = first(sort(collect(msvc_list), by=x->x[1], rev=true))
-            host_compiler, host_version = last(host_pair), first(host_pair)
-            return host_compiler, host_version
+            msvc_path, msvc_ver = last(host_pair), first(host_pair)
         end

Quite annoying to program a dynamic language without being able to run the code.

from cudaapi.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.