Browse Source

norm kernel

master
anapt 7 years ago
parent
commit
d77556e77c
  1. 6
      mean_shift_cuda/meanshift_gpu_utils.cu

6
mean_shift_cuda/meanshift_gpu_utils.cu

@ -353,8 +353,8 @@ void calculate_norm(Matrix d_mean_shift_vector, double *current_norm){
int size; int size;
static bool first_iter = true; static bool first_iter = true;
// gets max block size supported from the device // gets max block size supported from the device
static int max_block_size = device_properties.maxThreadsPerBlock;
static int requested_block_size = (int)(max_block_size / d_mean_shift_vector.width); static int requested_block_size = device_properties.maxThreadsPerBlock;
bool block_size_too_big = true; bool block_size_too_big = true;
dim3 dimBlock; dim3 dimBlock;
@ -364,7 +364,7 @@ void calculate_norm(Matrix d_mean_shift_vector, double *current_norm){
dimBlock.y = 1; dimBlock.y = 1;
dimGrid.x = (d_mean_shift_vector.height + dimBlock.x - 1) / dimBlock.x; dimGrid.x = (d_mean_shift_vector.height + dimBlock.x - 1) / dimBlock.x;
dimGrid.y = 1; dimGrid.y = 1;
norm<<<dimGrid, dimBlock>>>(d_mean_shift_vector, current_norm); norm<<<dimGrid, dimBlock>>>(d_mean_shift_vector, current_norm);
if (cudaGetLastError() != cudaSuccess){ if (cudaGetLastError() != cudaSuccess){
--requested_block_size; --requested_block_size;

Loading…
Cancel
Save