summaryrefslogtreecommitdiff
path: root/boost/compute/system.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:41:18 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:43:11 +0900
commitf763a99a501650eff2c60288aa6f10ef916d769e (patch)
tree02af7e13f9a38c888ebf340fe764cbe7dae99da9 /boost/compute/system.hpp
parent5cde13f21d36c7224b0e13d11c4b49379ae5210d (diff)
downloadboost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.gz
boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.bz2
boost-f763a99a501650eff2c60288aa6f10ef916d769e.zip
Imported Upstream version 1.62.0upstream/1.62.0
Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/compute/system.hpp')
-rw-r--r--boost/compute/system.hpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/boost/compute/system.hpp b/boost/compute/system.hpp
index f205fece7d..e6ed353d68 100644
--- a/boost/compute/system.hpp
+++ b/boost/compute/system.hpp
@@ -184,14 +184,16 @@ public:
cl_uint count = 0;
clGetPlatformIDs(0, 0, &count);
- std::vector<cl_platform_id> platform_ids(count);
- clGetPlatformIDs(count, &platform_ids[0], 0);
-
std::vector<platform> platforms;
- for(size_t i = 0; i < platform_ids.size(); i++){
- platforms.push_back(platform(platform_ids[i]));
- }
+ if(count > 0)
+ {
+ std::vector<cl_platform_id> platform_ids(count);
+ clGetPlatformIDs(count, &platform_ids[0], 0);
+ for(size_t i = 0; i < platform_ids.size(); i++){
+ platforms.push_back(platform(platform_ids[i]));
+ }
+ }
return platforms;
}