Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

28 rindas
1.3KB

  1. $ErrorActionPreference = 'Stop'
  2. $vcvars = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat'
  3. $cudaRoot = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2'
  4. $nvcc = Join-Path $cudaRoot 'bin\nvcc.exe'
  5. $src = Join-Path $PSScriptRoot 'internal\demod\gpudemod\native\exports.cu'
  6. $outDir = Join-Path $PSScriptRoot 'internal\demod\gpudemod\build'
  7. $dll = Join-Path $outDir 'gpudemod_kernels.dll'
  8. $lib = Join-Path $outDir 'gpudemod_kernels.lib'
  9. $exp = Join-Path $outDir 'gpudemod_kernels.exp'
  10. if (!(Test-Path $vcvars)) { throw "vcvars64.bat not found at $vcvars" }
  11. if (!(Test-Path $nvcc)) { throw "nvcc.exe not found at $nvcc" }
  12. if (!(Test-Path $src)) { throw "CUDA source not found at $src" }
  13. if (!(Test-Path $outDir)) { New-Item -ItemType Directory -Path $outDir | Out-Null }
  14. Remove-Item $dll,$lib,$exp -Force -ErrorAction SilentlyContinue
  15. $cmd = @"
  16. call "$vcvars" && "$nvcc" -shared "$src" -o "$dll" -cudart=hybrid -Xcompiler "/MD" -arch=sm_75 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90
  17. "@
  18. Write-Host 'Building gpudemod CUDA DLL...' -ForegroundColor Cyan
  19. cmd.exe /c $cmd
  20. if ($LASTEXITCODE -ne 0) { throw 'gpudemod DLL build failed' }
  21. Write-Host "Built: $dll" -ForegroundColor Green