### Question:
CudaUtils { private CudaUtils() {} private  CudaUtils(); static boolean hasCuda(); static int getGpuCount(); static int getCudaVersion(); static String getCudaVersionString(); static String getComputeCapability(int device); static MemoryUsage getGpuMemory(Device device);  }### Answer:
@Test public void testCudaUtils() { if (!CudaUtils.hasCuda()) { return; } if (CudaUtils.getGpuCount() == 0) { return; } int cudaVersion = CudaUtils.getCudaVersion(); String smVersion = CudaUtils.getComputeCapability(0); MemoryUsage memoryUsage = CudaUtils.getGpuMemory(Device.gpu()); logger.info("CUDA runtime version: {}, sm: {}", cudaVersion, smVersion); logger.info("Memory usage: {}", memoryUsage); Assert.assertTrue(cudaVersion >= 9020, "cuda 9.2+ required."); List<String> supportedSm = Arrays.asList("37", "52", "60", "61", "70", "75"); Assert.assertTrue(supportedSm.contains(smVersion), "Unsupported cuda sm: " + smVersion); }