Hi all
I’m tryng tomultiply a scalar for an array. my array has M*N elements and it is allocated with cudamallocpitch.
i think there’s something wrong in my kernel
can anybody help me?
global void kernel(int vet, int pitch, int k)
{
int iy = blockIdx.yblockDim.y + threadIdx.y;
int ix = blockIdx.xblockDim.x + threadIdx.x;
int r= (int*)((char*)vet + iy * pitch);
r[ix]=k*r[ix];
}
Hi all
I’m tryng tomultiply a scalar for an array. my array has M*N elements and it is allocated with cudamallocpitch.
i think there’s something wrong in my kernel
can anybody help me?
global void kernel(int vet, int pitch, int k)
{
int iy = blockIdx.yblockDim.y + threadIdx.y;
int ix = blockIdx.xblockDim.x + threadIdx.x;
int r= (int*)((char*)vet + iy * pitch);
r[ix]=k*r[ix];
}