MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / main

Function main

src/client/client.cpp:47–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45namespace po = boost::program_options;
46
47int main(int argc, char *argv[])
48{
49 size_t M;
50 size_t N;
51 size_t K;
52 cl_double alpha;
53 cl_double beta;
54 cl_uint profileCount;
55 cl_uint apiCallCount;
56 cl_uint commandQueueFlags = 0;
57 cl_device_type deviceType = CL_DEVICE_TYPE_GPU;
58 int order_option;
59 //clblasOrder order;
60 //clblasTranspose transA;
61 //clblasTranspose transB;
62 int transA_option;
63 int transB_option;
64 size_t lda;
65 size_t ldb;
66 size_t ldc;
67 size_t offA;
68 size_t offBX;
69 size_t offCY;
70 std::string function;
71 std::string precision;
72 std::string roundtrip;
73 std::string memalloc;
74 int side_option;
75 int uplo_option;
76 int diag_option;
77 unsigned int numQueuesToUse;
78 int validate;
79
80 po::options_description desc( "clBLAS client command line options" );
81 desc.add_options()
82 ( "help,h", "produces this help message" )
83 ( "gpu,g", "Force instantiation of an OpenCL GPU device" )
84 ( "cpu,c", "Force instantiation of an OpenCL CPU device" )
85 ( "all,a", "Force instantiation of all OpenCL devices" )
86 ( "useimages", "Use an image-based kernel" )
87 ( "sizem,m", po::value<size_t>( &M )->default_value(128), "number of rows in A and C" )
88 ( "sizen,n", po::value<size_t>( &N )->default_value(128), "number of columns in B and C" )
89 ( "sizek,k", po::value<size_t>( &K )->default_value(128), "number of columns in A and rows in B" )
90 ( "lda", po::value<size_t>( &lda )->default_value(0), "first dimension of A in memory. if set to 0, lda will default to M (when transposeA is \"no transpose\") or K (otherwise)" )
91 ( "ldb", po::value<size_t>( &ldb )->default_value(0), "first dimension of B in memory. if set to 0, ldb will default to K (when transposeB is \"no transpose\") or N (otherwise)" )
92 ( "ldc", po::value<size_t>( &ldc )->default_value(0), "first dimension of C in memory. if set to 0, ldc will default to M" )
93 ( "offA", po::value<size_t>( &offA )->default_value(0), "offset of the matrix A in memory object" )
94 ( "offBX", po::value<size_t>( &offBX )->default_value(0), "offset of the matrix B or vector X in memory object" )
95 ( "offCY", po::value<size_t>( &offCY )->default_value(0), "offset of the matrix C or vector Y in memory object" )
96 ( "alpha", po::value<cl_double>( &alpha )->default_value(1.0f), "specifies the scalar alpha" )
97 ( "beta", po::value<cl_double>( &beta )->default_value(1.0f), "specifies the scalar beta" )
98 ( "order,o", po::value<int>( &order_option )->default_value(1), "0 = row major, 1 = column major" )
99 ( "transposeA", po::value<int>( &transA_option )->default_value(0), "0 = no transpose, 1 = transpose, 2 = conjugate transpose" )
100 ( "transposeB", po::value<int>( &transB_option )->default_value(0), "0 = no transpose, 1 = transpose, 2 = conjugate transpose" )
101 ( "function,f", po::value<std::string>( &function )->default_value("gemm"), "BLAS function to test. Options: gemm, trsm, trmm, gemv, symv, syrk, syr2k" )
102 ( "precision,r", po::value<std::string>( &precision )->default_value("s"), "Options: s,d,c,z" )
103 ( "side", po::value<int>( &side_option )->default_value(0), "0 = left, 1 = right. only used with [list of function families]" ) // xtrsm xtrmm
104 ( "uplo", po::value<int>( &uplo_option )->default_value(0), "0 = upper, 1 = lower. only used with [list of function families]" ) // xsymv xsyrk xsyr2k xtrsm xtrmm

Callers

nothing calls this directly

Calls 15

ReserveMethod · 0.80
setNormalizeMethod · 0.80
ResetMethod · 0.80
pruneOutliersMethod · 0.80
setup_bufferMethod · 0.45
initialize_cpu_bufferMethod · 0.45
initialize_gpu_bufferMethod · 0.45
setup_apiCallCountMethod · 0.45
call_funcMethod · 0.45
roundtrip_funcMethod · 0.45

Tested by

no test coverage detected