mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-24 15:59:03 +00:00
Use std::string for get_device_*_string helpers (#737)
* Use std::string for get_device_*_string helpers Removes need to use BufferOwningPtr to avoid memory leaks. * Rename get_device_info to get_device_info_string Makes it more obvious that it should only be called for device queries that return strings. * Tokenize extensions in is_extension_available Avoids the potential issue where one extension name is a prefix of another. * Throw exception when device info size is 0
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
// Configuration
|
||||
#include "../config.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <CL/opencl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -28,14 +30,14 @@ extern "C" {
|
||||
/* Determines if an extension is supported by a device. */
|
||||
int is_extension_available(cl_device_id device, const char *extensionName);
|
||||
|
||||
/* Returns a newly allocated C string containing the supported extensions list for a device. */
|
||||
char *alloc_and_get_device_extensions_string(cl_device_id device);
|
||||
/* Returns a string containing the supported extensions list for a device. */
|
||||
std::string get_device_extensions_string(cl_device_id device);
|
||||
|
||||
/* Returns a newly allocated C string containing the supported IL version(s) for a device. */
|
||||
char *alloc_and_get_device_il_version_string(cl_device_id device);
|
||||
/* Returns a string containing the supported IL version(s) for a device. */
|
||||
std::string get_device_il_version_string(cl_device_id device);
|
||||
|
||||
/* Returns a newly allocated C string containing the supported OpenCL version for a device. */
|
||||
char *alloc_and_get_device_version_string(cl_device_id device);
|
||||
/* Returns a string containing the supported OpenCL version for a device. */
|
||||
std::string get_device_version_string(cl_device_id device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user