-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathOpenCLSpec.scala
45 lines (40 loc) · 1.11 KB
/
OpenCLSpec.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.thoughtworks.compute
import java.nio.ByteBuffer
import org.lwjgl.opencl._
import CL10._
import CL12._
import com.thoughtworks.raii.asynchronous._
import com.thoughtworks.each.Monadic._
import com.thoughtworks.feature.Factory
import com.thoughtworks.future._
import org.scalatest.freespec.AsyncFreeSpec
import org.scalatest.matchers.should.Matchers
/**
* @author 杨博 (Yang Bo)
*/
final class OpenCLSpec extends AsyncFreeSpec with Matchers {
// "xxx" in {
// val openCL: Bit64Pointers with OpenCL10 = Factory[Bit64Pointers with OpenCL10].newInstance()
// println(openCL.platforms)
//
// 1 should be(1)
// }
//
// "test" in monadic[Do] {
// val platform = OpenCL.platforms.head
//
// val device = platform.devices.maxBy { device =>
// Seq(CL_DEVICE_TYPE_CPU, CL_DEVICE_TYPE_GPU, CL_DEVICE_TYPE_ACCELERATOR).indexOf(device.deviceType)
// }
//
// def logger(errorInfo: String, data: ByteBuffer) = {
// Console.err.println(errorInfo)
// }
// val context: OpenCL.Context = platform.createContext(logger, device).each
//
//
//
// 1 should be(1)
// }.run.toScalaFuture
// ???
}