ACCESSQUALIFIERS(3clc)
π ACCESSQUALIFIERS π
okay bestie, welcome to the OpenCL Manual page for ACCESSQUALIFIERS(3clc) β yes it's a whole manual page and yes it's about access qualifiers, we're doing this, sit down, hydrate, let's go π«Ά
β¨ NAME β¨
Access_Qualifiers β Access Qualifiers for image memory objects. periodt.
__read_only __write_only read_only
write_only
πΈ DESCRIPTION πΈ
okay so picture this: image objects that get passed in as arguments to a kernel can be declared as read-only or write-only. that's the whole vibe. π¦
and here's the tea, bestie: a kernel cannot read from and write to the same image object. it's giving "pick a lane." π
so the __read_only (or read_only) and __write_only (or write_only) qualifiers must be used with image object arguments, to declare whether the image object is being read or written by a kernel. no guessing games, you have to say it out loud.
and the default qualifier? it's __read_only. the shy one. the default. π
π NOTES π
okay so real talk, these names:
__read_only__write_only__read_writeread_onlywrite_onlyread_write
are reserved for use as access qualifiers and shall not be used otherwise. like, they are taken. spoken for. not yours to reuse, iykyk. don't do it. π
π Example
in the example below, imageA is a read-only 2D image object, and imageB is a write-only 2D image object. iconic duo, one reads one writes, no drama:
__kernel void foo (read_only image2d_t
imageA, write_only image2d_t imageB) {
... }
π SPECIFICATION π
OpenCL Specification<sup>[1]</sup>
π§ AUTHORS π§
The Khronos Group β the main characters, honestly. π
π 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 following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Materials.
β οΈ bestie this part is the legal bit β copy it verbatim, no edits, no vibe remix, we do not touch the license text. π
π NOTES π
- OpenCL Specification β page 226, section 6.6 - Access Qualifiers
and that's the whole page, you ate it π this edition came from The Khronos Group and it's dated 01/14/2021, so if you're citing it, that's the version, no cap. go forth and qualify your accesses, bestie ππβ¨
π¦ 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