Function parameters limitations

First of all I’m sorry if this has already been discussed, I did search but didn’t find anything…

I’m having a weird problem while trying to pass an array from a C++ cpp file to a function in a .CU file. I’m declaring this function as extern “C” (like every other functions I’m calling this way and which work perfectly).

What I’m trying to pass as an argument to that function, is an array of structs (each struct as a considerable amount of elements).

Somehow, this is giving me bad memory accesses, as I can’t access the right memory location (everything arrives at the .Cu file messed up). I did the exactly same thing using C and C++, the same structs and everything, and there is no problem. So I believe this is somehow related to CUDA, even though I can’t see how that’s possible…

Any ideas? If you need me to clarify this s bit please say so, as this has been driving me crazy since yesterday!

Do you have any code to share? Also, could you describe the following statement a little better:

Okay, I found the problem. It’s related to the double element in one of the structs.

I searched a bit and found there’s an issue with this, but didn’t understand very well.

Tried using -malign-double but it gives me a “nvcc fatal : ‘align-double’: expected a number”, whereas if I use --no-align-double it works (I’m not making use of the double var so far).

So, my doubt no is if I can use de double or not?

Nevermind, got it! Was passing the -malign-double flag to nvcc and not gcc.