Skip to content

Commit

Permalink
fixing readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Zheng committed Feb 8, 2018
1 parent 8f40c08 commit 18d1f9b
Showing 1 changed file with 35 additions and 34 deletions.
69 changes: 35 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,49 +56,50 @@ Clojure

There is currently a bug in [image-bench.sobel](https://github.com/zcaudate-me/image-bench) where setting local workgroup size to more than [1 1] will cause errors. This is reproducible by following the [comment block](https://github.com/zcaudate-me/image-bench/blob/master/source/clojure/image_bench/sobel.clj#L196-L237) in the source code:

(use 'image-bench.sobel)
(require '[image-bench.core :as img]
'[image-bench.grayscale :as gray])

;;
;;
;; can also try "resources/lena-0250x0250.jpg"
(def eye (-> (img/load-image "resources/eye-0016x0016.jpg")
(gray/grayscale)))

(img/display-image eye)
(println (img/grayscale-to-hex eye))
```clojure
(use 'image-bench.sobel)
(require '[image-bench.core :as img]
'[image-bench.grayscale :as gray])

;;
;;
;; can also try "resources/lena-0250x0250.jpg"
(def eye (-> (img/load-image "resources/eye-0016x0016.jpg")
(gray/grayscale)))

;;
;; using cl/event and cl/enq-nd!
;;
(def out1a (sobel-invalid-event-error eye [1 1]))
(println (img/grayscale-to-hex out1a)) ;; fine
(img/display-image eye)
(println (img/grayscale-to-hex eye))

;; throws OpenCL error: CL_INVALID_EVENT
(def out1b (sobel-invalid-event-error eye [8 8]))

;;
;; using cl/event and cl/enq-nd!
;;
(def out1a (sobel-invalid-event-error eye [1 1]))
(println (img/grayscale-to-hex out1a)) ;; fine

;;
;; using only cl/enq-nd!
;;
(def out2a (sobel-invalid-work-group-error eye [1 1]))
(println (img/grayscale-to-hex out2a)) ;; fine
;; throws OpenCL error: CL_INVALID_EVENT
(def out1b (sobel-invalid-event-error eye [8 8]))

;; throw OpenCL error: CL_INVALID_WORK_GROUP_SIZE
(def out2b (sobel-invalid-work-group-error eye [8 8]))


;;
;; using org.jocl.CL/clEnqueueNDRangeKernel
;;
(def out3a (sobel-zero-output eye [1 1]))
(println (img/grayscale-to-hex out3a));; fine
;;
;; using only cl/enq-nd!
;;
(def out2a (sobel-invalid-work-group-error eye [1 1]))
(println (img/grayscale-to-hex out2a)) ;; fine

;; throw OpenCL error: CL_INVALID_WORK_GROUP_SIZE
(def out2b (sobel-invalid-work-group-error eye [8 8]))


(def out3b (sobel-zero-output eye [8 8]))
(println (img/grayscale-to-hex out3b)) ;; Outputs are zero
;;
;; using org.jocl.CL/clEnqueueNDRangeKernel
;;
(def out3a (sobel-zero-output eye [1 1]))
(println (img/grayscale-to-hex out3a));; fine

(def out3b (sobel-zero-output eye [8 8]))
(println (img/grayscale-to-hex out3b)) ;; Outputs are zero
```
## License

Copyright © 2018 Chris Zheng
Expand Down

0 comments on commit 18d1f9b

Please sign in to comment.