cuda 0.7.5.1 → 0.7.5.2
raw patch · 4 files changed
+50/−17 lines, 4 filessetup-changed
Files
- CHANGELOG.markdown +14/−0
- Setup.hs +20/−13
- cbits/init.c +2/−0
- cuda.cabal +14/−4
CHANGELOG.markdown view
@@ -1,3 +1,17 @@+0.7.5.2++ * Bug fixes: #43, #45, #47++0.7.5.1++ * Re-enable support for Cabal-1.22++ * Bug fixes: #40, #44++0.7.5.0++ * Add support for CUDA-7.5+ 0.7.1.0 * mallocHostForeignPtr
Setup.hs view
@@ -96,12 +96,13 @@ postConfHook :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () postConfHook args flags pkg_descr lbi = do let- verbosity = fromFlag (configVerbosity flags)+ verbosity = fromFlagOrDefault normal (configVerbosity flags)+ profile = fromFlagOrDefault False (configProfLib flags) currentPlatform = hostPlatform lbi compilerId_ = compilerId (compiler lbi) -- noExtraFlags args- generateAndStoreBuildInfo verbosity currentPlatform compilerId_ generatedBuildInfoFilePath+ generateAndStoreBuildInfo verbosity profile currentPlatform compilerId_ generatedBuildInfoFilePath validateLinker verbosity currentPlatform $ withPrograms lbi -- actualBuildInfoToUse <- getHookedBuildInfo verbosity@@ -112,8 +113,8 @@ -- Generates build info with flags needed for CUDA Toolkit to be properly -- visible to underlying build tools. ---libraryBuildInfo :: FilePath -> Platform -> Version -> IO HookedBuildInfo-libraryBuildInfo installPath platform@(Platform arch os) ghcVersion = do+libraryBuildInfo :: Bool -> FilePath -> Platform -> Version -> IO HookedBuildInfo+libraryBuildInfo profile installPath platform@(Platform arch os) ghcVersion = do let libraryPaths = [cudaLibraryPath platform installPath] includePaths = [cudaIncludePath platform installPath]@@ -124,7 +125,7 @@ ldOptions' = map ("-L"++) libraryPaths ghcOptions = map ("-optc"++) ccOptions' ++ map ("-optl"++) ldOptions'- ++ if os /= Windows+ ++ if os /= Windows && not profile then map ("-optl-Wl,-rpath,"++) extraLibDirs' else [] extraLibs' = cudaLibraries platform@@ -174,8 +175,8 @@ where libpath = case (os, arch) of- (Windows, I386) -> "Win32"- (Windows, X86_64) -> "x64"+ (Windows, I386) -> "lib/Win32"+ (Windows, X86_64) -> "lib/x64" (OSX, _) -> "lib" -- MacOS does not distinguish 32- vs. 64-bit paths (_, X86_64) -> "lib64" -- treat all others similarly _ -> "lib"@@ -362,10 +363,10 @@ -- Runs CUDA detection procedure and stores .buildinfo to a file. ---generateAndStoreBuildInfo :: Verbosity -> Platform -> CompilerId -> FilePath -> IO ()-generateAndStoreBuildInfo verbosity platform (CompilerId _ghcFlavor ghcVersion) path = do+generateAndStoreBuildInfo :: Verbosity -> Bool -> Platform -> CompilerId -> FilePath -> IO ()+generateAndStoreBuildInfo verbosity profile platform (CompilerId _ghcFlavor ghcVersion) path = do installPath <- findCUDAInstallPath verbosity platform- hbi <- libraryBuildInfo installPath platform ghcVersion+ hbi <- libraryBuildInfo profile installPath platform ghcVersion storeHookedBuildInfo verbosity path hbi storeHookedBuildInfo :: Verbosity -> FilePath -> HookedBuildInfo -> IO ()@@ -379,6 +380,7 @@ -- 1. CUDA_PATH environment variable -- 2. Looking for `nvcc` in `PATH` -- 3. Checking /usr/local/cuda+-- 4. CUDA_PATH_Vx_y environment variable, for recent CUDA toolkit versions x.y -- -- In case of failure, calls die with the pretty long message from below. --@@ -458,9 +460,14 @@ -- candidateCUDAInstallPaths :: Verbosity -> Platform -> [(IO FilePath, String)] candidateCUDAInstallPaths verbosity platform =- [ (getEnv "CUDA_PATH", "environment variable CUDA_PATH")- , (findInPath, "nvcc compiler executable in PATH")- , (return defaultPath, printf "default install location (%s)" defaultPath)+ [ (getEnv "CUDA_PATH", "environment variable CUDA_PATH")+ , (findInPath, "nvcc compiler executable in PATH")+ , (return defaultPath, printf "default install location (%s)" defaultPath)+ , (getEnv "CUDA_PATH_V8_0", "environment variable CUDA_PATH_V8_0")+ , (getEnv "CUDA_PATH_V7_5", "environment variable CUDA_PATH_V7_5")+ , (getEnv "CUDA_PATH_V7_0", "environment variable CUDA_PATH_V7_0")+ , (getEnv "CUDA_PATH_V6_5", "environment variable CUDA_PATH_V6_5")+ , (getEnv "CUDA_PATH_V6_0", "environment variable CUDA_PATH_V6_0") ] where findInPath :: IO FilePath
cbits/init.c view
@@ -34,6 +34,7 @@ * * See: https://github.com/tmcdonell/cuda/issues/39 */+#ifdef CUDA_PRELOAD __attribute__((constructor)) void preinitialise_cuda() { CUresult status = cuInit (0);@@ -49,4 +50,5 @@ #endif } }+#endif
cuda.cabal view
@@ -1,5 +1,5 @@ Name: cuda-Version: 0.7.5.1+Version: 0.7.5.2 Synopsis: FFI binding to the CUDA interface for programming NVIDIA GPUs Description: The CUDA library provides a direct, general purpose C-like SPMD programming@@ -10,9 +10,14 @@ . <http://developer.nvidia.com/cuda-downloads> .- The setup script will look for your CUDA installation in the standard- places, and if the nvcc compiler is found in your PATH, relative to that.+ The setup script will look for your CUDA installation by checking, in the+ following order: .+ 1. The @CUDA_PATH@ environment variable+ 2. Searching for @nvcc@ on the @PATH@+ 3. Checking at @\/usr\/local\/cuda@+ 4. @CUDA_PATH_Vx_y@ environment variable, for recent CUDA toolkit versions x.y+ . This library provides bindings to both the CUDA Driver and Runtime APIs. To get started, see one of: .@@ -39,6 +44,8 @@ . * <https://ghc.haskell.org/trac/ghc/ticket/12573> .+ The bug should be fixed in ghc-8.0.2 and beyond.+ . For additional notes on installing on Windows, see: . * <https://github.com/tmcdonell/cuda/blob/master/WINDOWS.markdown>@@ -133,7 +140,10 @@ ghc-prof-options: -fprof-auto -fprof-cafs + if impl(ghc == 8.0.1)+ cpp-options: -DCUDA_PRELOAD + Executable nvidia-device-query Main-is: DeviceQuery.hs hs-source-dirs: examples/src/deviceQueryDrv@@ -149,7 +159,7 @@ source-repository this type: git location: https://github.com/tmcdonell/cuda- tag: 0.7.5.1+ tag: 0.7.5.2 -- vim: nospell