59 gboolean upstream =
FALSE;
65 assert_true(upstream);
73 gboolean upstream =
TRUE;
77 assert_false(upstream);
102 gboolean upstream =
TRUE;
108 assert_false(upstream);
121 gboolean upstream =
FALSE;
123 assert_true(upstream);
139 gboolean upstream =
TRUE;
141 assert_false(upstream);
148 const size_t offsets[] = {
155 for(
size_t i = 0;
i <
sizeof(offsets) /
sizeof(offsets[0]);
i++)
158 *(gboolean *)((
char *)&
in + offsets[
i]) =
TRUE;
160 gboolean upstream =
FALSE;
162 assert_true(upstream);
170 const size_t offsets[] = {
177 for(
size_t i = 0;
i <
sizeof(offsets) /
sizeof(offsets[0]);
i++)
180 *(gboolean *)((
char *)&
in + offsets[
i]) =
TRUE;
182 gboolean upstream =
FALSE;
185 assert_false(upstream);
194 in.color_picker_on =
TRUE;
211 const gboolean display_reads_the_last_output)
213 gboolean carried = display_reads_the_last_output;
214 for(
int i = count - 1;
i >= 0;
i--)
228 gboolean cached[4] = {
FALSE };
231 assert_true(cached[3]);
232 assert_false(cached[2]);
233 assert_false(cached[1]);
234 assert_false(cached[0]);
249 gboolean cached[4] = {
FALSE };
252 assert_true(cached[3]);
257 assert_false(cached[2]);
258 assert_true(cached[1]);
259 assert_false(cached[0]);
269 gboolean cached[3] = {
FALSE };
272 for(
int i = 0;
i < 3;
i++) assert_false(cached[
i]);
275int main(
int argc,
char *argv[])
277 const struct CMUnitTest tests[] = {
291 return cmocka_run_group_tests(tests, NULL, NULL);
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
const dt_colormatrix_t dt_aligned_pixel_t out
Whether one pipeline node must keep a host-RAM copy of its output.
static gboolean dt_dev_pipe_cache_policy_decide(const dt_dev_pipe_cache_policy_inputs_t *in, const gboolean inherited_requirement, gboolean *upstream_requirement)
Decide one node's host-cache requirement, walking the pipe from the end backwards.
const float uint32_t state[4]
static void _gpu_node_requires_nothing_on_its_own(void **state)
static void _each_own_output_reason_raises_own(void **state)
static void _a_cpu_node_publishes_its_producer_and_no_further(void **state)
static void _only_the_displayed_output_is_cached_in_a_gpu_chain(void **state)
static void _each_own_input_reason_raises_upstream(void **state)
static void _a_cpu_node_still_makes_its_producer_publish(void **state)
static dt_dev_pipe_cache_policy_inputs_t _gpu_node_with_no_needs(void)
static void _a_pure_gpu_chain_nobody_reads_caches_nothing(void **state)
static void _a_gpu_node_does_not_relay_its_consumers_requirement(void **state)
static void _null_upstream_pointer_is_allowed(void **state)
static void _cpu_only_node_needs_its_input_on_host(void **state)
static void _a_gpu_node_nothing_reads_from_ram_caches_nothing(void **state)
static void _walk(const dt_dev_pipe_cache_policy_inputs_t *nodes, gboolean *out, const int count, const gboolean display_reads_the_last_output)
Walk a chain of nodes the way _seal_opencl_cache_policy() does, last to first.