2016-11-10 101 views
0

我在我的咖啡程序中使用cudnn加速。 我在開始時使用cudnn 4,它工作正常,但是當我將cudnn更新到5.0版時,pow功能不起作用。 調用函數是在batch_norm層作爲咖啡cudnn版本4&5

caffe_gpu_powx(variance_.count(), variance_.gpu_data(), Dtype(0.5), variance_.mutable_gpu_data()); 

並調用後的數據不會改變。 pow函數的定義如下,如相同的朱古力github上banch

template <typename Dtype> 
\__global__ void powx_kernel(const int n, const Dtype* a, 
    const Dtype alpha, Dtype* y) 
{ 
    CUDA_KERNEL_LOOP(index, n) 
    {   
     y[index] = pow(a[index], alpha); 
    } 
} 

template <> 
void caffe_gpu_powx<float>(const int N, const float* a, 
    const float alpha, float* y) { 
    // NOLINT_NEXT_LINE(whitespace/operators) 
    powx_kernel<float><<<CAFFE_GET_BLOCKS(N), CAFFE_CUDA_NUM_THREADS>>>(
     N, a, alpha, y); 
} 

回答

1

我做了我所設定的代碼生成「compute_52,sm_52」在與TITAN X的開始一個錯誤,但現在應該將較低的GPU設置爲「compute_20,sm_20」。現在工作正常。

+0

該設置沒有意義。 CUDNN需要計算能力> = 3.0設備才能運行。你真的試圖運行什麼設備? – talonmies