Skip to content

Commit 0296687

Browse files
committed
Added operating system info to OpenCL device driver version printout
1 parent 1cf525c commit 0296687

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/opencl.hpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,21 @@ struct Device_Info {
8383

8484
string get_opencl_c_code(); // implemented in kernel.hpp
8585
inline void print_device_info(const Device_Info& d) { // print OpenCL device info
86+
#if defined(_WIN32)
87+
const string os = "Windows";
88+
#elif defined(__linux__)
89+
const string os = "Linux";
90+
#elif defined(__APPLE__)
91+
const string os = "macOS";
92+
#else // unknown operating system
93+
const string os = "unknown operating system";
94+
#endif // operating system
8695
println("\r|----------------.------------------------------------------------------------|");
87-
println("| Device ID | "+alignl(58, to_string(d.id) )+" |");
88-
println("| Device Name | "+alignl(58, d.name )+" |");
89-
println("| Device Vendor | "+alignl(58, d.vendor )+" |");
90-
println("| Device Driver | "+alignl(58, d.driver_version )+" |");
91-
println("| OpenCL Version | "+alignl(58, d.opencl_c_version )+" |");
96+
println("| Device ID | "+alignl(58, to_string(d.id) )+" |");
97+
println("| Device Name | "+alignl(58, d.name )+" |");
98+
println("| Device Vendor | "+alignl(58, d.vendor )+" |");
99+
println("| Device Driver | "+alignl(58, d.driver_version+" ("+os+")")+" |");
100+
println("| OpenCL Version | "+alignl(58, d.opencl_c_version )+" |");
92101
println("| Compute Units | "+alignl(58, to_string(d.compute_units)+" at "+to_string(d.clock_frequency)+" MHz ("+to_string(d.cores)+" cores, "+to_string(d.tflops, 3)+" TFLOPs/s)")+" |");
93102
println("| Memory, Cache | "+alignl(58, to_string(d.memory)+" MB, "+to_string(d.global_cache)+" KB global / "+to_string(d.local_cache)+" KB local")+" |");
94103
println("| Buffer Limits | "+alignl(58, to_string(d.max_global_buffer)+" MB global, "+to_string(d.max_constant_buffer)+" KB constant")+" |");

0 commit comments

Comments
 (0)