Skip to content

Commit

Permalink
Update overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
mlxd committed Mar 27, 2024
1 parent f87bdc1 commit 68eb3cf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,29 @@ template <typename T> struct AVX2Concept {
}
}

PL_FORCE_INLINE
static void stream_(PrecisionT *p, IntrinsicType value) {
if constexpr (std::is_same_v<PrecisionT, float>) {
_mm256_stream_ps(p, value);
} else if (std::is_same_v<PrecisionT, double>) {
_mm256_stream_pd(p, value);
} else {
static_assert(std::is_same_v<PrecisionT, float> ||
std::is_same_v<PrecisionT, double>);
}
}

PL_FORCE_INLINE
static void store(std::complex<PrecisionT> *p, IntrinsicType value) {
#ifdef PL_LQ_KERNEL_AVX_STREAMING
store(reinterpret_cast<PrecisionT *>(p), value);
}
PL_FORCE_INLINE
static void store(PrecisionT *p, IntrinsicType value) {
#ifdef PL_LQ_KERNEL_AVX_STREAMING
store_(p, value);
#else
#else
stream_(p, value);
#endif
#endif
}

PL_FORCE_INLINE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,30 @@ template <typename T> struct AVX512Concept {
}
}

PL_FORCE_INLINE
static void stream_(PrecisionT *p, IntrinsicType value) {

Check warning on line 108 in pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp#L108

Added line #L108 was not covered by tests
if constexpr (std::is_same_v<PrecisionT, float>) {
_mm512_stream_ps(p, value);
} else if (std::is_same_v<PrecisionT, double>) {
_mm512_stream_pd(p, value);
} else {
static_assert(std::is_same_v<PrecisionT, float> ||
std::is_same_v<PrecisionT, double>);
}
}

Check warning on line 117 in pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp#L117

Added line #L117 was not covered by tests

PL_FORCE_INLINE
static void store(std::complex<PrecisionT> *p, IntrinsicType value) {
#ifdef PL_LQ_KERNEL_AVX_STREAMING
store(reinterpret_cast<PrecisionT *>(p), value);
}

Check warning on line 122 in pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp#L120-L122

Added lines #L120 - L122 were not covered by tests

PL_FORCE_INLINE
static void store(PrecisionT *p, IntrinsicType value) {

Check warning on line 125 in pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp#L125

Added line #L125 was not covered by tests
#ifdef PL_LQ_KERNEL_AVX_STREAMING
store_(p, value);
#else
#else
stream_(p, value);

Check warning on line 129 in pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp#L129

Added line #L129 was not covered by tests
#endif
#endif
}

Check warning on line 131 in pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/core/src/simulators/lightning_qubit/gates/cpu_kernels/avx_common/AVX512Concept.hpp#L131

Added line #L131 was not covered by tests

PL_FORCE_INLINE
Expand Down

0 comments on commit 68eb3cf

Please sign in to comment.