Skip to content

Commit 18d1f9b

Browse files
author
Chris Zheng
committed
fixing readme
1 parent 8f40c08 commit 18d1f9b

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

README.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -56,49 +56,50 @@ Clojure
5656

5757
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:
5858

59-
(use 'image-bench.sobel)
60-
(require '[image-bench.core :as img]
61-
'[image-bench.grayscale :as gray])
62-
63-
;;
64-
;;
65-
;; can also try "resources/lena-0250x0250.jpg"
66-
(def eye (-> (img/load-image "resources/eye-0016x0016.jpg")
67-
(gray/grayscale)))
68-
69-
(img/display-image eye)
70-
(println (img/grayscale-to-hex eye))
59+
```clojure
60+
(use 'image-bench.sobel)
61+
(require '[image-bench.core :as img]
62+
'[image-bench.grayscale :as gray])
7163

64+
;;
65+
;;
66+
;; can also try "resources/lena-0250x0250.jpg"
67+
(def eye (-> (img/load-image "resources/eye-0016x0016.jpg")
68+
(gray/grayscale)))
7269

73-
;;
74-
;; using cl/event and cl/enq-nd!
75-
;;
76-
(def out1a (sobel-invalid-event-error eye [1 1]))
77-
(println (img/grayscale-to-hex out1a)) ;; fine
70+
(img/display-image eye)
71+
(println (img/grayscale-to-hex eye))
7872

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

74+
;;
75+
;; using cl/event and cl/enq-nd!
76+
;;
77+
(def out1a (sobel-invalid-event-error eye [1 1]))
78+
(println (img/grayscale-to-hex out1a)) ;; fine
8279

83-
;;
84-
;; using only cl/enq-nd!
85-
;;
86-
(def out2a (sobel-invalid-work-group-error eye [1 1]))
87-
(println (img/grayscale-to-hex out2a)) ;; fine
80+
;; throws OpenCL error: CL_INVALID_EVENT
81+
(def out1b (sobel-invalid-event-error eye [8 8]))
8882

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

93-
;;
94-
;; using org.jocl.CL/clEnqueueNDRangeKernel
95-
;;
96-
(def out3a (sobel-zero-output eye [1 1]))
97-
(println (img/grayscale-to-hex out3a));; fine
84+
;;
85+
;; using only cl/enq-nd!
86+
;;
87+
(def out2a (sobel-invalid-work-group-error eye [1 1]))
88+
(println (img/grayscale-to-hex out2a)) ;; fine
89+
90+
;; throw OpenCL error: CL_INVALID_WORK_GROUP_SIZE
91+
(def out2b (sobel-invalid-work-group-error eye [8 8]))
92+
9893

99-
(def out3b (sobel-zero-output eye [8 8]))
100-
(println (img/grayscale-to-hex out3b)) ;; Outputs are zero
94+
;;
95+
;; using org.jocl.CL/clEnqueueNDRangeKernel
96+
;;
97+
(def out3a (sobel-zero-output eye [1 1]))
98+
(println (img/grayscale-to-hex out3a));; fine
10199

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

104105
Copyright © 2018 Chris Zheng

0 commit comments

Comments
 (0)