Derek
Derek

Reputation: 11915

function call not accepting my arguments

I am getting the following error when I try to call a function that I have overloaded to accept cuComplex which is a structure from CUDA.

../common/Filter.cpp:73: error: no matching function for call to ‘ReaderIF::getData(float2&, int&)’
../readers/ReaderIF.h:63: note: candidates are: virtual bool ReaderIF::getData(cuComplex*, offset)
../readers/ReaderIF.h:65: note: virtual bool ReaderIF::getData(std::complex<float>*, offset)
../readers/ReaderIF.h:82: note: virtual bool ReaderIF::getData(float*, offset)

why am I getting this?

here is how i called the getData function:

cuComplex *h_hhBuff = (cuComplex *)malloc(memsize);
for (int r = 0; r < rows; r++)

{
hhReader->getData(h_hhBuff[r*cols], r);
}

since I am clearly casting the malloc as a cuComplex, shouldnt I be able to call that first candidate?

Upvotes: 2

Views: 87

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272497

You have indexed your pointer, which has dereferenced it, so it is no longer a cuComplex *, but a cuComplex. Perhaps you want to do the following:

hhReader->getData(&h_hhBuff[r*cols], r);

Upvotes: 5

Related Questions