Update codegen.cpp to use `std::format`.
Open
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 486
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 295
Description
codegen.cpp is difficult to modify due to multiple codepaths re-using the same formats in the same function body. We can split this up and generate code using {fmt} instead of stream injection.
Further we can reduce the amount of generated code by injecting some components of the inline PTX statements using the C++ type system.
```C++
{
asm volatile("atom.%3%4%5.{0}{1} %0,[%1],%2;"
: "={2}"(__dst)
: "l"(__ptr), "{2}"(__op), "C"(_Op::value), "C"(_Scope::value), "C"(_Memorder::value)
: "memory");
}
```
Contributor guide
Assessment
This issue has not been assessed yet.