CLFLUSH(3clc)

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

πŸ’… CLFLUSH β€” the OpenCL Manual, bestie edition

okay so you're here because of clFlush from the OpenCL Manual (3clc section, and yes it's CLFLUSH(3clc), the Khronos girlies know) and honestly? you're about to be obsessed. let's get into it πŸ¦‹


✨ NAME ✨

clFlush β€” issues all previously queued OpenCL commands in a command-queue to the device associated with the command-queue. no cap, that's the whole vibe.

cl_int clFlush(cl_command_queue command_queue);

🌸 NOTES 🌸

So clFlush issues all previously queued OpenCL commands in command_queue to the device associated with command_queue. that's it, that's the job πŸ’–

⚠️ But listen, and listen closely bestie: clFlush only guarantees that all queued commands to command_queue will eventually be submitted to the appropriate device. There is no guarantee that they will be complete after clFlush returns. it's giving "i sent the text, not my problem if they replied" 😭

Okay so the tea on implicit flushes πŸ«– β€” any blocking commands queued in a command-queue and clReleaseCommandQueue(3clc) perform an implicit flush of the command-queue. The blocking commands in question, for the girlies keeping score:

And here's the plot twist πŸ‘‘ β€” if you wanna use event objects that refer to commands enqueued in a command-queue as event objects to wait on by commands enqueued in a different command-queue, your application must call a clFlush or any of those blocking commands that perform an implicit flush of the command-queue where the commands that refer to these event objects are enqueued. cross-queue communication? she requires a handshake, periodt.


πŸ’€ ERRORS πŸ’€

Returns CL_SUCCESS if the function call was executed successfully. Otherwise, it returns one of the following:

  • CL_INVALID_COMMAND_QUEUE β€” if command_queue is not a valid command-queue. fake queue, blocked 🚫
  • CL_OUT_OF_HOST_MEMORY β€” if there is a failure to allocate resources required by the OpenCL implementation on the host.
  • CL_OUT_OF_RESOURCES β€” if there is a failure to allocate resources required by the OpenCL implementation on the device.

πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1] β€” iconic, obviously.


πŸ‘€ SEE ALSO πŸ‘€

  • clFinish(3clc) β€” the one who actually waits around for things to be done πŸ’…

πŸŽ€ 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.


πŸ”₯ NOTES πŸ”₯

  1. OpenCL Specification β€” page 193, section 5.13 - Flush and Finish. iykyk, go read it πŸ“–

and that's the whole page, bestie β€” brought to you by The Khronos Group, dated 01/14/2021, filed under CLFLUSH(3clc) 🫢 go forth and flush responsibly, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from