Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In CUDA kernels, __assume() or __builtin_assume()?

CUDA offers the kernel author two functions, __builtin_assume() and __assume(). Their signatures are the same:

void __builtin_assume(bool exp);
void __assume(bool exp);

and so is their one-line documentation. Are they the same? Is one of them deprecated?

like image 799
einpoklum Avatar asked Sep 01 '25 16:09

einpoklum


1 Answers

The difference is mentioned in a blog post: https://developer.nvidia.com/blog/boosting-productivity-and-performance-with-the-nvidia-cuda-11-2-c-compiler/

NVCC also supports a similar built-in function, __assume(bool), when using cl.exe as a host compiler.

like image 173
Abator Abetor Avatar answered Sep 08 '25 12:09

Abator Abetor