コード例 #1
0
ファイル: benchmarks.c プロジェクト: dzc1234ok/lk
void benchmarks(void)
{
#if ARCH_ARM
	bench_set_overhead();
	bench_memset();
	bench_cset_uint8_t();
	bench_cset_uint16_t();
	bench_cset_uint32_t();
	bench_cset_uint64_t();
	bench_cset_wide();
	bench_cset_stm();
	bench_memcpy();
#endif
#if WITH_LIB_LIBM
    bench_sincos();
#endif
}
コード例 #2
0
static int string_tests(int argc, cmd_args *argv)
{
	src = memalign(64, BUFFER_SIZE + 256);
	dst = memalign(64, BUFFER_SIZE + 256);
	src2 = memalign(64, BUFFER_SIZE + 256);
	dst2 = memalign(64, BUFFER_SIZE + 256);

	printf("src %p, dst %p\n", src, dst);
	printf("src2 %p, dst2 %p\n", src2, dst2);

	if (argc < 3) {
		printf("not enough arguments:\n");
usage:
		printf("%s validate <routine>\n", argv[0].str);
		printf("%s bench <routine>\n", argv[0].str);
		goto out;
	}

	if (!strcmp(argv[1].str, "validate")) {
		if (!strcmp(argv[2].str, "memcpy")) {
			validate_memcpy();
		} else if (!strcmp(argv[2].str, "memset")) {
			validate_memset();
		} else if (!strcmp(argv[2].str, "memcpy_overlap")) {
			validate_memcpy_overlap();
		}
	} else if (!strcmp(argv[1].str, "bench")) {
		if (!strcmp(argv[2].str, "memcpy")) {
			bench_memcpy();
		} else if (!strcmp(argv[2].str, "memset")) {
			bench_memset();
		}
	} else {
		goto usage;
	}

out:
	free(src);
	free(dst);
	free(src2);
	free(dst2);

	return 0;
}