Crates.io | clf |
lib.rs | clf |
version | 0.1.9 |
source | src |
created_at | 2021-06-16 10:36:05.444114 |
updated_at | 2024-06-09 02:54:16.525007 |
description | flush the cpu cache line by __builtin_clear_cache() |
homepage | |
repository | https://github.com/aki-akaguma/clf |
max_upload_size | |
id | 410793 |
size | 27,308 |
Flush the cpu cache line by __builtin_clear_cache()
This crate can be used when you do benchmarks that are not dependent on the cpu cache.
Easy to use:
let a = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
clf::cache_line_flush_with_slice(&a);
or
let a = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
let begin_ptr = a.as_ptr();
let end_ptr = unsafe { begin_ptr.add(a.len()) };
clf::cache_line_flush_with_ptr(begin_ptr, end_ptr);
This project is licensed under either of
at your option.