Skip to content

Commit

Permalink
Replaced (long ) with ^long.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueberry committed Jan 16, 2018
1 parent a9cadfa commit 474049a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/clojure/uncomplicate/clojurecuda/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
([src dst ^long byte-count]
(with-check (JCudaDriver/cuMemcpy (cu-ptr dst) (cu-ptr src) byte-count) dst))
([src dst]
(memcpy! src dst (min (long (size src)) (long (size dst))))))
(memcpy! src dst (min ^long (size src) ^long (size dst)))))

(defn memcpy-host!
"Copies `byte-count` or all possible memory from `src` to `dst`, one of which
Expand All @@ -191,9 +191,9 @@
([src dst arg]
(if (integer? arg)
(memcpy-host* src dst arg)
(memcpy-host* src dst (min (long (size src)) (long (size dst))) arg)))
(memcpy-host* src dst (min ^long (size src) ^long (size dst)) arg)))
([src dst]
(memcpy-host* src dst (min (long (size src)) (long (size dst))))))
(memcpy-host* src dst (min ^long (size src) ^long (size dst)))))

(defn memset!
"Sets `len` or all 32-bit segments of `cu-mem` to 32-bit integer `value`. If `hstream` is
Expand All @@ -202,11 +202,11 @@
See [cuMemset32D](http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html)
"
([cu-mem ^long value]
(memset! cu-mem value (long (/ (long (size cu-mem)) Integer/BYTES))))
(memset! cu-mem value ^long (/ ^long (size cu-mem) Integer/BYTES)))
([cu-mem ^long value arg]
(if (integer? arg)
(with-check (JCudaDriver/cuMemsetD32 (cu-ptr cu-mem) value arg) cu-mem)
(memset! cu-mem value (/ (long (size cu-mem)) Integer/BYTES) arg)))
(memset! cu-mem value (/ ^long (size cu-mem) Integer/BYTES) arg)))
([cu-mem ^long value ^long len hstream]
(if hstream
(with-check (JCudaDriver/cuMemsetD32Async (cu-ptr cu-mem) value len hstream) cu-mem)
Expand Down Expand Up @@ -585,8 +585,8 @@
([^long dim-x ^long dim-y ^long dim-z ^long block-x]
(GridDim. (Math/ceil (/ dim-x block-x)) dim-y dim-z block-x 1 1))
([dim-x dim-y dim-z block-x block-y block-z]
(GridDim. (Math/ceil (/ (long dim-x) (long block-x))) (Math/ceil (/ (long dim-y) (long block-y)))
(Math/ceil (/ (long dim-z) (long block-z))) block-x block-y block-z)))
(GridDim. (Math/ceil (/ ^long dim-x ^long block-x)) (Math/ceil (/ ^long dim-y ^long block-y))
(Math/ceil (/ ^long dim-z ^long block-z)) block-x block-y block-z)))

(defn global
"Returns CUDA global `CULinearMemory` named `name` from module `m`, with optionally specified size..
Expand Down
4 changes: 2 additions & 2 deletions src/clojure/uncomplicate/clojurecuda/toolbox.clj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
(let [[m n block-m block-n] (if (and wgs-m wgs-n)
[n (count-blocks block-m m) wgs-m wgs-n]
[m (count-blocks block-n n) block-m block-n])]
(if (or (< 1 (long block-n)) (= 1 (long n)))
(loop [n (long n)]
(if (or (< 1 ^long block-n) (= 1 ^long n))
(loop [n ^long n]
(when (< 1 n)
(launch! reduction-kernel (grid-2d m n block-m block-n) hstream
(apply parameters n reduction-params))
Expand Down

0 comments on commit 474049a

Please sign in to comment.