Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README_Windows.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Prerequisites

- NVIDIA CUDA-enabled GPU
- MinGW GCC
- Visual Studio (C/C++ development)
- CUDA Toolkit, CUDA Drivers and CUDA SDK need to be installed
- freeglut

## Environment variables

### C_INCLUDE_PATH

set CUDA include path.
(ex: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include)

### PATH

add following directory paths:

- MinGW bin directory
- MSVC bin directory (contains cl.exe)
- freeglut dll directory

# Installation

You can install cl-cuda via quicklisp.

> (ql:quickload :cl-cuda)

## Verification environments (Windows)

#### Environment
* Windows 10 Pro (Version 1903 OS Build 18362.356)
* GeForce GTX 1080
* Visual Studio Community 2019
* CUDA 10.1
* gcc (x86_64-posix-sjlj-rev0, Built by MinGW-W64 project) 8.1.0
* freeglut 3.0.0 for MinGW
* SBCL 1.4.14 (installed via roswell 19.08.11.101(0d8e06d))
* 2 tests failed, all examples work

[testing script and result](https://gist.github.com/sgr/242b70859c9afb39ab83a1a7d5feeea6)

2 changes: 1 addition & 1 deletion cl-cuda.asd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
:version "0.1"
:author "Masayuki Takagi"
:license "MIT"
:depends-on ("cffi" "alexandria" "external-program" "osicat"
:depends-on ("cffi" "alexandria" "external-program" #-windows "osicat"
"cl-pattern" "split-sequence" "cl-reexport" "cl-ppcre")
:components ((:module "src"
:serial t
Expand Down
11 changes: 8 additions & 3 deletions src/api/nvcc.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
;;; Helper
;;;

(defvar *tmp-path* (make-pathname :directory "tmp"))
(defvar *tmp-path*
#-windows (make-pathname :directory "tmp")
#+windows (uiop:getenv-pathname "TEMP" :want-directory t))

(defun get-tmp-path ()
*tmp-path*)

(defun get-cu-path ()
(let ((name (format nil "cl-cuda.~A" (osicat-posix:mktemp))))
(let ((name #-windows (format nil "cl-cuda.~A" (osicat-posix:mktemp))
#+windows "cl-cuda.tmp"))
(make-pathname :name name :type "cu" :defaults (get-tmp-path))))

(defun get-ptx-path (cu-path)
Expand All @@ -40,7 +43,9 @@
(list "-I" (namestring include-path)
"-ptx"
"-o" (namestring ptx-path)
(namestring cu-path)))))
(namestring cu-path)
#+windows "-Xcompiler"
#+windows "/source-charset:utf-8"))))


;;;
Expand Down
1 change: 1 addition & 0 deletions src/driver-api/library.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
;;;

(cffi:define-foreign-library libcuda
(:windows "nvcuda.dll")
(:darwin (:framework "CUDA"))
(:unix (:or "libcuda.so" "libcuda64.so")))

Expand Down
4 changes: 4 additions & 0 deletions t/api/defkernel.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,21 @@
;;; Initializers
;;;

#+nil
(defglobal c (float3 3.0 2.0 1.0))

#+nil
(defkernel initializer (float3 ())
(let ((x 1.0))
(return (float3 x 2.0 3.0))))

#+nil
(defkernel use-initializer (void ((x float3*) (y float3*)))
(set (aref x 0) (initializer))
(set (aref y 0) c)
(return))

#+nil
(subtest "Initializers"

(with-cuda (0)
Expand Down