File: test_prefetch.c

package info (click to toggle)
dpdk 25.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 127,892 kB
  • sloc: ansic: 2,358,479; python: 16,426; sh: 4,474; makefile: 1,713; awk: 70
file content (38 lines) | stat: -rw-r--r-- 618 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2010-2014 Intel Corporation
 */

#include <stdio.h>
#include <stdint.h>

#include <rte_prefetch.h>

#include "test.h"

/*
 * Prefetch test
 * =============
 *
 * - Just test that the macro can be called and validate the compilation.
 *   The test always return success.
 */

static int
test_prefetch(void)
{
	int a = 0;

	rte_prefetch0(&a);
	rte_prefetch1(&a);
	rte_prefetch2(&a);

	rte_prefetch0_write(&a);
	rte_prefetch1_write(&a);
	rte_prefetch2_write(&a);

	rte_cldemote(&a);

	return 0;
}

REGISTER_FAST_TEST(prefetch_autotest, true, true, test_prefetch);