Compiler error with cufft variable operator * doesn't compile
Hi, I updated my Cuda toolkit to v4.1 today, and I have a compiler error with previously working code.
error: calling a host function("operator *") from a __device__/__global function("...") is not allowed.

The compiler thinks I'm trying to call a host function, which I'm not.
My usage is like this:

#include "cufft.h"
__global__ void mykernel (cufftComplex* A) {
[indent]
int i = blockIdx.x * blockDim.x + threadIdx.x;
cufftComplex B;
A[i] = A[i] * B;
[/indent]
}

The error is with the multiplication operator on the line "A[i] = A[i] * B;". It's as if the operator * has not been overloaded correctly.
Any idea of what's going on?
Yes, I included cufft.lib. Yes, the compiler finds the cufft library correctly. Yes, I
Hi, I updated my Cuda toolkit to v4.1 today, and I have a compiler error with previously working code.

error: calling a host function("operator *") from a __device__/__global function("...") is not allowed.



The compiler thinks I'm trying to call a host function, which I'm not.

My usage is like this:



#include "cufft.h"

__global__ void mykernel (cufftComplex* A) {

[indent]

int i = blockIdx.x * blockDim.x + threadIdx.x;

cufftComplex B;

A[i] = A[i] * B;

[/indent]

}



The error is with the multiplication operator on the line "A[i] = A[i] * B;". It's as if the operator * has not been overloaded correctly.

Any idea of what's going on?

Yes, I included cufft.lib. Yes, the compiler finds the cufft library correctly. Yes, I

#1
Posted 04/12/2012 09:26 PM   
Scroll To Top