Skip to main content

weir/fixed_point_resident/
analysis_methods.rs

1#![allow(clippy::too_many_arguments)]
2
3use super::FixedPointResidentGraph;
4
5impl FixedPointResidentGraph {
6    /// Run reaching-definition closure through resident graph resources.
7    pub fn reaching(
8        &self,
9        pipeline: &dyn vyre::CompiledPipeline,
10        seed_bits: &[u32],
11        max_iterations: u32,
12        config: &vyre::DispatchConfig,
13        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
14    ) -> Result<Vec<u32>, String> {
15        crate::reaching::reaching_closure_resident_plan_with_scratch(
16            pipeline,
17            self,
18            seed_bits,
19            max_iterations,
20            config,
21            scratch,
22        )
23    }
24
25    /// Run reaching-definition closure through resident graph resources into
26    /// caller-owned result storage.
27    pub fn reaching_into(
28        &self,
29        pipeline: &dyn vyre::CompiledPipeline,
30        seed_bits: &[u32],
31        max_iterations: u32,
32        config: &vyre::DispatchConfig,
33        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
34        result: &mut Vec<u32>,
35    ) -> Result<(), String> {
36        crate::reaching::reaching_closure_resident_plan_with_scratch_into(
37            pipeline,
38            self,
39            seed_bits,
40            max_iterations,
41            config,
42            scratch,
43            result,
44        )
45    }
46
47    /// Run reaching-definition closure with both graph and frontier buffers
48    /// passed as resident resources.
49    pub fn reaching_resident_frontier(
50        &self,
51        backend: &dyn vyre::VyreBackend,
52        pipeline: &dyn vyre::CompiledPipeline,
53        seed_bits: &[u32],
54        max_iterations: u32,
55        config: &vyre::DispatchConfig,
56        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
57    ) -> Result<Vec<u32>, String> {
58        crate::reaching::reaching_closure_resident_plan_with_backend_scratch(
59            backend,
60            pipeline,
61            self,
62            seed_bits,
63            max_iterations,
64            config,
65            scratch,
66        )
67    }
68
69    /// Run reaching-definition closure with graph/frontier resident resources
70    /// into caller-owned result storage.
71    pub fn reaching_resident_frontier_into(
72        &self,
73        backend: &dyn vyre::VyreBackend,
74        pipeline: &dyn vyre::CompiledPipeline,
75        seed_bits: &[u32],
76        max_iterations: u32,
77        config: &vyre::DispatchConfig,
78        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
79        result: &mut Vec<u32>,
80    ) -> Result<(), String> {
81        crate::reaching::reaching_closure_resident_plan_with_backend_scratch_into(
82            backend,
83            pipeline,
84            self,
85            seed_bits,
86            max_iterations,
87            config,
88            scratch,
89            result,
90        )
91    }
92
93    /// Run live-variable closure through resident graph resources.
94    pub fn live(
95        &self,
96        pipeline: &dyn vyre::CompiledPipeline,
97        seed_bits: &[u32],
98        max_iterations: u32,
99        config: &vyre::DispatchConfig,
100        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
101    ) -> Result<Vec<u32>, String> {
102        crate::live::live_closure_resident_plan_with_scratch(
103            pipeline,
104            self,
105            seed_bits,
106            max_iterations,
107            config,
108            scratch,
109        )
110    }
111
112    /// Run live-variable closure through resident graph resources into
113    /// caller-owned result storage.
114    pub fn live_into(
115        &self,
116        pipeline: &dyn vyre::CompiledPipeline,
117        seed_bits: &[u32],
118        max_iterations: u32,
119        config: &vyre::DispatchConfig,
120        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
121        result: &mut Vec<u32>,
122    ) -> Result<(), String> {
123        crate::live::live_closure_resident_plan_with_scratch_into(
124            pipeline,
125            self,
126            seed_bits,
127            max_iterations,
128            config,
129            scratch,
130            result,
131        )
132    }
133
134    /// Run live-variable closure with both graph and frontier buffers passed
135    /// as resident resources.
136    pub fn live_resident_frontier(
137        &self,
138        backend: &dyn vyre::VyreBackend,
139        pipeline: &dyn vyre::CompiledPipeline,
140        seed_bits: &[u32],
141        max_iterations: u32,
142        config: &vyre::DispatchConfig,
143        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
144    ) -> Result<Vec<u32>, String> {
145        crate::live::live_closure_resident_plan_with_backend_scratch(
146            backend,
147            pipeline,
148            self,
149            seed_bits,
150            max_iterations,
151            config,
152            scratch,
153        )
154    }
155
156    /// Run live-variable closure with graph/frontier resident resources into
157    /// caller-owned result storage.
158    pub fn live_resident_frontier_into(
159        &self,
160        backend: &dyn vyre::VyreBackend,
161        pipeline: &dyn vyre::CompiledPipeline,
162        seed_bits: &[u32],
163        max_iterations: u32,
164        config: &vyre::DispatchConfig,
165        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
166        result: &mut Vec<u32>,
167    ) -> Result<(), String> {
168        crate::live::live_closure_resident_plan_with_backend_scratch_into(
169            backend,
170            pipeline,
171            self,
172            seed_bits,
173            max_iterations,
174            config,
175            scratch,
176            result,
177        )
178    }
179
180    /// Run points-to subset closure through resident graph resources.
181    pub fn points_to_subset(
182        &self,
183        pipeline: &dyn vyre::CompiledPipeline,
184        seed_bits: &[u32],
185        max_iterations: u32,
186        config: &vyre::DispatchConfig,
187        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
188    ) -> Result<Vec<u32>, String> {
189        crate::points_to::subset_closure_resident_plan_with_scratch(
190            pipeline,
191            self,
192            seed_bits,
193            max_iterations,
194            config,
195            scratch,
196        )
197    }
198
199    /// Run points-to subset closure through resident graph resources into
200    /// caller-owned result storage.
201    pub fn points_to_subset_into(
202        &self,
203        pipeline: &dyn vyre::CompiledPipeline,
204        seed_bits: &[u32],
205        max_iterations: u32,
206        config: &vyre::DispatchConfig,
207        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
208        result: &mut Vec<u32>,
209    ) -> Result<(), String> {
210        crate::points_to::subset_closure_resident_plan_with_scratch_into(
211            pipeline,
212            self,
213            seed_bits,
214            max_iterations,
215            config,
216            scratch,
217            result,
218        )
219    }
220
221    /// Run points-to subset closure with both graph and frontier buffers passed
222    /// as resident resources.
223    pub fn points_to_subset_resident_frontier(
224        &self,
225        backend: &dyn vyre::VyreBackend,
226        pipeline: &dyn vyre::CompiledPipeline,
227        seed_bits: &[u32],
228        max_iterations: u32,
229        config: &vyre::DispatchConfig,
230        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
231    ) -> Result<Vec<u32>, String> {
232        crate::points_to::subset_closure_resident_plan_with_backend_scratch(
233            backend,
234            pipeline,
235            self,
236            seed_bits,
237            max_iterations,
238            config,
239            scratch,
240        )
241    }
242
243    /// Run points-to subset closure with graph/frontier resident resources
244    /// into caller-owned result storage.
245    pub fn points_to_subset_resident_frontier_into(
246        &self,
247        backend: &dyn vyre::VyreBackend,
248        pipeline: &dyn vyre::CompiledPipeline,
249        seed_bits: &[u32],
250        max_iterations: u32,
251        config: &vyre::DispatchConfig,
252        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
253        result: &mut Vec<u32>,
254    ) -> Result<(), String> {
255        crate::points_to::subset_closure_resident_plan_with_backend_scratch_into(
256            backend,
257            pipeline,
258            self,
259            seed_bits,
260            max_iterations,
261            config,
262            scratch,
263            result,
264        )
265    }
266
267    /// Run backward-slice closure through resident graph resources.
268    pub fn slice(
269        &self,
270        pipeline: &dyn vyre::CompiledPipeline,
271        seed_bits: &[u32],
272        max_iterations: u32,
273        config: &vyre::DispatchConfig,
274        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
275    ) -> Result<Vec<u32>, String> {
276        crate::slice::slice_closure_resident_plan_with_scratch(
277            pipeline,
278            self,
279            seed_bits,
280            max_iterations,
281            config,
282            scratch,
283        )
284    }
285
286    /// Run backward-slice closure through resident graph resources into
287    /// caller-owned result storage.
288    pub fn slice_into(
289        &self,
290        pipeline: &dyn vyre::CompiledPipeline,
291        seed_bits: &[u32],
292        max_iterations: u32,
293        config: &vyre::DispatchConfig,
294        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
295        result: &mut Vec<u32>,
296    ) -> Result<(), String> {
297        crate::slice::slice_closure_resident_plan_with_scratch_into(
298            pipeline,
299            self,
300            seed_bits,
301            max_iterations,
302            config,
303            scratch,
304            result,
305        )
306    }
307
308    /// Run backward-slice closure with both graph and frontier buffers passed
309    /// as resident resources.
310    pub fn slice_resident_frontier(
311        &self,
312        backend: &dyn vyre::VyreBackend,
313        pipeline: &dyn vyre::CompiledPipeline,
314        seed_bits: &[u32],
315        max_iterations: u32,
316        config: &vyre::DispatchConfig,
317        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
318    ) -> Result<Vec<u32>, String> {
319        crate::slice::slice_closure_resident_plan_with_backend_scratch(
320            backend,
321            pipeline,
322            self,
323            seed_bits,
324            max_iterations,
325            config,
326            scratch,
327        )
328    }
329
330    /// Run backward-slice closure with graph/frontier resident resources into
331    /// caller-owned result storage.
332    pub fn slice_resident_frontier_into(
333        &self,
334        backend: &dyn vyre::VyreBackend,
335        pipeline: &dyn vyre::CompiledPipeline,
336        seed_bits: &[u32],
337        max_iterations: u32,
338        config: &vyre::DispatchConfig,
339        scratch: &mut crate::fixed_point_scratch::FixedPointScratch,
340        result: &mut Vec<u32>,
341    ) -> Result<(), String> {
342        crate::slice::slice_closure_resident_plan_with_backend_scratch_into(
343            backend,
344            pipeline,
345            self,
346            seed_bits,
347            max_iterations,
348            config,
349            scratch,
350            result,
351        )
352    }
353}