Update readme and rename stream module

Signed-off-by: Trivernis <trivernis@protonmail.com>
main
Trivernis 3 years ago
parent 50bd608b89
commit a47edc97dc

@ -4,7 +4,7 @@ description = "OpenCL Stream execution framework"
repository = "https://github.com/parallel-programming-hwr/ocl-stream-rs"
license = "Apache-2.0"
readme = "README.md"
version = "0.2.0"
version = "0.2.1"
authors = ["Trivernis <trivernis@protonmail.com>"]
edition = "2018"

@ -32,7 +32,7 @@ fn main() {
let stream_executor = OCLStreamExecutor::new(pro_que);
// execute a closure that provides the results in the given stream
let mut stream = stream_executor.execute(|ctx| {
let mut stream = stream_executor.execute_unbound(|ctx| {
let pro_que = ctx.pro_que();
let tx = ctx.sender();
let input_buffer = pro_que.buffer_builder().len(100).fill_val(0u32).build()?;

@ -4,7 +4,7 @@
* See LICENSE for more information
*/
use crate::executor::ocl_stream::OCLStreamSender;
use crate::executor::stream::OCLStreamSender;
use ocl::ProQue;
/// Context passed to the executing closure

@ -5,14 +5,14 @@
*/
use crate::executor::context::ExecutorContext;
use crate::executor::ocl_stream::{OCLStream, OCLStreamSender};
use crate::executor::stream::{OCLStream, OCLStreamSender};
use crate::utils::result::OCLStreamResult;
use ocl::ProQue;
use scheduled_thread_pool::ScheduledThreadPool;
use std::sync::Arc;
pub mod context;
pub mod ocl_stream;
pub mod stream;
/// Stream executor for OpenCL Programs
#[derive(Clone)]
@ -24,6 +24,12 @@ pub struct OCLStreamExecutor {
impl OCLStreamExecutor {
/// Creates a new OpenCL Stream executor
/// ```rust
/// use ocl::ProQue;
/// use ocl_stream::OCLStreamExecutor;
/// let pro_que = ProQue::builder().src("__kernel void bench_int() {}").build().unwrap();
/// let executor = OCLStreamExecutor::new(pro_que);
/// ```
pub fn new(pro_que: ProQue) -> Self {
Self {
pro_que,
@ -54,7 +60,7 @@ impl OCLStreamExecutor {
F: Fn(ExecutorContext<T>) -> OCLStreamResult<()> + Send + Sync + 'static,
T: Send + Sync + 'static,
{
let (stream, sender) = ocl_stream::bounded(size);
let (stream, sender) = stream::bounded(size);
self.execute(func, sender);
stream
@ -67,7 +73,7 @@ impl OCLStreamExecutor {
F: Fn(ExecutorContext<T>) -> OCLStreamResult<()> + Send + Sync + 'static,
T: Send + Sync + 'static,
{
let (stream, sender) = ocl_stream::unbounded();
let (stream, sender) = stream::unbounded();
self.execute(func, sender);
stream

@ -7,7 +7,7 @@
pub mod executor;
pub mod utils;
pub use executor::ocl_stream;
pub use executor::stream;
pub use executor::OCLStreamExecutor;
// reexport the ocl crate
pub use ocl;

Loading…
Cancel
Save