summaryrefslogtreecommitdiff
path: root/src/solvers/ocl.rs
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2020-01-04 08:13:54 +0100
committerDennis Kobert <dennis@kobert.dev>2020-01-04 08:13:54 +0100
commit920a6729577d14ba9190abcb3a2c4087652228a4 (patch)
tree8790c755a933f46bbe414cfd1eb1b1be0fea12ad /src/solvers/ocl.rs
parent862695a7374bc60368d09a7e695ae0b8aa3b97c2 (diff)
Add profiling extend gpu support
Diffstat (limited to 'src/solvers/ocl.rs')
-rw-r--r--src/solvers/ocl.rs29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/solvers/ocl.rs b/src/solvers/ocl.rs
deleted file mode 100644
index 7c6bb16..0000000
--- a/src/solvers/ocl.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-use ocl::ProQue;
-
-pub fn trivial() -> ocl::Result<()> {
- let src = r#"
- __kernel void add(__global float* buffer, float scalar) {
- buffer[get_global_id(0)] += scalar;
- }
- "#;
-
- let pro_que = ProQue::builder().src(src).dims(1 << 20).build()?;
-
- let buffer = pro_que.create_buffer::<f32>()?;
-
- let kernel = pro_que
- .kernel_builder("add")
- .arg(&buffer)
- .arg(10.0f32)
- .build()?;
-
- unsafe {
- kernel.enq()?;
- }
-
- let mut vec = vec![0.0f32; buffer.len()];
- buffer.read(&mut vec).enq()?;
-
- println!("The value at index [{}] is now '{}'!", 200007, vec[200007]);
- Ok(())
-}