Home Discussion Performance Optimization and Parallelism Allocating memory to scratch buffer – Week 4 – Coursera

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  rajiv99 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8663

    mohitgahlot14
    Participant

    I am trying to solve one of the assignments on Coursera from Fundamentals of Parallelism on Intel Architecture course. I have stuck in transferring data to the scratch buffer. It seems like I am not able to copy all the data. Can anyone tell what I am doing wrong?

    #include <mkl.h>
    #include <hbwmalloc.h>

    //implement scratch buffer on HBM and compute FFTs, refer instructions on Lab page
    //Here, data is initialized using vsRngUniform Intel MKL Rnadom stream generation function
    void runFFTs( const size_t fft_size, const size_t num_fft, MKL_Complex8 *data, DFTI_DESCRIPTOR_HANDLE *fftHandle) {

    const long buff_size = 1L<<27;
    MKL_Complex8 *buff;
    hbw_posix_memalign((void**) &buff, 4096,sizeof(MKL_Complex8)*buff_size);

    for(size_t i = 0; i <num_fft; i++) {

    buff[i].real = data[i*fft_size].real;
    buff[i].imag = data[i*fft_size].imag;
    DftiComputeForward (*fftHandle, &buff[i]);
    data[i*fft_size].real = buff[i].real;
    data[i*fft_size].imag = buff[i].imag;
    }

    hbw_free(buff);

    }

    #8664

    mohitgahlot14
    Participant

    Solved

    #8669

    ravikrana
    Participant

    Hey , I think you need a separate loop for buff init i.e from 0 to fft_size.

    Can you let me know how you did it ?

    #8761

    rajiv99
    Participant

    I am also doing the same course. And i am stuck on this problem.
    Can you tell what is the solution for this problem.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.