CLGETPLATFORMINFO(3clc)

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

πŸ’– clGetPlatformInfo β€” the OpenCL Manual, but make it cute (3clc) πŸ’–

okay so bestie. welcome to the clGetPlatformInfo(3clc) page, straight out of the OpenCL Manual. this is the one where you go "hey platform, who even ARE you" and it tells you. let's get into it 🫢


✨ NAME ✨

clGetPlatformInfo β€” get specific information about the OpenCL platform.

like. the whole vibe of this function is "tell me about yourself" and honestly? main character energy. 🌸


🌈 SYNOPSIS 🌈

cl_int clGetPlatformInfo(cl_platform_id platform,
                         cl_platform_info param_name,
                         size_t param_value_size, void *param_value,
                         size_t *param_value_size_ret);

no cap, that's the whole signature. five arguments, one cl_int coming back at you. slay. πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • platform β€” the platform ID you got back from clGetPlatformIDs(3clc), or it can be NULL. and if platform is NULL?? bestie that behavior is implementation-defined. so like, whatever the implementation decides, that's what happens. we don't make the rules. 😭
  • param_name β€” an enumeration constant that says which lil piece of platform info you're asking for. it can be one of the values in the table down below πŸ‘‡
  • param_value β€” a pointer to the memory location where the appropriate values for a given param_value get returned. the possible param_value values that come back are listed in the table below. if param_value is NULL, it is ignored. (ghosted. πŸ«₯)
  • param_value_size β€” specifies the size in bytes of the memory pointed to by param_value. this size in bytes must be β‰₯ size of return type specified in the table below. like, don't skimp, okay? πŸ‘‘
  • param_value_size_ret β€” returns the actual size in bytes of data being queried by param_value. if param_value_size_ret is NULL, it is ignored. (also ghosted πŸ’€)

πŸ” OpenCL Platform Queries πŸ”

okay this is the table, but the terminal ate the box-drawing characters so we're doing it as a list. every single row is here, promise. 🀞

  • CL_PLATFORM_PROFILE β†’ return type char[] β†’ OpenCL profile string. returns the profile name supported by the implementation. the profile name returned can be one of the following strings:
    • FULL_PROFILE β€” if the implementation supports the OpenCL specification (functionality defined as part of the core specification and does not require any extensions to be supported). it's giving "we do it all, no extras needed" πŸ’…
    • EMBEDDED_PROFILE β€” if the implementation supports the OpenCL embedded profile. the embedded profile is defined to be a subset for each version of OpenCL. lowkey the diet version but make it official. πŸ“
  • CL_PLATFORM_VERSION β†’ return type char[] β†’ OpenCL version string. returns the OpenCL version supported by the implementation. this version string has the following format:
OpenCL<space><major_version.minor_version><space><platform-specific information>

and the major_version.minor_version value returned will be 1.2.

yes, literally 1.2. period included. that's the spec's business, not mine. ✨

  • CL_PLATFORM_NAME β†’ return type char[] β†’ Platform name string. that's it. that's the whole row. iconic brevity. πŸ‘‘
  • CL_PLATFORM_VENDOR β†’ return type char[] β†’ Platform vendor string. who made it, basically. 🏷️
  • CL_PLATFORM_EXTENSIONS β†’ return type char[] β†’ returns a space-separated list of extension names (the extension names themselves do not contain any spaces β€” important!! don't @ me) supported by the platform. extensions defined here must be supported by all devices associated with this platform. so like, if it's on the list, every device on that platform has to show up for it. no slackers. 😀

πŸ’œ NOTES πŸ’œ

a null terminated string is returned by OpenCL query function calls if the return type of the information being queried is a char[].

that's it. that's the note. short king note. 🧚


πŸ’€ ERRORS πŸ’€

returns CL_SUCCESS if the function is executed successfully. otherwise, it returns the following:

  • CL_INVALID_PLATFORM β€” if platform is not a valid platform. 🚫
  • CL_INVALID_VALUE β€” if param_name is not one of the supported values or if size in bytes specified by param_value_size is less than size of return type and param_value is not a NULL value.
  • CL_OUT_OF_HOST_MEMORY β€” if there is a failure to allocate resources required by the OpenCL implementation on the host. the host said "i have no memory for this rn" 😭
lowkey pay attention to that second one: param_value_size too small and param_value isn't NULL = CL_INVALID_VALUE. don't try to be slick. 🌈

πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1]


πŸ‘€ SEE ALSO πŸ‘€

clGetPlatformIDs(3clc)


πŸ‘‘ AUTHORS πŸ‘‘

The Khronos Group


bestie we are NOT done yet β€” part 2 is coming, so don't go anywhere πŸ’–

Okay bestie, legal era πŸ’… this is the part where the grown-ups talk, and we do not paraphrase legal text, so here it is in its whole entire glory, character for character, no cap:

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.

Translation for the girlies: free to use, free to remix, free to ship β€” just keep the notice attached, bestie, that's the whole deal 🀝✨


πŸ“ NOTES πŸ“

  1. OpenCL Specification β€” page 33, section 4.1 - Querying Platform Info πŸ¦‹
That's your homework, babe. Go read the spec page, it's literally right there. iykyk πŸ’–

And that's the whole page, start to finish, no crumbs left behind πŸ“ This little legend comes to you from The Khronos Group, version stamped 01/14/2021, filed under CLGETPLATFORMINFO(3clc) β€” go forth and query those platforms, queen πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from