CNugteren / CLBlast

Tuned OpenCL BLAS
Apache License 2.0
1.02k stars 203 forks source link

Unparsed options to tunner are ignored, and better handling of platform/device options #528

Open baryluk opened 4 months ago

baryluk commented 4 months ago

For example:

--platform=1

is ignored, neither used or reported. Either it should be supported, and if not possible, program should exit and not continue when seeing unhanded options.

CLBlast-1.6.2-linux-x86_64$ LD_LIBRARY_PATH=./lib ./bin/clblast_tuner_transpose_fast --platform=1
* Options given/available:
    -platform 0 [=default]
    -device 0 [=default]
    -precision 32 (single) [=default]
    -m 1024 [=default]
    -n 1024 [=default]
    -alpha 2.00 [=default]
    -fraction 1.00 [=default]
    -runs 10 [=default]
    -max_l2_norm 0.00 [=default]

Additionally, it would be nice for the platform and device used, be actually printed, similar to clinfo -l:

$ clinfo -l
Platform #0: Portable Computing Language
 `-- Device #0: cpu-haswell-AMD Ryzen Threadripper 2950X 16-Core Processor
Platform #1: AMD Accelerated Parallel Processing
 `-- Device #0: gfx1030

Also Device Type property (CPU, GPU), would be good to have.

Because it is easy to mess things up, (especially if for any reason platform and device order is random) and confirmation should help. Option to also filter by device type (disabled by default) would also be good.

CNugteren commented 4 months ago

Make sense. I'm happy to accept a PR that improves the command-line argument parsing of the tuner, but I don't have time myself to work on this right now.