__global__ void sub(char*a,char*b,char*c) //c=a-b
{
__shared__ char d[];
int temp=0;
int tid=threadIdx.x+blockIdx.x*blockDim;
if(tid<) //这个不用管
{
int d[tid]=a[tid]-b[tid];
}
__syncthreads();
while(d[dit]<0||temp<0)
{
temp=0;
d[dit]+=10;
__syncthreads();
d[tid+1]-=1;
__syncthreads();
temp=d[tid];
}
c[tid]=d[tid];
}
|