mirror of https://github.com/google/gemma.cpp.git
Merge branch 'dev' into gemma.cpp-windows-build-fix
This commit is contained in:
commit
027288b5e4
|
|
@ -159,7 +159,6 @@ class IntCodec {
|
|||
const hn::Rebind<int32_t, decltype(df)> di32;
|
||||
const hn::Rebind<int16_t, decltype(di32)> di16;
|
||||
const hn::Rebind<int8_t, decltype(di16)> di8;
|
||||
const hn::Rebind<int8_t, decltype(df)> df8;
|
||||
|
||||
const size_t N = hn::Lanes(di8);
|
||||
const size_t N32 = hn::Lanes(df);
|
||||
|
|
@ -387,7 +386,6 @@ class IntCodec {
|
|||
const hn::Rebind<int32_t, decltype(df)> di32;
|
||||
const hn::Rebind<int16_t, decltype(di32)> di16;
|
||||
const hn::Rebind<int8_t, decltype(di16)> di8;
|
||||
const hn::Rebind<int8_t, decltype(df)> df8;
|
||||
|
||||
const size_t N = hn::Lanes(di8);
|
||||
using VI8 = hn::Vec<decltype(di8)>;
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ CacheInfo::CacheInfo(const BoundedTopology& topology) {
|
|||
Allocator::Allocator(const BoundedTopology& topology,
|
||||
const CacheInfo& cache_info, bool enable_bind)
|
||||
: line_bytes_(cache_info.LineBytes()),
|
||||
step_bytes_(cache_info.StepBytes()),
|
||||
base_page_bytes_(DetectPageSize()),
|
||||
total_mib_(DetectTotalMiB(base_page_bytes_)) {
|
||||
quantum_bytes_ = cache_info.StepBytes(); // may overwrite below
|
||||
|
|
@ -239,9 +240,8 @@ AlignedPtr<uint8_t[]> Allocator::AllocBytes(size_t bytes) const {
|
|||
static_cast<uint8_t*>(p),
|
||||
DeleterFunc([bytes](void* ptr) { HWY_ASSERT(munmap(ptr, bytes) == 0); }));
|
||||
#elif HWY_OS_WIN
|
||||
const size_t alignment = HWY_MAX(vector_bytes_, line_bytes_);
|
||||
return AlignedPtr<uint8_t[]>(
|
||||
static_cast<uint8_t*>(_aligned_malloc(bytes, alignment)),
|
||||
static_cast<uint8_t*>(_aligned_malloc(bytes, step_bytes_)),
|
||||
DeleterFunc([](void* ptr) { _aligned_free(ptr); }));
|
||||
#else
|
||||
return AlignedPtr<uint8_t[]>(nullptr, DeleterFunc());
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ class Allocator {
|
|||
|
||||
private:
|
||||
const size_t line_bytes_;
|
||||
const size_t step_bytes_;
|
||||
const size_t base_page_bytes_;
|
||||
const size_t total_mib_;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue