diff options
Diffstat (limited to 'include/internal')
-rw-r--r-- | include/internal/clpp11.h | 6 | ||||
-rw-r--r-- | include/internal/tuning.h | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/internal/clpp11.h b/include/internal/clpp11.h index e70f9000..b834d8b4 100644 --- a/include/internal/clpp11.h +++ b/include/internal/clpp11.h @@ -207,6 +207,12 @@ class Device { return true; } + // Query for a specific type of device or brand + bool IsCPU() const { return Type() == "CPU"; } + bool IsGPU() const { return Type() == "GPU"; } + bool IsAMD() const { return Vendor() == "AMD" || Vendor() == "Advanced Micro Devices, Inc."; } + bool IsARM() const { return Vendor() == "ARM"; } + // Accessor to the private data-member const cl_device_id& operator()() const { return device_; } private: diff --git a/include/internal/tuning.h b/include/internal/tuning.h index 8fc79aff..a44f79d6 100644 --- a/include/internal/tuning.h +++ b/include/internal/tuning.h @@ -61,9 +61,9 @@ void Tuner(int argc, char* argv[]) { printf("* Unsupported precision, skipping this tuning run\n\n"); return; } - isAMD = device.Vendor() == "AMD" || device.Vendor() == "Advanced Micro Devices, Inc."; - isARM = device.Vendor() == "ARM"; - isGPU = device.Type() == "GPU"; + isAMD = device.IsAMD(); + isARM = device.IsARM(); + isGPU = device.IsGPU(); } // Creates input buffers with random data |