CL_KHR_3D_IMAGE_WRIT(3clc)

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

✨ CL_KHR_3D_IMAGE_WRIT ✨

okay bestie, gather round, because this is a page from the OpenCL Manual and it's about a lil extension called cl_khr_3d_image_writes πŸ’–


πŸ’« NAME πŸ’«

cl_khr_3d_image_writes β€” the extension that finally lets you write to 3D image memory objects πŸŽ€

And the magic spell you cast in your kernel source is literally this:

#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable

that's it. that's the incantation. ✨


🌸 DESCRIPTION 🌸

So here's the tea β˜• OpenCL supports 2D image memory objects that kernels can read or write. But β€” and this is important, no cap β€” reading and writing the same 2D image memory object inside a kernel is not supported. pick a lane, babe. πŸ’…

OpenCL also supports reads to 3D image memory objects in kernels. Writes to a 3D image memory object? Not supported. 🚫 Unless the cl_khr_3d_image_writes extension is implemented, in which case slay, you're in business. And same rule as the 2D situation: reads and writes to the same 3D image memory object are not allowed in a kernel. periodt. πŸ‘‘

So if an application wants to use this extension to write to 3D image memory objects, it needs to include this directive in the OpenCL program source:

#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable

fr fr, that one line is the whole vibe check. 🌈

And the write_image3d(3clc) functions are implemented by the cl_khr_3d_image_writes extension. that's their home. 🏑


πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1] β€” yeah, go read it, iykyk πŸ¦‹


πŸ‘€ SEE ALSO πŸ‘€

go peek at those when you're done here, bestie 🫢


πŸ‘‘ 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.

okay so legally speaking this is the "please keep this notice, we're being nice about it" situation πŸ’– do not strip it, that's not the move.

πŸ“ NOTES πŸ“

  1. OpenCL Specification page 12, section 9.4 - Writing to 3D image memory objects πŸ“–

The Khronos Group Β· 01/14/2021 Β· and that's the whole page, bestie πŸ’…βœ¨ mwah, go write some 3D images πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from