Skip to content

Commit

Permalink
Don't rely on par_unseq for Map2D algo calls, the workload is too sim…
Browse files Browse the repository at this point in the history
…plistic currently (but we're due a remake anyway eventually)
  • Loading branch information
coornio committed Sep 15, 2024
1 parent 1b29bf8 commit deaa637
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
44 changes: 22 additions & 22 deletions src/Assistants/Map2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ class Map2D final {
*/
RowProxy& wipeAll() requires arithmetic<T> {
std::fill(
std::execution::par_unseq,
std::execution::unseq,
begin(), end(), T()
);
return *this;
Expand All @@ -610,12 +610,12 @@ class Map2D final {
if (_cols) {
if (_cols < 0) {
std::fill(
std::execution::par_unseq,
std::execution::unseq,
end() + _cols, end(), T()
);
} else {
std::fill(
std::execution::par_unseq,
std::execution::unseq,
begin(), begin() + _cols, T()
);
}
Expand All @@ -641,12 +641,12 @@ class Map2D final {
if (_cols) {
if (_cols < 0) {
std::rotate(
std::execution::par_unseq,
std::execution::unseq,
begin(), begin() + std::abs(_cols) % mLength, end()
);
} else {
std::rotate(
std::execution::par_unseq,
std::execution::unseq,
begin(), end() - std::abs(_cols) % mLength, end()
);
}
Expand Down Expand Up @@ -683,7 +683,7 @@ class Map2D final {
*/
RowProxy& reverse() {
std::reverse(
std::execution::par_unseq,
std::execution::unseq,
begin(), end()
);
return *this;
Expand Down Expand Up @@ -740,7 +740,7 @@ class Map2D final {
const arithmetic auto& value
) requires arithmetic<T> {
std::fill(
std::execution::par_unseq,
std::execution::unseq,
begin(), end(), static_cast<T>(value)
);
return *this;
Expand All @@ -751,7 +751,7 @@ class Map2D final {
if (this == &other) [[unlikely]] return *this;
const auto len{ std::min(other.size(), static_cast<paramU>(mLength)) };
std::copy(
std::execution::par_unseq,
std::execution::unseq,
other.begin(), other.begin() + len, mBegin
);
return *this;
Expand All @@ -761,7 +761,7 @@ class Map2D final {
) requires arithmetic<T> {
const auto len{ std::min(other.size(), static_cast<paramU>(mLength)) };
std::move(
std::execution::par_unseq,
std::execution::unseq,
other.begin(), other.begin() + len, mBegin
);
return *this;
Expand All @@ -771,7 +771,7 @@ class Map2D final {
) requires arithmetic<T> {
const auto len{ std::min(other.size(), static_cast<paramU>(mLength)) };
std::copy(
std::execution::par_unseq,
std::execution::unseq,
other.begin(), other.begin() + len, mBegin
);
return *this;
Expand Down Expand Up @@ -1174,7 +1174,7 @@ class Map2D final {
}
{
std::copy(
std::execution::par_unseq,
std::execution::unseq,
other.mBegin(), other.mEnd(), mBegin()
);
}
Expand All @@ -1185,7 +1185,7 @@ class Map2D final {
Map2D& operator=(const Map2D& other) { // copy assignment
if (this != &other && size() == other.size()) {
std::copy(
std::execution::par_unseq,
std::execution::unseq,
other.mBegin(), other.mEnd(), mBegin()
);
mRows = other.lenY(); mCols = other.lenX();
Expand Down Expand Up @@ -1359,7 +1359,7 @@ class Map2D final {
) requires arithmetic<T> {
const auto _len{ std::min(size(), other.size())};
std::copy_n(
std::execution::par_unseq,
std::execution::unseq,
other.mBegin(), _len, mBegin()
);
return *this;
Expand All @@ -1383,7 +1383,7 @@ class Map2D final {
) requires arithmetic<T> {
const auto _len{ static_cast<paramU>(std::abs(len)) };
std::copy_n(
std::execution::par_unseq,
std::execution::unseq,
other, std::min(_len, size()), mBegin()
);
return *this;
Expand Down Expand Up @@ -1444,7 +1444,7 @@ class Map2D final {
const auto srcIdx{ pData.get() + row * mCols };
const auto dstIdx{ pCopy.get() + row * cols };
std::move(
std::execution::par_unseq,
std::execution::unseq,
srcIdx, srcIdx + minCols, dstIdx
);
}
Expand Down Expand Up @@ -1478,7 +1478,7 @@ class Map2D final {
*/
Map2D& wipeAll() requires arithmetic<T> {
std::fill(
std::execution::par_unseq,
std::execution::unseq,
mBegin(), mEnd(), T()
);
return *this;
Expand Down Expand Up @@ -1508,12 +1508,12 @@ class Map2D final {
if (_rows) {
if (_rows < 0) {
std::fill(
std::execution::par_unseq,
std::execution::unseq,
mEnd() + _rows * mCols, mEnd(), T()
);
} else {
std::fill(
std::execution::par_unseq,
std::execution::unseq,
mBegin(), mBegin() + _rows * mCols, T()
);
}
Expand Down Expand Up @@ -1547,12 +1547,12 @@ class Map2D final {
if (_rows % mRows) {
if (_rows < 0) {
std::rotate(
std::execution::par_unseq,
std::execution::unseq,
mBegin(), mBegin() - _rows * mCols, mEnd()
);
} else {
std::rotate(
std::execution::par_unseq,
std::execution::unseq,
mBegin(), mEnd() - _rows * mCols, mEnd()
);
}
Expand Down Expand Up @@ -1596,7 +1596,7 @@ class Map2D final {
*/
Map2D& reverse() {
std::reverse(
std::execution::par_unseq,
std::execution::unseq,
mBegin(), mEnd()
);
return *this;
Expand Down Expand Up @@ -1624,7 +1624,7 @@ class Map2D final {
Map2D& reverseX() {
for (auto& row : *this) {
std::reverse(
std::execution::par_unseq,
std::execution::unseq,
row.begin(), row.end()
);
}
Expand Down
1 change: 0 additions & 1 deletion src/Systems/CHIP8/Cores/SCHIP_MODERN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ SCHIP_MODERN::SCHIP_MODERN()
: mDisplayBuffer{ {cScreenSizeY, cScreenSizeX} }
{
if (getCoreState() != EmuState::FAILED) {
//Quirk.wrapSprite = true;

copyGameToMemory(mMemoryBank.data(), cGameLoadPos);
copyFontToMemory(mMemoryBank.data(), 0x0, 0xF0);
Expand Down

0 comments on commit deaa637

Please sign in to comment.