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

Function initialize

cpp/5_Domain_Specific/bicubicTexture/bicubicTexture.cpp:599–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597}
598
599void initialize(int argc, char **argv)
600{
601 printf("[%s] (OpenGL Mode)\n", sSDKsample);
602
603 initGL(&argc, argv);
604
605 // use command-line specified CUDA device, otherwise use device with highest
606 // Gflops/s
607 int devID = findCudaDevice(argc, (const char **)argv);
608
609 // get number of SMs on this GPU
610 cudaDeviceProp deviceProps;
611 checkCudaErrors(cudaGetDeviceProperties(&deviceProps, devID));
612 printf("CUDA device [%s] has %d Multi-Processors\n", deviceProps.name, deviceProps.multiProcessorCount);
613
614 // Create the timer (for fps measurement)
615 sdkCreateTimer(&timer);
616
617 // load image from disk
618 loadImageData(argc, argv);
619
620 printf("\n"
621 "\tControls\n"
622 "\t=/- : Zoom in/out\n"
623 "\tb : Run Benchmark g_FilterMode\n"
624 "\tc : Draw Bicubic Spline Curve\n"
625 "\t[esc] - Quit\n\n"
626
627 "\tPress number keys to change filtering g_FilterMode:\n\n"
628 "\t1 : nearest filtering\n"
629 "\t2 : bilinear filtering\n"
630 "\t3 : bicubic filtering\n"
631 "\t4 : fast bicubic filtering\n"
632 "\t5 : Catmull-Rom filtering\n\n");
633
634 initGLBuffers();
635
636#if USE_BUFFER_TEX
637 fprog = compileASMShader(GL_FRAGMENT_PROGRAM_ARB, shaderCode);
638
639 if (!fprog) {
640 exit(EXIT_SUCCESS);
641 }
642
643#endif
644}
645
646void initGL(int *argc, char **argv)
647{

Callers 1

mainFunction · 0.85

Calls 6

findCudaDeviceFunction · 0.85
sdkCreateTimerFunction · 0.85
initGLFunction · 0.70
loadImageDataFunction · 0.70
initGLBuffersFunction · 0.70
compileASMShaderFunction · 0.70

Tested by

no test coverage detected