how to pass a string and specify the device also in the command line?

Hi, there,

My initilization codes are

[indent][indent]
if (cutCheckCmdLineFlag(argc, (const char**)argv, “device”))
cutilDeviceInit(argc,argv);
else
cudaSetDevice(cutGetMaxGflopsDeviceId());
[/indent][/indent]

(1) If I run the codes by ./kun.out, it is fine.
(2) If I run the codes by ./kun.out -device=0, it also works.
(3) If I run the codes by ./kun.out OUTPUTFILE.DAT, it’s fine.
(3) But if I use ./kun.out -device=0 OUTPUTFILE.DAT, it says
Error when parsing command line argument string.
I want to specify the device and the name of the outputfile both b/c I want to run the codes many times and store all the output.

Any suggestions?

Thanks

Kun

The right answer is use another command argument parser or write your own. cutil is intended purely for use in SDK example code, not for anything else.