MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / _tmain

Function _tmain

src/client/client.cpp:761–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759}
760
761int _tmain( int argc, _TCHAR* argv[] )
762{
763 // This helps with mixing output of both wide and narrow characters to the screen
764 std::ios::sync_with_stdio( false );
765
766 // Define MEMORYREPORT on windows platfroms to enable debug memory heap checking
767#if defined( MEMORYREPORT ) && defined( _WIN32 )
768 TCHAR logPath[ MAX_PATH ];
769 ::GetCurrentDirectory( MAX_PATH, logPath );
770 ::_tcscat_s( logPath, _T( "\\MemoryReport.txt") );
771
772 // We leak the handle to this file, on purpose, so that the ::_CrtSetReportFile() can output it's memory
773 // statistics on app shutdown
774 HANDLE hLogFile;
775 hLogFile = ::CreateFile( logPath, GENERIC_WRITE,
776 FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
777
778 ::_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_WNDW | _CRTDBG_MODE_DEBUG );
779 ::_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_WNDW | _CRTDBG_MODE_DEBUG );
780 ::_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
781
782 ::_CrtSetReportFile( _CRT_ASSERT, hLogFile );
783 ::_CrtSetReportFile( _CRT_ERROR, hLogFile );
784 ::_CrtSetReportFile( _CRT_WARN, hLogFile );
785
786 int tmp = ::_CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
787 tmp |= _CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF;
788 ::_CrtSetDbgFlag( tmp );
789
790 // By looking at the memory leak report that is generated by this debug heap, there is a number with
791 // {} brackets that indicates the incremental allocation number of that block. If you wish to set
792 // a breakpoint on that allocation number, put it in the _CrtSetBreakAlloc() call below, and the heap
793 // will issue a bp on the request, allowing you to look at the call stack
794 // ::_CrtSetBreakAlloc( 1833 );
795
796#endif /* MEMORYREPORT */
797
798 // OpenCL state
799 cl_device_type deviceType = CL_DEVICE_TYPE_ALL;
800 cl_int deviceId = 0;
801 cl_int platformId = 0;
802
803 // FFT state
804
805 clfftResultLocation place = CLFFT_INPLACE;
806 clfftLayout inLayout = CLFFT_COMPLEX_INTERLEAVED;
807 clfftLayout outLayout = CLFFT_COMPLEX_INTERLEAVED;
808 clfftPrecision precision = CLFFT_SINGLE;
809 clfftDirection dir = CLFFT_FORWARD;
810 size_t lengths[ 3 ] = {1,1,1};
811 size_t iStrides[ 4 ] = {0,0,0,0};
812 size_t oStrides[ 4 ] = {0,0,0,0};
813 cl_uint profile_count = 0;
814
815 cl_uint command_queue_flags = 0;
816 size_t batchSize = 1;
817
818

Callers

nothing calls this directly

Calls 4

clfftInitSetupDataFunction · 0.85
clfftGetVersionFunction · 0.85
discoverCLPlatformsFunction · 0.70
prettyPrintCLPlatformsFunction · 0.70

Tested by

no test coverage detected