CLGETPLATFORMIDS(3clc)
π NAME π
okay bestie, so clGetPlatformIDs β it gets you the whole list of platforms that are available. like, every OpenCL platform on the machine, handed to you. it's giving β¨inventoryβ¨.
cl_int clGetPlatformIDs(cl_uint num_entries, cl_platform_id *platforms,
cl_uint *num_platforms);
π PARAMETERS π
num_entriesβ how manycl_platform_identries you're letting it drop intoplatforms. heads up tho: ifplatformsis notNULL, thennum_entrieshas to be greater than zero. no zero. zero is not the vibe.platformsβ this is where the list of OpenCL platforms it found comes back to you. thecl_platform_idvalues that land inplatformsare your little name tags β you use them to point at one specific OpenCL platform. ifplatformsisNULL, this argument just gets ignored entirely, no hard feelings. and here's the tea: the number of OpenCL platforms you actually get back is the minimum of whatever you said innum_entriesor however many OpenCL platforms actually exist. so you don't get more than you asked for, and you don't get more than there is. π«Άnum_platformsβ returns the number of OpenCL platforms available. ifnum_platformsisNULL, this one gets ignored too. lowkey the chillest parameter here.
π ERRORS π
CL_SUCCESSβ returns this when the function executed successfully. slay. πCL_INVALID_VALUEβ returns this ifnum_entriesis equal to zero andplatformsis notNULL, or if bothnum_platformsandplatformsareNULL. basically: you can't ask for zero slots, and you can't ask for nothing at all. pick a struggle bestie.CL_OUT_OF_HOST_MEMORYβ returns this if there's a failure to allocate resources required by the OpenCL implementation on the host. this one is the real "uh oh". π
π SPECIFICATION π
OpenCL Specification[1]
π SEE ALSO π
clGetPlatformInfo(3clc), clGetDeviceInfo(3clc), classDiagram(3clc)
π AUTHORS π
The Khronos Group
π COPYRIGHT π
Copyright Β© 2007-2011 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.
that's the whole license, verbatim, no edits β legal text does NOT get the group-chat treatment, periodt.
π NOTES π
- OpenCL Specification page 33, section 4.1 - Querying Platform Info
and that's the whole page, bestie!! this lil icon dropped on 01/14/2021, brought to you by The Khronos Group, filed under CLGETPLATFORMIDS(3clc) in the OpenCL Manual. go query some platforms, you absolute main character. π¦β¨π
π¦ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms