3

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?

talonmies
  • 70,661
  • 34
  • 192
  • 269
einpoklum
  • 118,144
  • 57
  • 340
  • 684

1 Answers1

3

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.

Abator Abetor
  • 2,345
  • 1
  • 10
  • 12
  • Why is there different syntax for cl.exe and other compilers? It's not as though `__builtin_assume` is even a GCC builtin, according to the link? – einpoklum Mar 03 '22 at 11:28