mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
folly_memcpy is ready for benchmarking
This commit is contained in:
parent
937baedd44
commit
b84fcbc828
@ -255,6 +255,7 @@ else()
|
||||
if (GCC)
|
||||
add_compile_options(-Wno-pragmas)
|
||||
add_compile_options(-mavx)
|
||||
# add_compile_options(-fno-builtin-memcpy)
|
||||
# Otherwise `state [[maybe_unused]] int x;` will issue a warning.
|
||||
# https://stackoverflow.com/questions/50646334/maybe-unused-on-member-variable-gcc-warns-incorrectly-that-attribute-is
|
||||
add_compile_options(-Wno-attributes)
|
||||
|
@ -75,6 +75,7 @@ set(FLOW_SRCS
|
||||
flat_buffers.h
|
||||
flow.cpp
|
||||
flow.h
|
||||
folly_memcpy.S
|
||||
genericactors.actor.cpp
|
||||
genericactors.actor.h
|
||||
network.cpp
|
||||
|
@ -79,9 +79,9 @@ _memcpy_short:
|
||||
*
|
||||
*/
|
||||
.align 16
|
||||
.globl memcpy
|
||||
.type memcpy, @function
|
||||
memcpy:
|
||||
.globl folly_memcpy
|
||||
.type folly_memcpy, @function
|
||||
folly_memcpy:
|
||||
.cfi_startproc
|
||||
|
||||
mov %rdx, %rcx
|
||||
@ -173,6 +173,6 @@ memcpy:
|
||||
ret
|
||||
|
||||
.cfi_endproc
|
||||
.size memcpy, .-memcpy
|
||||
.size folly_memcpy, .-folly_memcpy
|
||||
|
||||
#endif
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include "flow/IRandom.h"
|
||||
#include "flow/UnitTest.h"
|
||||
|
||||
extern "C" {
|
||||
void* folly_memcpy(void* dst, void* src, uint32_t length);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set this to the maximum buffer size you want to test. If it is 0, then the
|
||||
* values in the buf_sizes[] array below will be used.
|
||||
@ -46,13 +50,13 @@ static size_t buf_sizes[TEST_VALUE_RANGE];
|
||||
#define TEST_BATCH_SIZE 100
|
||||
|
||||
/* Data is aligned on this many bytes (power of 2) */
|
||||
#ifdef RTE_MACHINE_CPUFLAG_AVX512F
|
||||
// #ifdef RTE_MACHINE_CPUFLAG_AVX512F
|
||||
#define ALIGNMENT_UNIT 64
|
||||
#elif defined RTE_MACHINE_CPUFLAG_AVX2
|
||||
#define ALIGNMENT_UNIT 32
|
||||
#else /* RTE_MACHINE_CPUFLAG */
|
||||
#define ALIGNMENT_UNIT 16
|
||||
#endif /* RTE_MACHINE_CPUFLAG */
|
||||
// #elif defined RTE_MACHINE_CPUFLAG_AVX2
|
||||
// #define ALIGNMENT_UNIT 32
|
||||
// #else /* RTE_MACHINE_CPUFLAG */
|
||||
// #define ALIGNMENT_UNIT 16
|
||||
// #endif /* RTE_MACHINE_CPUFLAG */
|
||||
|
||||
/*
|
||||
* Pointers used in performance tests. The two large buffers are for uncached
|
||||
|
Loading…
x
Reference in New Issue
Block a user