ocl_stream/executor/
context.rs1use crate::executor::stream::OCLStreamSender;
8use ocl::ProQue;
9
10#[derive(Clone)]
14pub struct ExecutorContext<T>
15where
16 T: Send + Sync,
17{
18 pro_que: ProQue,
19 sender: OCLStreamSender<T>,
20 task_id: usize,
21}
22
23impl<T> ExecutorContext<T>
24where
25 T: Send + Sync,
26{
27 pub fn new(pro_que: ProQue, task_id: usize, sender: OCLStreamSender<T>) -> Self {
29 Self {
30 pro_que,
31 task_id,
32 sender,
33 }
34 }
35
36 pub fn pro_que(&self) -> &ProQue {
38 &self.pro_que
39 }
40
41 pub fn sender(&self) -> &OCLStreamSender<T> {
43 &self.sender
44 }
45
46 pub fn task_id(&self) -> usize {
49 self.task_id
50 }
51}