From 259a015feb9d4ab65e8fbba32f6c777e92780cc7 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 22 Mar 2023 21:16:35 -0700 Subject: Type legalization and autodiff bug fixes. (#2722) * Bug fixes. * Fix. * Only perform autodiff for functions whose derivative is actually used. * Fix loop optimize bug. * Fix high order diff. * Fix trivial diff func generation. * Fixes. * Cleanup. --------- Co-authored-by: Yong He --- source/core/slang-dictionary.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/core') diff --git a/source/core/slang-dictionary.h b/source/core/slang-dictionary.h index e923832e5..fffec9640 100644 --- a/source/core/slang-dictionary.h +++ b/source/core/slang-dictionary.h @@ -648,6 +648,14 @@ namespace Slang { return dict.AddIfNotExists(_Move(obj), _DummyClass()); } + bool add(const T& obj) + { + return dict.AddIfNotExists(obj, _DummyClass()); + } + bool add(T&& obj) + { + return dict.AddIfNotExists(_Move(obj), _DummyClass()); + } void Remove(const T & obj) { dict.Remove(obj); -- cgit v1.2.3