Error: Unaligned memory accesses not supported

When I compiling the code:

char *sNextWord;
char *tmp,


sNextWord[lengthWord-1] = *(tmp);

I have error:

Error: Unaligned memory accesses not supported

Code like this should work. Are you using the latest version of CUDA? Can you post the minimum amount of code it takes to reproduce the problem?

My code:

device int incParolaDiN(int n,int lunghezzaParolaMax,char *caratteriPossibili,char *sNextParola){

char *tmp;

int lunghezzaParola = gpu_strlen(sNextParola);

int numeroCaratteri = gpu_strlen(caratteriPossibili);

int NCaratteriMancanti = 0;

if(lunghezzaParolaMax+1 <= lunghezzaParola){

    return 1;    //ho raggiunto il limite max

}

/***********************************************************

* Cerco la posizione dell'ultimo carattere della parola 

* corrente all'interno del dizionario dei caratteri

***********************************************************/

tmp = (gpu_strchr(caratteriPossibili,sNextParola[lunghezzaParola-1]));

NCaratteriMancanti = numeroCaratteri - ((int)(tmp - caratteriPossibili)+n);

//Semplice incremento

if(NCaratteriMancanti > 0){

	

	sNextParola[lunghezzaParola-1] = *(tmp+n);

    return 0;

}

}

Solution?

I meant you should post something complete that can be compiled. If you can try to remove as many lines of code as you can, that’d be great.

Btw, you need another return statement at the end.

P.S. what do your pointers point to? Local memory?

I resolved using int instead of char