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

Function main

cpp/3_CUDA_Features/bindlessTexture/bindlessTexture.cpp:364–420  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

362// Program main
363////////////////////////////////////////////////////////////////////////////////
364int main(int argc, char **argv)
365{
366 sdkCreateTimer(&timer);
367
368 pArgc = &argc;
369 pArgv = argv;
370
371 char *ref_file = NULL;
372
373#if defined(__linux__)
374 setenv("DISPLAY", ":0", 0);
375#endif
376
377 printf("%s Starting...\n\n", sSDKsample);
378
379 if (checkCmdLineFlag(argc, (const char **)argv, "file")) {
380 fpsLimit = frameCheckNumber;
381 getCmdLineArgumentString(argc, (const char **)argv, "file", &ref_file);
382 }
383
384 srand(15234);
385
386 // use command-line specified CUDA device, otherwise use device with highest
387 // Gflops/s
388 findCudaDevice(argc, (const char **)argv);
389
390 if (!ref_file) {
391 initGL(&argc, argv);
392
393 // OpenGL buffers
394 initGLBuffers();
395 }
396
397 if (!checkCudaCapabilities(3, 0)) {
398 cleanup();
399
400 exit(EXIT_WAIVED);
401 }
402
403 loadImageData(argv[0]);
404
405 if (ref_file) {
406 runAutoTest(ref_file, argv[0]);
407 }
408
409 printf("Press space to toggle animation\n"
410 "Press '+' and '-' to change lod level\n"
411 "Press 'r' to randomize virtual atlas\n");
412
413#if defined(__APPLE__) || defined(MACOSX)
414 atexit(cleanup_all);
415#else
416 glutCloseFunc(cleanup_all);
417#endif
418
419 glutMainLoop();
420}

Callers

nothing calls this directly

Calls 10

sdkCreateTimerFunction · 0.85
checkCmdLineFlagFunction · 0.85
getCmdLineArgumentStringFunction · 0.85
findCudaDeviceFunction · 0.85
checkCudaCapabilitiesFunction · 0.85
initGLFunction · 0.70
initGLBuffersFunction · 0.70
cleanupFunction · 0.70
loadImageDataFunction · 0.70
runAutoTestFunction · 0.70

Tested by

no test coverage detected