@@ -94,54 +94,4 @@ class FunctionKernelTest extends BaseTest {
94
94
println((timeMicros / 1000.0 ) + " milliseconds" )
95
95
}
96
96
}
97
-
98
- it should " capture simple scalars" in context {
99
- implicit context =>
100
- val f = 0.2f
101
-
102
- val array = Array (0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 )
103
- val clArray : CLArray [Int ] = array.cl
104
-
105
- val clResult = clArray.map((x : Int ) => x * 2 * f)
106
- val result = array.map(x => x * 2 * f)
107
- clResult.toList should equal(result.toList) // plusOrMinus 0.001f)
108
-
109
- clArray.release()
110
- clResult.release()
111
- }
112
-
113
- it should " capture simple arrays" in context {
114
- implicit context =>
115
- val clResult = {
116
- val f = CLArray (10 , 20 , 30 , 40 )
117
- val a = CLArray (0 , 1 , 2 , 3 )
118
-
119
- val r = if (true ) {
120
- val rr = new CLArray [Int ](a.length)
121
- kernel {
122
- for (i <- 0 until a.length.toInt) {
123
- rr(i) = f(i) + i
124
- }
125
- }
126
- rr
127
- } else {
128
- a.map((x : Int ) => f(x) + x)
129
- }
130
- // assertNotNull("result buffer doesn't have any write event", r.buffers(0).dataWrite)
131
- // assertEquals("source buffer doesn't have expected read event", 1, a.buffers(0).dataReads.size)
132
- // r.finish()
133
- // Thread.sleep(500)
134
- // assertNull("result buffer failed to clear its dataWrite upon finish()", r.buffers(0).dataWrite)
135
- // assertEquals("source buffer failed to clear its dataReads upon finish()", 0, a.buffers(0).dataReads.size)
136
- // assertEquals("captured buffer failed to clear its dataReads upon finish()", 0, f.buffers(0).dataReads.size)
137
-
138
- r
139
- }
140
- val result = {
141
- val f = Array (10 , 20 , 30 , 40 )
142
- val a = Array (0 , 1 , 2 , 3 )
143
- a.map(x => f(x) + x)
144
- }
145
- clResult.toList should equal(result.toList)
146
- }
147
97
}
0 commit comments