Skip to content

Commit

Permalink
update for split brick create/destroy API
Browse files Browse the repository at this point in the history
Co-authored-by: Malcolm Roberts <[email protected]>
  • Loading branch information
evetsso and malcolmroberts authored Oct 10, 2023
1 parent e9d579f commit b1aa38b
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions library/src/amd_detail/hipfft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,19 @@ hipfftResult hipfftMakePlan_internal(hipfftHandle plan,

for(const auto& brick : plan->inBricks)
{
if(rocfft_field_add_brick(inField,
brick.field_lower.data(),
brick.field_upper.data(),
brick.brick_stride.data(),
brick.field_lower.size(),
brick.device,
rocfft_brick_type_normal)
rocfft_brick rbrick = nullptr;
if(rocfft_brick_create(&rbrick,
brick.field_lower.data(),
brick.field_upper.data(),
brick.brick_stride.data(),
brick.field_lower.size(),
brick.device)
!= rocfft_status_success)
throw std::runtime_error("create input brick failed");

if(rocfft_field_add_brick(inField, rbrick) != rocfft_status_success)
throw std::runtime_error("add input brick failed");
rocfft_brick_destroy(rbrick);
}

// inBricks are used for out-of-place transforms
Expand All @@ -761,15 +765,19 @@ hipfftResult hipfftMakePlan_internal(hipfftHandle plan,

for(const auto& brick : plan->outBricks)
{
if(rocfft_field_add_brick(outField,
brick.field_lower.data(),
brick.field_upper.data(),
brick.brick_stride.data(),
brick.field_lower.size(),
brick.device,
rocfft_brick_type_normal)
rocfft_brick rbrick = nullptr;
if(rocfft_brick_create(&rbrick,
brick.field_lower.data(),
brick.field_upper.data(),
brick.brick_stride.data(),
brick.field_lower.size(),
brick.device)
!= rocfft_status_success)
throw std::runtime_error("create output brick failed");

if(rocfft_field_add_brick(outField, rbrick) != rocfft_status_success)
throw std::runtime_error("add output brick failed");
rocfft_brick_destroy(rbrick);
}

// outBricks are used for both sides of in-place transforms,
Expand Down

0 comments on commit b1aa38b

Please sign in to comment.