1 // 2 // Copyright (c) 2017-2019 The Khronos Group Inc. 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 #ifndef _deviceInfo_h 17 #define _deviceInfo_h 18 19 // Configuration 20 #include "../config.hpp" 21 22 #include <string> 23 24 #include <CL/opencl.h> 25 26 /* Helper to return a string containing device information for the specified 27 * device info parameter. */ 28 std::string get_device_info_string(cl_device_id device, 29 cl_device_info param_name); 30 31 /* Determines if an extension is supported by a device. */ 32 int is_extension_available(cl_device_id device, const char *extensionName); 33 34 /* Returns a string containing the supported extensions list for a device. */ 35 std::string get_device_extensions_string(cl_device_id device); 36 37 /* Returns a string containing the supported IL version(s) for a device. */ 38 std::string get_device_il_version_string(cl_device_id device); 39 40 /* Returns a string containing the supported OpenCL version for a device. */ 41 std::string get_device_version_string(cl_device_id device); 42 43 /* Returns a string containing the device name. */ 44 std::string get_device_name(cl_device_id device); 45 46 // Returns the maximum size in bytes for Kernel Parameters 47 size_t get_max_param_size(cl_device_id device); 48 49 #endif // _deviceInfo_h 50