I wrote teh following Function:
void KleineTestfunktion( void )
{
uchar4 *pToTest;
cudaMalloc( (void**) &pToTest, 3 * 3 * sizeof(uchar4) );
uchar4 tmp = { 0x00, 0x00, 0x00, 0x00 };
for(int i = 0; i < 9; i++)
{
// If I uncommend the following line, the execution fails
//*(pToTest + i) = tmp;
tmp.x ++; tmp.y ++; tmp.z ++; tmp.w ++;
}
cudaFree(pToTest);
}
I tried to write the “tmp”-uchar4 to the memory. Why it does not work?
Thanks for ur help!
EDIT:
I found out:
If i fill the memory with a kernel it runs.
But why do i have to use a kernel?