Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tinebp committed Aug 7, 2024
2 parents 7cdfac8 + 32497e1 commit e86eeab
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions tests/regression/stencil3d/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,19 @@ static void stencil_cpu(TYPE *out, const TYPE *in, uint32_t width, uint32_t heig

// Check bounds and replicate the boundary values
if (nx < 0)
{
nx = 0;
}
{nx = 0;}
else if (nx >= (int)width)
{
nx = width - 1;
}
{nx = width - 1;}

if (ny < 0)
{
ny = 0;
}
{ny = 0;}
else if (ny >= (int)height)
{
ny = height - 1;
}
{ny = height - 1;}

if (nz < 0)
{
nz = 0;
}
{nz = 0;}
else if (nz >= (int)depth)
{
nz = depth - 1;
}
{nz = depth - 1;}

// Sum up the values
sum += in[nz * width * height + ny * width + nx];
Expand Down Expand Up @@ -238,8 +228,8 @@ int main(int argc, char *argv[])
uint32_t buf_size = size_cubed * sizeof(TYPE);

std::cout << "data type: " << Comparator<TYPE>::type_str() << std::endl;
std::cout << "matrix size: " << size << "x" << size << std::endl;
std::cout << "block size: " << block_size << "x" << block_size << std::endl;
std::cout << "matrix size: " << size << "x" << size << "x" << size << std::endl;
std::cout << "block size: " << block_size << "x" << block_size << "x" << block_size << std::endl;

kernel_arg.grid_dim[0] = size / block_size;
kernel_arg.grid_dim[1] = size / block_size;
Expand Down

0 comments on commit e86eeab

Please sign in to comment.