nvcc簡単なテストをコンパイルして実行することにより、cmake の段階で計算機能フラグを設定しようとしています。
#include <cuda.h>
#include <cuda_runtime.h>
#include <stdio.h>
int main(int argc, char **argv){
cudaDeviceProp dP;
if(cudaSuccess != cudaGetDeviceProperties(&dP, 0)) return 0;
printf("-arch=sm_%d%d\n", dP.major, dP.minor);
return 0;
}
ここでその方法を読みましたがtry_run、gcc だけでターゲットをコンパイルさせてください。を追加するcuda_compileと、バイナリ ファイルも取得されません。
.cuの段階で -fileをコンパイルcmakeして実行し、execute_process正しいコンパイル フラグを設定するにはどうすればよいですか?