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

Function processArgs

cpp/4_CUDA_Libraries/batchCUBLAS/batchCUBLAS.cpp:282–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280//==============================================================================
281
282static int processArgs(int argc, char *argv[], struct gemmOpts *opts)
283{
284 int error = 0;
285 int oldError;
286 memset(opts, 0, sizeof(*opts));
287 static char default_type[] = "d"; // default double
288 opts->elem_type = default_type;
289 opts->N = 10;
290
291 while (argc) {
292 oldError = error;
293
294 if (*argv[0] == SWITCH_CHAR) {
295 switch (*(argv[0] + 1)) {
296 case 'm':
297 opts->m = (int)atol(argv[0] + 2);
298 break;
299
300 case 'n':
301 opts->n = (int)atol(argv[0] + 2);
302 break;
303
304 case 'k':
305 opts->k = (int)atol(argv[0] + 2);
306 break;
307
308 case 'N':
309 opts->N = (int)atol(argv[0] + 2);
310 break;
311
312 default:
313 break;
314 }
315 }
316
317 if (error > oldError) {
318 fprintf(stderr, "Invalid switch '%c%s'\n", SWITCH_CHAR, argv[0] + 1);
319 }
320
321 argc -= 1;
322 argv++;
323 }
324
325 return error;
326}
327
328template <typename T_ELEM>
329static int TESTGEN(gemm)(const struct gemmOpts *opts,

Callers 1

batchCUBLAS.cppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected