solana-perf-libs
solana-perf-libs copied to clipboard
Opencl platform and device selection
This set of changes introduces a way to select the platform and device for OpenCL and is used for the binary cl_ed25519_verify
Usage example: src/debug/cl_ed25519_verify.exe -h usage: src/debug/cl_ed25519_verify [-v] <num_signatures> <num_elems> <num_sigs_per_packet> <num_threads> <num_iterations> <use_non_default_stream> <cl_platform_id> <cl_device_id>
$ ./cl_ed25519_verify 100000 1 1 1 1 1 1 2 OpenCL platform query & init... OpenCL init devices query type: ALL Platforms found: 2 Platform 0 Intel(R) Corporation OpenCL 1.2 LINUX Devices found 1 Device 0 Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz Platform 1 NVIDIA Corporation OpenCL 1.2 CUDA 9.1.84 Devices found 3 Device 0 Tesla K40m Device 1 Tesla K40m Device 2 Tesla K40m <----- SELECTED Compiling sha256 kernels Compiling verify kernels time diff: 157882.000000 total: 100000 signs/sec: 633384.426344 time diff: 1380897.000000 total: 100000 verifies/sec: 72416.697263
$ ./cl_ed25519_verify.exe 10000 1 1 1 1 1 1 0 OpenCL platform query & init... OpenCL init devices query type: ALL Platforms found: 2 Platform 0 Intel(R) Corporation OpenCL 1.2 Devices found 1 Device 0 Intel(R) Core(TM) i3-3250 CPU @ 3.50GHz Platform 1 Advanced Micro Devices, Inc. OpenCL 2.1 AMD-APP (3004.7) Devices found 4 Device 0 Hawaii <----- SELECTED Device 1 Hawaii Device 2 Hawaii Device 3 Fiji Compiling sha256 kernels Compiling verify kernels time diff: 55538.000000 total: 10000 signs/sec: 180056.897980 time diff: 23255.000000 total: 10000 verifies/sec: 430015.050527
$ ./cl_ed25519_verify 1 1 1 1 1 1 0 0 OpenCL platform query & init... OpenCL init devices query type: ALL Platforms found: 2 Platform 0 Intel(R) Corporation OpenCL 1.2 LINUX Devices found 1 Device 0 Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz <----- SELECTED Platform 1 NVIDIA Corporation OpenCL 1.2 CUDA 9.1.84 Devices found 3 Device 0 Tesla K40m Device 1 Tesla K40m Device 2 Tesla K40m Compiling sha256 kernels Compiling verify kernels 8 warnings generated. time diff: 4297.000000 total: 1 signs/sec: 232.720503 time diff: 1835.000000 total: 1 verifies/sec: 544.959128