レースチェックツールが自分のアプリケーションでメモリレースを報告しました。私はそれをCUFFT exec関数に分離しました。cuda-memcheck racecheckがcufftでエラーを報告するのはなぜですか?
何か間違っていますか?そうでない場合、どのようにしてレースチェックでこれを無視することができますか?ここで
はcuda-memcheck --tool racecheck
で実行した場合は、あなたは何も悪いことをしていない
========= Race reported between Write access at 0x00000a30 in void spVector0128C::kernelTex<unsigned int, float, fftDirection_t=-1, unsigned int=8, unsigned int=8, LUT, ALL, WRITEBACK>(kernel_parameters_t<fft_tex_t, unsigned int, float>)
========= and Read access at 0x00000a70 in void spVector0128C::kernelTex<unsigned int, float, fftDirection_t=-1, unsigned int=8, unsigned int=8, LUT, ALL, WRITEBACK>(kernel_parameters_t<fft_tex_t, unsigned int, float>) [4 hazards]
のような「危険」の例
#include <cufft.h>
#include <iostream>
#define ck(cmd) if (cmd) { std::cerr << "error at line " << __LINE__ << std::endl;exit(1);}
int main(int argc,char ** argv)
{
int nfft=128;
cufftComplex * ibuf;
cufftComplex * obuf;
ck(cudaMalloc((void**)&ibuf, sizeof(cufftComplex)*nfft));
ck(cudaMalloc((void**)&obuf, sizeof(cufftComplex)*nfft));
ck(cudaMemset(ibuf,0,sizeof(cufftComplex)*nfft));
cufftHandle fft;
ck(cufftPlanMany(&fft,1,&nfft,
NULL,1,nfft,
NULL,1,nfft,
CUFFT_C2C,1));
ck(cufftExecC2C(fft,ibuf,obuf,CUFFT_FORWARD));
ck(cudaDeviceSynchronize());
cufftDestroy(fft);
ck(cudaFree(ibuf));
ck(cudaFree(obuf));
return 0;
}
FWIW、私はcuFFTに対してnVidiaバグ#1823484を提出しました。多分それはcuda-memcheckに再割り当てされるでしょう。 –