"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "benchmarks/kis_composition_benchmark.cpp" between
krita-5.1.3.tar.xz and krita-5.1.4.tar.xz

About: Krita is a painting program offering art tools for everyone (concept art, texture and matte painters, illustrations and comics).

kis_composition_benchmark.cpp  (krita-5.1.3.tar.xz):kis_composition_benchmark.cpp  (krita-5.1.4.tar.xz)
skipping to change at line 12 skipping to change at line 12
* SPDX-FileCopyrightText: 2012 Dmitry Kazakov <dimula73@gmail.com> * SPDX-FileCopyrightText: 2012 Dmitry Kazakov <dimula73@gmail.com>
* SPDX-FileCopyrightText: 2015 Thorsten Zachmann <zachmann@kde.org> * SPDX-FileCopyrightText: 2015 Thorsten Zachmann <zachmann@kde.org>
* SPDX-FileCopyrightText: 2020 Mathias Wein <lynx.mw+kde@gmail.com> * SPDX-FileCopyrightText: 2020 Mathias Wein <lynx.mw+kde@gmail.com>
* SPDX-FileCopyrightText: 2022 L. E. Segovia <amy@amyspark.me> * SPDX-FileCopyrightText: 2022 L. E. Segovia <amy@amyspark.me>
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
*/ */
// for calculation of the needed alignment // for calculation of the needed alignment
#include <xsimd_extensions/xsimd.hpp> #include <xsimd_extensions/xsimd.hpp>
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
#include <KoOptimizedCompositeOpOver32.h> #include <KoOptimizedCompositeOpOver32.h>
#include <KoOptimizedCompositeOpOver128.h> #include <KoOptimizedCompositeOpOver128.h>
#include <KoOptimizedCompositeOpCopy128.h> #include <KoOptimizedCompositeOpCopy128.h>
#include <KoOptimizedCompositeOpAlphaDarken32.h> #include <KoOptimizedCompositeOpAlphaDarken32.h>
#endif #endif
#include "kis_composition_benchmark.h" #include "kis_composition_benchmark.h"
#include <simpletest.h> #include <simpletest.h>
#include <QElapsedTimer> #include <QElapsedTimer>
skipping to change at line 47 skipping to change at line 47
#include <kis_debug.h> #include <kis_debug.h>
#if defined Q_OS_WIN #if defined Q_OS_WIN
#define MEMALIGN_ALLOC(p, a, s) ((*(p)) = _aligned_malloc((s), (a)), *(p) ? 0 : errno) #define MEMALIGN_ALLOC(p, a, s) ((*(p)) = _aligned_malloc((s), (a)), *(p) ? 0 : errno)
#define MEMALIGN_FREE(p) _aligned_free((p)) #define MEMALIGN_FREE(p) _aligned_free((p))
#else #else
#define MEMALIGN_ALLOC(p, a, s) posix_memalign((p), (a), (s)) #define MEMALIGN_ALLOC(p, a, s) posix_memalign((p), (a), (s))
#define MEMALIGN_FREE(p) free((p)) #define MEMALIGN_FREE(p) free((p))
#endif #endif
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
using float_v = xsimd::batch<float, xsimd::current_arch>; using float_v = xsimd::batch<float, xsimd::current_arch>;
#endif #endif
enum AlphaRange { enum AlphaRange {
ALPHA_ZERO, ALPHA_ZERO,
ALPHA_UNIT, ALPHA_UNIT,
ALPHA_RANDOM ALPHA_RANDOM
}; };
template <typename channel_type, class RandomGenerator> template <typename channel_type, class RandomGenerator>
skipping to change at line 231 skipping to change at line 231
#include <stdint.h> #include <stdint.h>
QVector<Tile> generateTiles(int size, QVector<Tile> generateTiles(int size,
const int srcAlignmentShift, const int srcAlignmentShift,
const int dstAlignmentShift, const int dstAlignmentShift,
AlphaRange srcAlphaRange, AlphaRange srcAlphaRange,
AlphaRange dstAlphaRange, AlphaRange dstAlphaRange,
const quint32 pixelSize) const quint32 pixelSize)
{ {
QVector<Tile> tiles(size); QVector<Tile> tiles(size);
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
const int vecSize = float_v::size; const int vecSize = float_v::size;
#else #else
const int vecSize = 1; const int vecSize = 1;
#endif #endif
// the 256 are used to make sure that we have a good alignment no matter wha t build options are used. // the 256 are used to make sure that we have a good alignment no matter wha t build options are used.
const size_t pixelAlignment = qMax(size_t(vecSize * sizeof(float)), size_t(2 56)); const size_t pixelAlignment = qMax(size_t(vecSize * sizeof(float)), size_t(2 56));
const size_t maskAlignment = qMax(size_t(vecSize), size_t(256)); const size_t maskAlignment = qMax(size_t(vecSize), size_t(256));
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
void *ptr = 0; void *ptr = 0;
skipping to change at line 505 skipping to change at line 505
benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_ZERO, ALPHA_ZERO); benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_ZERO, ALPHA_ZERO);
benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_UNIT, ALPHA_ZERO); benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_UNIT, ALPHA_ZERO);
/// --- /// ---
benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_RANDOM, ALPHA_UNIT); benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_RANDOM, ALPHA_UNIT);
benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_ZERO, ALPHA_UNIT); benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_ZERO, ALPHA_UNIT);
benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_UNIT, ALPHA_UNIT); benchmarkCompositeOp(op, false, 1.0, 1.0, 0, 0, ALPHA_UNIT, ALPHA_UNIT);
} }
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
template <typename channels_type> template <typename channels_type>
void printError(quint8 *s, quint8 *d1, quint8 *d2, quint8 *msk1, int pos) void printError(quint8 *s, quint8 *d1, quint8 *d2, quint8 *msk1, int pos)
{ {
const channels_type *src1 = reinterpret_cast<const channels_type*>(s); const channels_type *src1 = reinterpret_cast<const channels_type*>(s);
const channels_type *dst1 = reinterpret_cast<const channels_type*>(d1); const channels_type *dst1 = reinterpret_cast<const channels_type*>(d1);
const channels_type *dst2 = reinterpret_cast<const channels_type*>(d2); const channels_type *dst2 = reinterpret_cast<const channels_type*>(d2);
qDebug() << "Wrong rounding in pixel:" << pos; qDebug() << "Wrong rounding in pixel:" << pos;
qDebug() << "Vector version: " << dst1[0] << dst1[1] << dst1[2] << dst1[3]; qDebug() << "Vector version: " << dst1[0] << dst1[1] << dst1[2] << dst1[3];
skipping to change at line 618 skipping to change at line 618
} }
} }
freeTiles(tiles, 0, 0); freeTiles(tiles, 0, 0);
} }
#endif #endif
void KisCompositionBenchmark::detectBuildArchitecture() void KisCompositionBenchmark::detectBuildArchitecture()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
using namespace xsimd; using namespace xsimd;
qDebug() << "built for" << ppVar(current_arch().name()); qDebug() << "built for" << ppVar(current_arch().name());
qDebug() << "built for" << ppVar(default_arch().name()); qDebug() << "built for" << ppVar(default_arch().name());
qDebug() << ppVar(supported_architectures().contains<sse2>()); qDebug() << ppVar(supported_architectures().contains<sse2>());
qDebug() << ppVar(supported_architectures().contains<sse3>()); qDebug() << ppVar(supported_architectures().contains<sse3>());
qDebug() << ppVar(supported_architectures().contains<ssse3>()); qDebug() << ppVar(supported_architectures().contains<ssse3>());
qDebug() << ppVar(supported_architectures().contains<sse4_1>()); qDebug() << ppVar(supported_architectures().contains<sse4_1>());
qDebug() << ppVar(supported_architectures().contains<sse4_2>()); qDebug() << ppVar(supported_architectures().contains<sse4_2>());
skipping to change at line 645 skipping to change at line 645
qDebug() << ppVar(supported_architectures().contains<avx512f>()); qDebug() << ppVar(supported_architectures().contains<avx512f>());
qDebug() << ppVar(supported_architectures().contains<avx512bw>()); qDebug() << ppVar(supported_architectures().contains<avx512bw>());
qDebug() << ppVar(supported_architectures().contains<avx512dq>()); qDebug() << ppVar(supported_architectures().contains<avx512dq>());
qDebug() << ppVar(supported_architectures().contains<avx512cd>()); qDebug() << ppVar(supported_architectures().contains<avx512cd>());
qDebug().nospace() << "running on " << hex << "0x" << xsimd::available_archi tectures().best; qDebug().nospace() << "running on " << hex << "0x" << xsimd::available_archi tectures().best;
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarken_05_03() void KisCompositionBenchmark::checkRoundingAlphaDarken_05_03()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,0.3); checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,0.3);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarken_05_05() void KisCompositionBenchmark::checkRoundingAlphaDarken_05_05()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,0.5); checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,0.5);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarken_05_07() void KisCompositionBenchmark::checkRoundingAlphaDarken_05_07()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,0.7); checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,0.7);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarken_05_10() void KisCompositionBenchmark::checkRoundingAlphaDarken_05_10()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,1.0); checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,1.0);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarken_05_10_08() void KisCompositionBenchmark::checkRoundingAlphaDarken_05_10_08()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,1.0,0.8); checkRounding<AlphaDarkenCompositor32<quint8, quint32, KoAlphaDarkenParamsWr apperCreamy> >(0.5,1.0,0.8);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_03() void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_03()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor128<float, false, true> >(0.5, 0.3, -1, 16); checkRounding<OverCompositor128<float, false, true> >(0.5, 0.3, -1, 16);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_05() void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_05()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor128<float, false, true> >(0.5, 0.5, -1, 16); checkRounding<OverCompositor128<float, false, true> >(0.5, 0.5, -1, 16);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_07() void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_07()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor128<float, false, true> >(0.5, 0.7, -1, 16); checkRounding<OverCompositor128<float, false, true> >(0.5, 0.7, -1, 16);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_10() void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_10()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor128<float, false, true> >(0.5, 1.0, -1, 16); checkRounding<OverCompositor128<float, false, true> >(0.5, 1.0, -1, 16);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_10_08() void KisCompositionBenchmark::checkRoundingAlphaDarkenF32_05_10_08()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor128<float, false, true> >(0.5, 1.0, 0.8, 16); checkRounding<OverCompositor128<float, false, true> >(0.5, 1.0, 0.8, 16);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingOver() void KisCompositionBenchmark::checkRoundingOver()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor32<quint8, quint32, false, true> >(0.5, 0.3); checkRounding<OverCompositor32<quint8, quint32, false, true> >(0.5, 0.3);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingOverRgbaU16() void KisCompositionBenchmark::checkRoundingOverRgbaU16()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor128<quint16, false, true> >(0.5, 1.0, -1, 8); checkRounding<OverCompositor128<quint16, false, true> >(0.5, 1.0, -1, 8);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingOverRgbaF32() void KisCompositionBenchmark::checkRoundingOverRgbaF32()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<OverCompositor128<float, false, true> >(0.5, 1.0, -1, 16); checkRounding<OverCompositor128<float, false, true> >(0.5, 1.0, -1, 16);
#endif #endif
} }
#include <cfenv> #include <cfenv>
void KisCompositionBenchmark::checkRoundingCopyRgbaU16() void KisCompositionBenchmark::checkRoundingCopyRgbaU16()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<CopyCompositor128<quint16, false, true> >(0.5, 1.0, -1, 8); checkRounding<CopyCompositor128<quint16, false, true> >(0.5, 1.0, -1, 8);
#endif #endif
} }
void KisCompositionBenchmark::checkRoundingCopyRgbaF32() void KisCompositionBenchmark::checkRoundingCopyRgbaF32()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
checkRounding<CopyCompositor128<float, false, true> >(0.5, 1.0, -1, 16); checkRounding<CopyCompositor128<float, false, true> >(0.5, 1.0, -1, 16);
#endif #endif
} }
void KisCompositionBenchmark::compareAlphaDarkenOps() void KisCompositionBenchmark::compareAlphaDarkenOps()
{ {
const KoColorSpace *cs = KoColorSpaceRegistry::instance()->rgb8(); const KoColorSpace *cs = KoColorSpaceRegistry::instance()->rgb8();
KoCompositeOp *opAct = KoOptimizedCompositeOpFactory::createAlphaDarkenOpCre amy32(cs); KoCompositeOp *opAct = KoOptimizedCompositeOpFactory::createAlphaDarkenOpCre amy32(cs);
KoCompositeOp *opExp = new KoCompositeOpAlphaDarken<KoBgrU8Traits, KoAlphaDa rkenParamsWrapperCreamy>(cs); KoCompositeOp *opExp = new KoCompositeOpAlphaDarken<KoBgrU8Traits, KoAlphaDa rkenParamsWrapperCreamy>(cs);
skipping to change at line 1055 skipping to change at line 1055
QBENCHMARK_ONCE { QBENCHMARK_ONCE {
Q_FOREACH (const Tile &tile, tiles) { Q_FOREACH (const Tile &tile, tiles) {
memcpy(tile.dst, tile.src, 4 * numPixels); memcpy(tile.dst, tile.src, 4 * numPixels);
} }
} }
freeTiles(tiles, 0, 0); freeTiles(tiles, 0, 0);
} }
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN
const int vecSize = float_v::size; IVERSAL_BUILD_PASS
const size_t uint8VecAlignment = qMax(vecSize * sizeof(quint8), sizeof(void* const int vecSize = float_v::size;
)); const size_t uint8VecAlignment = qMax(vecSize * sizeof(quint8), sizeof(void *));
const size_t uint32VecAlignment = qMax(vecSize * sizeof(quint32), sizeof(voi const size_t uint32VecAlignment = qMax(vecSize * sizeof(quint32), sizeof(void *)
d*)); );
const size_t floatVecAlignment = qMax(vecSize * sizeof(float), sizeof(void*) const size_t floatVecAlignment = qMax(vecSize * sizeof(float), sizeof(void *));
);
#endif #endif
void KisCompositionBenchmark::benchmarkUintFloat() void KisCompositionBenchmark::benchmarkUintFloat()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>; using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>;
const int dataSize = 4096; const int dataSize = 4096;
void *ptr = 0; void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint8VecAlignment, dataSize); int error = MEMALIGN_ALLOC(&ptr, uint8VecAlignment, dataSize);
if (error) { if (error) {
qFatal("posix_memalign failed: %d", error); qFatal("posix_memalign failed: %d", error);
} }
quint8 *iData = (quint8*)ptr; quint8 *iData = (quint8*)ptr;
error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float)); error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float));
skipping to change at line 1098 skipping to change at line 1098
} }
} }
MEMALIGN_FREE(iData); MEMALIGN_FREE(iData);
MEMALIGN_FREE(fData); MEMALIGN_FREE(fData);
#endif #endif
} }
void KisCompositionBenchmark::benchmarkUintIntFloat() void KisCompositionBenchmark::benchmarkUintIntFloat()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>; using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>;
const int dataSize = 4096; const int dataSize = 4096;
void *ptr = 0; void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint8VecAlignment, dataSize); int error = MEMALIGN_ALLOC(&ptr, uint8VecAlignment, dataSize);
if (error) { if (error) {
qFatal("posix_memalign failed: %d", error); qFatal("posix_memalign failed: %d", error);
} }
quint8 *iData = (quint8*)ptr; quint8 *iData = (quint8*)ptr;
error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float)); error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float));
skipping to change at line 1130 skipping to change at line 1130
} }
} }
MEMALIGN_FREE(iData); MEMALIGN_FREE(iData);
MEMALIGN_FREE(fData); MEMALIGN_FREE(fData);
#endif #endif
} }
void KisCompositionBenchmark::benchmarkFloatUint() void KisCompositionBenchmark::benchmarkFloatUint()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>; using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>;
const int dataSize = 4096; const int dataSize = 4096;
void *ptr = 0; void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint32VecAlignment, dataSize * sizeof(quint 32)); int error = MEMALIGN_ALLOC(&ptr, uint32VecAlignment, dataSize * sizeof(quint 32));
if (error) { if (error) {
qFatal("posix_memalign failed: %d", error); qFatal("posix_memalign failed: %d", error);
} }
quint32 *iData = (quint32*)ptr; quint32 *iData = (quint32*)ptr;
error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float)); error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float));
skipping to change at line 1163 skipping to change at line 1163
} }
} }
MEMALIGN_FREE(iData); MEMALIGN_FREE(iData);
MEMALIGN_FREE(fData); MEMALIGN_FREE(fData);
#endif #endif
} }
void KisCompositionBenchmark::benchmarkFloatIntUint() void KisCompositionBenchmark::benchmarkFloatIntUint()
{ {
#if defined HAVE_XSIMD && XSIMD_UNIVERSAL_BUILD_PASS #if defined(HAVE_XSIMD) && !defined(XSIMD_NO_SUPPORTED_ARCHITECTURE) && XSIMD_UN IVERSAL_BUILD_PASS
using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>; using uint_v = xsimd::batch<unsigned int, xsimd::current_arch>;
const int dataSize = 4096; const int dataSize = 4096;
void *ptr = 0; void *ptr = 0;
int error = MEMALIGN_ALLOC(&ptr, uint32VecAlignment, dataSize * sizeof(quint 32)); int error = MEMALIGN_ALLOC(&ptr, uint32VecAlignment, dataSize * sizeof(quint 32));
if (error) { if (error) {
qFatal("posix_memalign failed: %d", error); qFatal("posix_memalign failed: %d", error);
} }
quint32 *iData = (quint32*)ptr; quint32 *iData = (quint32*)ptr;
error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float)); error = MEMALIGN_ALLOC(&ptr, floatVecAlignment, dataSize * sizeof(float));
if (error) { if (error) {
 End of changes. 25 change blocks. 
32 lines changed or deleted 31 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)