leon 5 месяцев назад
Родитель
Сommit
548112c91f
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      src/resnet.cu

+ 2 - 3
src/resnet.cu

@@ -267,10 +267,9 @@ static __global__ void softmax(float *predict, int length)
 }
 
 static void classfier_softmax(float *predict,int length, cudaStream_t stream) {
-  dim3 grid((dst_width + 31) / 32, (dst_height + 31) / 32);
-  dim3 block(32, 32);
+  int block_size = 256;
 
-  checkKernel(softmax<<<grid, block, 0, stream>>>(predict, length));
+  checkKernel(softmax<<<1, block_size, block_size * sizeof(float), stream>>>(predict, length));
 }
 
 class InferImpl : public Infer {