Giter Club home page Giter Club logo

Comments (4)

DTolm avatar DTolm commented on June 24, 2024

Hello,

creating app structure like this VkFFTApplication app = {}; makes it scope local - meaning it will be deallocated once vkfft_create call finishes. What you want is likely to call VkFFTApplication app = {}; outside the vkfft_create and then pass the pointer &app to vkfft_create. Or you can manually allocate memory for app in vkfft_create with VkFFTApplication* app = (VkFFTApplication*)calloc(1, sizeof(VkFFTApplication)); and free it later in vkfft_free call, for example.

Best regards,
Dmitrii

from vkfft.

ShatrovOA avatar ShatrovOA commented on June 24, 2024

Hello Dmitrii,

Thank you for your quick response.
Second option really made it work.

I changed subroutine signature a bit:

void vkfft_create(int size, int how_many, int double_precision, VkFFTApplication **app_handle) {
  VkFFTConfiguration config = {};
  VkFFTApplication* app = (VkFFTApplication*)calloc(1, sizeof(VkFFTApplication));
  // Populating config values
  // ...
  VKFFT_CALL(initializeVkFFT(app, config));
  *app_handle = app;
}

and I can clearly see that app is pointing to different locations.
Thank you.

I have another unrelated question.
Are there any memory estimations of memory that VkFFT will allocate internally for M batches of DCT2 transforms of size N?

from vkfft.

DTolm avatar DTolm commented on June 24, 2024

For DCT2 the additional memory usage depends on the system size. If system fits in shared memory of a GPU (<4096, approximately) it will not use additional memory (regardless of M). for bigger sequences it depends if system is decomposable as small primes or can be done with Rader algorithm - then the additional size will be 2x the system size (M*N). If the system uses Bluestein's algorithm, the size will be 4x. Some small additional memory is used for twiddle factors (at least M times smaller).

from vkfft.

ShatrovOA avatar ShatrovOA commented on June 24, 2024

Thanks for clarification.
I'm closing this issue.

from vkfft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.