diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-03-02 12:30:25 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-02 12:30:25 -0500 |
| commit | b85ca6f86d46ee3c4d5784d0bd4ebc8509e2a9bd (patch) | |
| tree | e91ce5470664cbd623374534e69e4bfc8a0f1840 /tools/slang-profile | |
| parent | 6e9f407ad42ce635528b30f21366f903903a3682 (diff) | |
Feature/profile tool (#1251)
* WIP slang-profile
* Turn on symbols needed for profile.
* Remove calls to slang API from core as doing so broke profiling information.
Fix premake so slang-profile works on VS.
Diffstat (limited to 'tools/slang-profile')
| -rw-r--r-- | tools/slang-profile/slang-profile-main.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/slang-profile/slang-profile-main.cpp b/tools/slang-profile/slang-profile-main.cpp new file mode 100644 index 000000000..19fb36604 --- /dev/null +++ b/tools/slang-profile/slang-profile-main.cpp @@ -0,0 +1,41 @@ +// slang-profile-main.cpp + +#include "../../source/core/slang-io.h" +#include "../../source/core/slang-std-writers.h" + +#include "../../source/core/slang-process-util.h" + +#include "../../slang-com-helper.h" + +#include "../../source/core/slang-string-util.h" + +using namespace Slang; + +SlangResult innerMain(int argc, char** argv) +{ + auto stdWriters = StdWriters::initDefaultSingleton(); + + // Time the creation of the session + { + const auto startTick = ProcessUtil::getClockTick(); + + ComPtr<slang::IGlobalSession> slangSession; + slangSession.attach(spCreateSession(nullptr)); + + const auto endTick = ProcessUtil::getClockTick(); + + printf("Ticks %f\n", double(endTick - startTick) / ProcessUtil::getClockFrequency()); + return SLANG_OK; + } + + return SLANG_OK; +} + +int main(int argc, char** argv) +{ + const SlangResult res = innerMain(argc, argv); +#ifdef _MSC_VER + _CrtDumpMemoryLeaks(); +#endif + return SLANG_SUCCEEDED(res) ? 0 : 1; +} |
