Skip to content

Commit

Permalink
Improve workspace release in getrf*
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-lindquist committed Dec 1, 2023
1 parent 686d38d commit 9aecfd2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
12 changes: 8 additions & 4 deletions src/getrf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,21 @@ int64_t getrf(
}
#pragma omp task depend(inout:column[k])
{
auto panel = A.sub( k, A_nt-1, k, k );
auto left_panel = A.sub( k, A_mt-1, k, k );
auto top_panel = A.sub( k, k, k+1, A_nt-1 );

// Erase remote tiles on all devices including host
panel.releaseRemoteWorkspace();
left_panel.releaseRemoteWorkspace();
top_panel.releaseRemoteWorkspace();

// Update the origin tiles before their
// workspace copies on devices are erased.
panel.tileUpdateAllOrigin();
left_panel.tileUpdateAllOrigin();
top_panel.tileUpdateAllOrigin();

// Erase local workspace on devices.
panel.releaseLocalWorkspace();
left_panel.releaseLocalWorkspace();
top_panel.releaseLocalWorkspace();
}
kk += A.tileNb( k );
}
Expand Down
12 changes: 8 additions & 4 deletions src/getrf_nopiv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,21 @@ int64_t getrf_nopiv(
}
#pragma omp task depend(inout:column[k])
{
auto panel = A.sub(k, A_nt-1, k, k);
auto left_panel = A.sub( k, A_mt-1, k, k );
auto top_panel = A.sub( k, k, k+1, A_nt-1 );

// Erase remote tiles on all devices including host
panel.releaseRemoteWorkspace();
left_panel.releaseRemoteWorkspace();
top_panel.releaseRemoteWorkspace();

// Update the origin tiles before their
// workspace copies on devices are erased.
panel.tileUpdateAllOrigin();
left_panel.tileUpdateAllOrigin();
top_panel.tileUpdateAllOrigin();

// Erase local workspace on devices.
panel.releaseLocalWorkspace();
left_panel.releaseLocalWorkspace();
top_panel.releaseLocalWorkspace();
}
kk += A.tileNb( k );
}
Expand Down
12 changes: 8 additions & 4 deletions src/getrf_tntpiv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,21 @@ int64_t getrf_tntpiv(
}
#pragma omp task depend(inout:column[k])
{
auto panel = A.sub(k, A_nt-1, k, k);
auto left_panel = A.sub( k, A_mt-1, k, k );
auto top_panel = A.sub( k, k, k+1, A_nt-1 );

// Erase remote tiles on all devices including host
panel.releaseRemoteWorkspace();
left_panel.releaseRemoteWorkspace();
top_panel.releaseRemoteWorkspace();

// Update the origin tiles before their
// workspace copies on devices are erased.
panel.tileUpdateAllOrigin();
left_panel.tileUpdateAllOrigin();
top_panel.tileUpdateAllOrigin();

// Erase local workspace on devices.
panel.releaseLocalWorkspace();
left_panel.releaseLocalWorkspace();
top_panel.releaseLocalWorkspace();
}
kk += A.tileNb( k );
}
Expand Down

0 comments on commit 9aecfd2

Please sign in to comment.