PREFETCH(3clc)
π PREFETCH β the OpenCL manual page, but make it cute π
okay bestie, welcome to PREFETCH(3clc), straight out of the OpenCL Manual β¨ it's a teeny tiny little function that does one (1) thing and does it slayfully. let's get into it π«Ά
πΈ NAME πΈ
prefetch β prefetch bytes into the global cache. that's it. that's the whole job. iconic behavior honestly π
void prefetch(const __global gentype *p, size_t num_gentypes);
look at her. so small. so powerful. π
π¦ DESCRIPTION π¦
so what she does is: she prefetches num_gentypes * sizeof(gentype) bytes into the global cache. math girlie π
β¨
the prefetch instruction is applied to a work-item in a work-group, and β this is the important part, no cap β it does not affect the functional behavior of the kernel. it's purely a vibe check for the cache. she's not changing your results, she's just warming things up like a lil microwave for your data π
π NOTES π
the generic type name gentype indicates the built-in data types:
char,char{2|3|4|8|16}uchar,uchar{2|3|4|8|16}short,short{2|3|4|8|16}ushort,ushort{2|3|4|8|16}int,int{2|3|4|8|16}uint,uint{2|3|4|8|16}long,long{2|3|4|8|16}ulong,ulong{2|3|4|8|16}float,float{2|3|4|8|16}double,double{2|3|4|8|16}
...as the type for the arguments unless otherwise stated. so like, default assumption, okurrr? π
β SPECIFICATION β
OpenCL Specification[1] β yes she's a specification girlie, we stan a standards-compliant queen π
π SEE ALSO π
asyncCopyFunctions(3clc)β go read her sister page, they're a duo fr fr π
π AUTHORS π
The Khronos Group β the collective main characters who brought you this π β¨
π 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. ππ (yes that's the whole thing, every word, we don't skip legal text in this house)
πΈ NOTES πΈ (the footnote era)
- OpenCL Specification page 276, section 6.12.10 - Async Copies from Global to Local Memory... π¦
ok that's the whole page bestie, every flag, every type, every byte of legalese preserved π― no skips, no shortcuts, we keep it exactly as written β¨
and that's a wrap on PREFETCH(3clc) from The Khronos Group, dated 01/14/2021 πΈπ go prefetch something and be the main character of your own cache, ily, bye π«Άπ
π¦ 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