在核函数内是否可以调用其他函数

在kernel中调用intToByte函数,好像编译出错。不能再kernel内调用其他函数吗?

void intToByte(int i,byte *bytes,int size = 4)
{
memset(bytes,0,sizeof(byte) * size);
bytes[0] = (byte) (0xff & i);
bytes[1] = (byte) ((0xff00 & i) >> 8);
bytes[2] = (byte) ((0xff0000 & i) >> 16);
bytes[3] = (byte) ((0xff000000 & i) >> 24);
}

global void Kernel(byte *c, const int a)
{
int i = threadIdx.x;
intToByte(a[i],c+i
4);
}

抱歉~忘加__device__了。。。。