-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vector comparisons #2119
base: master
Are you sure you want to change the base?
Vector comparisons #2119
Conversation
df5ab5d
to
5e46644
Compare
Label error. Requires exactly 1 of: patch, minor, major. Found: |
f4a95ea
to
ecf54d5
Compare
list(APPEND arcticdb_core_libraries ${KERBEROS_LIBRARY}) | ||
list(APPEND arcticdb_core_includes ${KERBEROS_INCLUDE_DIR}) | ||
#list(APPEND arcticdb_core_libraries ${KERBEROS_LIBRARY}) | ||
#list(APPEND arcticdb_core_includes ${KERBEROS_INCLUDE_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncomment
@@ -1097,7 +1105,7 @@ if(${TEST}) | |||
util/test/rapidcheck_string_pool.cpp | |||
util/test/rapidcheck_main.cpp | |||
util/test/rapidcheck_lru_cache.cpp | |||
version/test/rapidcheck_version_map.cpp) | |||
version/test/rapidcheck_version_map.cpp util/test/test_min_max_integer.cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed here, although this code is a good candidate for rapidcheck testing
static_assert(HeaderSize == Align); | ||
uint8_t data_[MinSize]; | ||
static const size_t DataAlignment = 64; | ||
static const size_t PadSize = (DataAlignment - (HeaderDataSize % DataAlignment)) % DataAlignment; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mod operator is a no-op, (DataAlignment - (HeaderDataSize % DataAlignment)) < DataAlignment
, so (DataAlignment - (HeaderDataSize % DataAlignment)) % DataAlignment == (DataAlignment - (HeaderDataSize % DataAlignment))
@@ -68,7 +68,7 @@ std::vector<ChunkedBufferImpl<BlockSize>> split(const ChunkedBufferImpl<BlockSiz | |||
} | |||
|
|||
template std::vector<ChunkedBufferImpl<64>> split(const ChunkedBufferImpl<64>& input, size_t nbytes); | |||
template std::vector<ChunkedBufferImpl<3968>> split(const ChunkedBufferImpl<3968>& input, size_t nbytes); | |||
template std::vector<ChunkedBufferImpl<4032ul>> split(const ChunkedBufferImpl<4032ul>& input, size_t nbytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this just too small in error before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's any data that has been written into storage in 3968 byte blocks, will they still be readable without further modifications?
@@ -19,8 +19,7 @@ class ColumnDataRandomAccessorTest : public testing::Test { | |||
input_data.resize(n); | |||
std::iota(input_data.begin(), input_data.end(), 42); | |||
} | |||
// 3968 bytes == 496 int64s per block, so 3 blocks here | |||
size_t n{1000}; | |||
size_t n{1100}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is useful, it's now 504 int64s per block
constexpr size_t lane_count = sizeof(VectorType) / sizeof(T); | ||
|
||
T init_min = std::numeric_limits<T>::max(); | ||
T init_max = std::numeric_limits<T>::min(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It smells a bit that there are max related variables when only min is being computed and vice versa, but I can't see a way to refactor that removes them without a lot of code duplication
|
||
VectorType vector_min, vector_max; | ||
if constexpr (ComputeMin) { | ||
T* lanes = reinterpret_cast<T*>(&vector_min); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed, vector_min[i]
should do the obvious thing
https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html
|
||
#ifdef HAS_VECTOR_EXTENSIONS | ||
|
||
class MinMaxStressTest : public ::testing::Test { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move to a benchmark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of duplication in here, could we parametrize across supported types, and then move the random tests to rapidcheck?
return FloatExtremumFinder<T, FloatMaxComparator<T>>::find(data, n); | ||
} | ||
|
||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments below the #else
as for min_max_integer.hpp
Implement some portable vectorized comparisons