Skip to content

Commit

Permalink
Fix additional instance of erroneous empty pencil check. Some Fortran…
Browse files Browse the repository at this point in the history
… module clean up. (#12)

* Use gdim_dist in empty pencil checks. Fix check in cudecompGridDescCreate function.

* Minor cleanup of Fortran module.
  • Loading branch information
romerojosh authored Apr 24, 2023
1 parent 8d8d12a commit 52f566f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/autotune.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ void autotuneTransposeBackend(cudecompHandle_t handle, cudecompGridDesc_t grid_d
CHECK_CUDECOMP(cudecompGetPencilInfo(handle, grid_desc, &pinfo_z, 2, nullptr));

// Skip any decompositions with empty pencils
if (grid_desc->config.pdims[0] > std::min(grid_desc->config.gdims[0], grid_desc->config.gdims[1]) ||
grid_desc->config.pdims[1] > std::min(grid_desc->config.gdims[1], grid_desc->config.gdims[2])) {
if (grid_desc->config.pdims[0] > std::min(grid_desc->config.gdims_dist[0], grid_desc->config.gdims_dist[1]) ||
grid_desc->config.pdims[1] > std::min(grid_desc->config.gdims_dist[1], grid_desc->config.gdims_dist[2])) {
continue;
}

Expand Down
5 changes: 3 additions & 2 deletions src/cudecomp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ cudecompResult_t cudecompGridDescCreate(cudecompHandle_t handle, cudecompGridDes
for (auto& event : grid_desc->events) { CHECK_CUDA(cudaEventCreateWithFlags(&event, cudaEventDisableTiming)); }

// Disable decompositions with empty pencils
if (!autotune_pdims && (std::max(grid_desc->config.pdims[0], grid_desc->config.pdims[1]) >
std::min(grid_desc->config.gdims[1], grid_desc->config.gdims[2]))) {
if (!autotune_pdims &&
(grid_desc->config.pdims[0] > std::min(grid_desc->config.gdims_dist[0], grid_desc->config.gdims_dist[1]) ||
grid_desc->config.pdims[1] > std::min(grid_desc->config.gdims_dist[1], grid_desc->config.gdims_dist[2]))) {
THROW_NOT_SUPPORTED("grid descriptor settings yields a distribution with empty pencils");
}

Expand Down
2 changes: 2 additions & 0 deletions src/cudecomp_m.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module cudecomp
use, intrinsic :: iso_c_binding
use, intrinsic :: iso_fortran_env, only: int64, real32, real64
use cudafor
private :: cudafor

! enumerators

Expand Down Expand Up @@ -601,6 +602,7 @@ contains
end function cudecompGetPencilInfo

function cudecompGetHaloWorkspaceSize(handle, grid_desc, axis, halo_extents, workspace_size) result(res)
implicit none
type(cudecompHandle) :: handle
type(cudecompGridDesc) :: grid_desc
integer :: axis
Expand Down

0 comments on commit 52f566f

Please sign in to comment.