CLGETPLATFORMIDS(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

πŸ’– 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 many cl_platform_id entries you're letting it drop into platforms. heads up tho: if platforms is not NULL, then num_entries has 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. the cl_platform_id values that land in platforms are your little name tags β€” you use them to point at one specific OpenCL platform. if platforms is NULL, 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 in num_entries or 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. if num_platforms is NULL, 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 if num_entries is equal to zero and platforms is not NULL, or if both num_platforms and platforms are NULL. 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 Β© 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 πŸ“

  1. 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