torch-mlir/include/npcomp/RefBackend/Runtime
Sean Silva 0b7c443256 [RefBackend] Properly initialize refbackrt::Tensor refcount.
Although `refCount` is initialized as `std::atomic<int> refCount{0};` in
the definition of Tensor, our tail-allocating malloc would ignore it,
resulting in bogus values that led to leaks.

Caught with LeakSanitizer, but I added an assertion that the refcount is
non-negative to begin with, which should catch this bug in the future
fairly consistently (assuming the garbage refcount is negative half the
time).
2020-11-24 12:01:35 -08:00
..
README.md [RefBackend] Rename Npcomprt dialect to Refbackrt. 2020-10-08 09:07:00 -07:00
Support.h [RefBackend] Rename Npcomprt dialect to Refbackrt. 2020-10-08 09:07:00 -07:00
UserAPI.h [RefBackend] Properly initialize refbackrt::Tensor refcount. 2020-11-24 12:01:35 -08:00

README.md

Refbackrt (namespace refbackrt) is the runtime support library for the RefBackend backend. It is best practice to keep compiler and runtime code totally firewalled.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! As such, this directory should have NO DEPENDENCIES ON COMPILER CODE (no LLVM libSupport, etc.). !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This will cause some duplication, but history has shown that this firewalling pays big dividends. In particular, compiler code very frequently has binary sizes that are simply unacceptable in runtime scenarios, such as MByte-sized dependencies like LLVM libSupport. Runtime code should fit in kBytes.