1
나는 간단한 테스트를 컴파일하고 실행하여 cmake의 단계에 nvcc
의 컴퓨팅 능력 플래그를 설정하려고 : cmake의 try_run에서 nvcc를 실행하려면 어떻게해야합니까?
#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에 의해 목표를 컴파일 할 수 있도록하는 방법을
here를 참조하십시오.
cuda_compile
을 추가하면 바이너리 파일도 생성되지 않습니다.
단계에서 .cu
- 파일을 컴파일하고 execute_process
을 실행하여 컴파일 플래그를 올바르게 설정할 수 있습니까?