Fix memory management bug and computational inefficiencies
- Fix mismatched new[]/free() to use proper delete[] in interface.hpp - Fix incorrect dx4 calculation (should be dx2*dx2, not dx2*dx) in lookup_xsimd.cpp - Fix redundant sinv calculation by using separate base variables in sin_cosf_dispatcher - Remove unused variable declarations in lookup_avx.cpp - Optimize reference backend to use sincosf() instead of separate sin/cos calls Co-authored-by: wvbbreu <185333235+wvbbreu@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,7 @@ public:
|
||||
return static_cast<void *>(new uint8_t[bytes]);
|
||||
};
|
||||
|
||||
virtual void free_memory(void *ptr) const { std::free(ptr); };
|
||||
virtual void free_memory(void *ptr) const { delete[] static_cast<uint8_t*>(ptr); };
|
||||
|
||||
// Compute sine for n elements
|
||||
virtual void compute_sinf(size_t n, const float *x, float *s) const = 0;
|
||||
|
||||
Reference in New Issue
Block a user