Skip to content

Commit

Permalink
Removed the majority of the complexity of the math subsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Nuernberger committed Dec 28, 2017
1 parent 51e1351 commit 20933d1
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 771 deletions.
40 changes: 0 additions & 40 deletions resources/add.cu

This file was deleted.

Binary file removed resources/add.fatbin
Binary file not shown.
32 changes: 0 additions & 32 deletions resources/elementwise_multiply.cu

This file was deleted.

Binary file removed resources/elementwise_multiply.fatbin
Binary file not shown.
29 changes: 0 additions & 29 deletions resources/l2_constraint_scale.cu

This file was deleted.

Binary file removed resources/l2_constraint_scale.fatbin
Binary file not shown.
44 changes: 0 additions & 44 deletions resources/sum.cu

This file was deleted.

Binary file removed resources/sum.fatbin
Binary file not shown.
194 changes: 0 additions & 194 deletions src/cortex/compute/array_view_math.clj

This file was deleted.

27 changes: 0 additions & 27 deletions src/cortex/compute/cpu/driver.clj
Expand Up @@ -8,7 +8,6 @@
[think.resource.core :as resource]
[clojure.core.matrix.macros :refer [c-for]]
[clojure.core.matrix :as m]
[cortex.compute.array-view-math :as avm]
[think.parallel.core :as parallel])
(:import [java.nio ByteBuffer IntBuffer ShortBuffer LongBuffer
FloatBuffer DoubleBuffer Buffer]
Expand Down Expand Up @@ -313,29 +312,3 @@ Use with care; the synchonization primitives will just hang with this stream."
(extend-type ArrayViewBase
resource/PResource
(release-resource [_]))


(extend-type CPUStream
c-math/PMath
(sum-impl [stream alpha x beta y result]
(with-stream-dispatch stream
(avm/sum (dtype/->view x) alpha beta (dtype/->view y) (dtype/->view result))))

(gemv-impl [stream trans-a? a-row-count a-col-count alpha A a-colstride x inc-x beta y inc-y]
(with-stream-dispatch stream
(avm/gemv (dtype/->view A) a-colstride trans-a? a-row-count a-col-count alpha
(dtype/->view x) inc-x beta (dtype/->view y) inc-y)))

(mul-rows [stream a-row-count a-col-count A a-colstride x inc-x C c-colstride]
(with-stream-dispatch stream
(avm/mul-rows (dtype/->view A) a-colstride a-row-count a-col-count
(dtype/->view x) inc-x (dtype/->view C) c-colstride)))

(elem-mul [stream alpha a inc-a b inc-b res inc-res]
(with-stream-dispatch stream
(avm/elem-mul (dtype/->view a) inc-a alpha (dtype/->view b) inc-b (dtype/->view res)
inc-res)))

(l2-constraint-scale [stream a inc-a l2-max-constraint]
(with-stream-dispatch stream
(avm/l2-constraint-scale (dtype/->view a) inc-a l2-max-constraint))))

0 comments on commit 20933d1

Please sign in to comment.