FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Optimize strided loop assignment for runtime-contiguous layout types with contiguous assignment by Ivorforce · Pull Request #2810 · xtensor-stack/xtensor · GitHub

Repository navigation

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .hpp  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 5 additions & 3 deletions include/xtensor/core/xassign.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ namespace xt
std::size_t simd_size = inner_loop_size / simd_type::size;
std::size_t simd_rest = inner_loop_size % simd_type::size;

bool e1_is_contiguous = E1::contiguous_layout || e1.is_contiguous();

auto fct_stepper = e2.stepper_begin(e1.shape());
auto res_stepper = e1.stepper_begin(e1.shape());

Expand Down Expand Up @@ -1185,7 +1187,7 @@ namespace xt
fct_stepper.to_begin();

// need to step E1 as well if not contigous assign (e.g. view)
if (!E1::contiguous_layout)
if (!E1::contiguous_layout && !e1_is_contiguous)
{
res_stepper.to_begin();
for (std::size_t i = 0; i < idx.size(); ++i)
Expand Down Expand Up @@ -1260,7 +1262,7 @@ namespace xt
fct_stepper.to_begin();

// need to step E1 as well if not contigous assign (e.g. view)
if (!E1::contiguous_layout)
if (!E1::contiguous_layout && !e1_is_contiguous)
{
res_stepper.to_begin();
for (std::size_t i = 0; i < idx.size(); ++i)
Expand Down Expand Up @@ -1305,7 +1307,7 @@ namespace xt
fct_stepper.to_begin();

// need to step E1 as well if not contigous assign (e.g. view)
if (!E1::contiguous_layout)
if (!E1::contiguous_layout && !e1_is_contiguous)
{
res_stepper.to_begin();
for (std::size_t i = 0; i < idx.size(); ++i)
Expand Down

Back | FazBrowse Home | New Git URL