MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / main

Function main

cpp/0_Introduction/simpleTexture3D/simpleTexture3D.cpp:350–397  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Program main ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

348// Program main
349////////////////////////////////////////////////////////////////////////////////
350int main(int argc, char **argv)
351{
352 pArgc = &argc;
353 pArgv = argv;
354
355 char *ref_file = NULL;
356
357#if defined(__linux__)
358 setenv("DISPLAY", ":0", 0);
359#endif
360
361 printf("%s Starting...\n\n", sSDKsample);
362
363 if (checkCmdLineFlag(argc, (const char **)argv, "file")) {
364 fpsLimit = frameCheckNumber;
365 getCmdLineArgumentString(argc, (const char **)argv, "file", &ref_file);
366 }
367
368 // use command-line specified CUDA device, otherwise use device with highest
369 // Gflops/s
370 findCudaDevice(argc, (const char **)argv);
371
372 if (ref_file) {
373 loadVolumeData(argv[0]);
374 runAutoTest(ref_file, argv[0]);
375 }
376 else {
377 initGL(&argc, argv);
378
379 // OpenGL buffers
380 initGLBuffers();
381
382 loadVolumeData(argv[0]);
383 }
384
385 printf("Press space to toggle animation\n"
386 "Press '+' and '-' to change displayed slice\n");
387
388#if defined(__APPLE__) || defined(MACOSX)
389 atexit(cleanup);
390#else
391 glutCloseFunc(cleanup);
392#endif
393
394 glutMainLoop();
395
396 exit(EXIT_SUCCESS);
397}

Callers

nothing calls this directly

Calls 7

checkCmdLineFlagFunction · 0.85
getCmdLineArgumentStringFunction · 0.85
findCudaDeviceFunction · 0.85
loadVolumeDataFunction · 0.85
runAutoTestFunction · 0.70
initGLFunction · 0.70
initGLBuffersFunction · 0.70

Tested by

no test coverage detected