File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/clojure/uncomplicate/clojurecuda Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1818 [utils :refer [mask count-groups dragan-says-ex]]]
1919 [uncomplicate.clojure-cpp
2020 :refer [null? pointer byte-pointer string-pointer int-pointer long-pointer size-t-pointer
21- pointer-pointer get-entry put-entry! safe type-pointer
21+ pointer-pointer get-entry put-entry! safe type-pointer position!
2222 capacity! address]]
2323 [uncomplicate.clojurecuda.info :as cuda-info]
2424 [uncomplicate.clojurecuda.internal
309309 (throw (ex-info (format " Unknown data type: %s." (str type)))))))
310310
311311(defn cuda-free! [^Pointer dptr]
312- (with-check (cudart/cudaFree (extract dptr)) (.setNull dptr))
312+ (when-not (null? dptr)
313+ (with-check (cudart/cudaFree (position! dptr 0 )) (.setNull dptr)))
313314 dptr )
314315
315316; ; =================== Pinned Memory ================================================
You can’t perform that action at this time.
0 commit comments