| 1823 | |
| 1824 | |
| 1825 | int main(int argc, const char** argv) |
| 1826 | { |
| 1827 | donut::log::ConsoleApplicationMode(); |
| 1828 | donut::log::SetMinSeverity(donut::log::Severity::Warning); |
| 1829 | |
| 1830 | if (!ProcessCommandLine(argc, argv)) |
| 1831 | return 1; |
| 1832 | |
| 1833 | if (g_options.printVersion) |
| 1834 | { |
| 1835 | ntc::VersionInfo libVersion = ntc::GetLibraryVersion(); |
| 1836 | printf("LibNTC version: %d.%d.%d %s-%s\n", libVersion.major, libVersion.minor, libVersion.point, |
| 1837 | libVersion.branch, libVersion.commitHash); |
| 1838 | |
| 1839 | ntc::VersionInfo sdkVersion = GetNtcSdkVersion(); |
| 1840 | printf("Tools version: %s-%s\n", sdkVersion.branch, sdkVersion.commitHash); |
| 1841 | |
| 1842 | return 0; |
| 1843 | } |
| 1844 | |
| 1845 | |
| 1846 | if (g_options.listCudaDevices) |
| 1847 | { |
| 1848 | if (ListCudaDevices()) |
| 1849 | return 0; |
| 1850 | else |
| 1851 | return 1; |
| 1852 | } |
| 1853 | |
| 1854 | bool const useGapi = g_options.useVulkan || g_options.useDX12; |
| 1855 | |
| 1856 | bool const graphicsDecompressMode = g_options.inputType == ToolInputType::CompressedTextureSet && useGapi |
| 1857 | && g_options.decompress && !g_options.optimizeBC; |
| 1858 | |
| 1859 | bool const describeMode = g_options.inputType == ToolInputType::CompressedTextureSet && g_options.describe |
| 1860 | && !g_options.decompress && !g_options.saveCompressedFileName; |
| 1861 | |
| 1862 | bool const useCuda = !describeMode && !graphicsDecompressMode; |
| 1863 | |
| 1864 | cudaDeviceProp cudaDeviceProperties{}; |
| 1865 | if (g_options.cudaDevice >= 0 && useCuda) |
| 1866 | { |
| 1867 | int count = 0; |
| 1868 | cudaError_t err = cudaGetDeviceCount(&count); |
| 1869 | if (err == cudaSuccess && count > 0) |
| 1870 | { |
| 1871 | err = cudaGetDeviceProperties(&cudaDeviceProperties, g_options.cudaDevice); |
| 1872 | if (err != cudaSuccess) |
| 1873 | { |
| 1874 | fprintf(stderr, "Call to cudaGetDeviceProperties(%d) failed, error code = %s.\n", |
| 1875 | g_options.cudaDevice, cudaGetErrorName(err)); |
| 1876 | } |
| 1877 | } |
| 1878 | } |
| 1879 | |
| 1880 | CustomAllocator customAllocator; |
| 1881 | |
| 1882 | typedef std::unique_ptr<donut::app::DeviceManager, void(*)(donut::app::DeviceManager*)> DeviceManagerPtr; |
nothing calls this directly
no test coverage detected