@echo off

if exist output (
  rmdir /S /Q output
)
if exist input (
  rmdir /S /Q input
)

if exist TGMAIN-CUDA (
  echo Execute TGMAIN-CUDA.
  cd TGMAIN-CUDA
) else if exist TGMAIN (
  echo Execute TGMAIN.
  cd TGMAIN
)else (
  echo TGMAIN or TGMAIN-CUDA is required.
  goto PAUSE
)

xcopy /I /Q bench ..\input
echo;
tgmain.exe TG-STD
cd ..

echo;
if exist output\0000.png (
  echo The conversion was successful.
) else (
  echo The conversion was failed.
)

:PAUSE
pause
