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
正しいコンパイル フラグを設定するにはどうすればよいですか?