diff options
author | Vidhya Sudhan Loganathan <vidhyasudhan.loganathan@arm.com> | 2018-04-10 12:23:22 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:49:16 +0000 |
commit | eb8a399ba655b85c6854676832eb11b0af4108fe (patch) | |
tree | 9d3c6d9f4979036ce5d828a61eaaf0d3df2e566f /src/core/CL/CLHelpers.cpp | |
parent | 3ebef32816435516f68cefba689dba7216464154 (diff) | |
download | ComputeLibrary-eb8a399ba655b85c6854676832eb11b0af4108fe.tar.gz |
COMPMID-994 : Check cl_arm_printf is supported in the CLScheduler
Introduced static and dynamic checks before using printf vendor extension features (callbacks and buffers)
Change-Id: Ib38cb3d8591bbb482d02a41918f4b52efde75267
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/126751
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/core/CL/CLHelpers.cpp')
-rw-r--r-- | src/core/CL/CLHelpers.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp index eb1b06e7a8..378e910f21 100644 --- a/src/core/CL/CLHelpers.cpp +++ b/src/core/CL/CLHelpers.cpp @@ -93,12 +93,6 @@ arm_compute::GPUTarget get_midgard_target(const std::string &version) } } -bool extension_support(const cl::Device &device, const char *extension_name) -{ - std::string extensions = device.getInfo<CL_DEVICE_EXTENSIONS>(); - auto pos = extensions.find(extension_name); - return (pos != std::string::npos); -} } // namespace namespace arm_compute @@ -253,12 +247,12 @@ GPUTarget get_arch_from_target(GPUTarget target) bool non_uniform_workgroup_support(const cl::Device &device) { - return extension_support(device, "cl_arm_non_uniform_work_group_size"); + return device_supports_extension(device, "cl_arm_non_uniform_work_group_size"); } bool fp16_support(const cl::Device &device) { - return extension_support(device, "cl_khr_fp16"); + return device_supports_extension(device, "cl_khr_fp16"); } CLVersion get_cl_version(const cl::Device &device) @@ -284,4 +278,12 @@ CLVersion get_cl_version(const cl::Device &device) return CLVersion::UNKNOWN; } + +bool device_supports_extension(const cl::Device &device, const char *extension_name) +{ + std::string extensions = device.getInfo<CL_DEVICE_EXTENSIONS>(); + auto pos = extensions.find(extension_name); + return (pos != std::string::npos); +} + } // namespace arm_compute |